:root {
  --brand: #075a96;
  --brand-dark: #063d66;
  --brand-light: #e8f4fb;
  --accent: #1ea7d8;
  --surface: #f5f8fb;
  --text: #163047;
  --navbar-text: #ffffff;
  --button-text: #ffffff;
}

* { box-sizing: border-box; }
body { background: var(--surface); color: var(--text); min-height: 100vh; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
.app-navbar { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: var(--navbar-text); }
.app-navbar .navbar-brand,
.app-navbar .nav-link { color: var(--navbar-text); }
.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus { color: var(--navbar-text); opacity: .82; }
.navbar-brand { font-weight: 700; max-width: min(62vw, 380px); }
.navbar-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navbar-company-logo { width: auto; height: 38px; max-width: 150px; object-fit: contain; background: rgba(255,255,255,.92); border-radius: .55rem; padding: .22rem .38rem; }
.app-navbar .btn-outline-light { --bs-btn-color: var(--navbar-text); --bs-btn-border-color: color-mix(in srgb, var(--navbar-text) 65%, transparent); }

.btn-primary {
  --bs-btn-color: var(--button-text);
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: var(--button-text);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-color: var(--button-text);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: var(--button-text);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-color: var(--button-text);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
}
.text-primary { color: var(--brand) !important; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--brand) 22%, transparent); }
.page-link { color: var(--brand); }
.active > .page-link, .page-link.active { background-color: var(--brand); border-color: var(--brand); color: var(--button-text); }

.auth-shell { min-height: calc(100vh - 110px); display: grid; place-items: center; padding: 1rem; }
.auth-card { max-width: 960px; width: 100%; border-radius: 1.25rem; }
.auth-card.compact { max-width: 480px; }
.auth-brand-panel { background: linear-gradient(145deg, var(--brand-dark), var(--brand), var(--accent)); color: var(--navbar-text); align-items: center; justify-content: center; text-align: center; padding: 3rem; }
.auth-company-logo { width: min(230px, 85%); max-height: 120px; object-fit: contain; background: rgba(255,255,255,.94); padding: .7rem 1rem; border-radius: 1rem; }
.admin-login-logo { width: min(220px, 70%); max-height: 105px; object-fit: contain; }

.store-hero { position: relative; min-height: 230px; border-radius: 1.25rem; overflow: hidden; background: linear-gradient(135deg, var(--brand-dark), var(--brand), var(--accent)); background-size: cover; background-position: center; color: #fff; box-shadow: 0 .75rem 2rem color-mix(in srgb, var(--brand-dark) 22%, transparent); }
.store-hero-overlay { position: absolute; inset: 0; }
.store-hero:not(.has-image) .store-hero-overlay { background: linear-gradient(110deg, color-mix(in srgb, var(--brand-dark) 90%, transparent), color-mix(in srgb, var(--brand) 45%, transparent)) !important; }
.store-hero-content { position: relative; z-index: 1; min-height: 230px; display: flex; align-items: center; gap: 1.5rem; padding: clamp(1.5rem, 4vw, 3.5rem); max-width: 920px; }
.store-hero-content h1 { font-size: clamp(1.65rem, 4vw, 2.75rem); font-weight: 800; margin: 0 0 .5rem; text-shadow: 0 2px 12px rgba(0,0,0,.28); }
.store-hero-content p { font-size: clamp(.95rem, 2vw, 1.15rem); margin: 0; opacity: .92; max-width: 720px; }
.store-hero-logo { width: clamp(90px, 14vw, 160px); height: clamp(70px, 11vw, 120px); object-fit: contain; padding: .65rem; border-radius: 1rem; background: rgba(255,255,255,.94); flex: 0 0 auto; }

.product-card { border-radius: 1rem; overflow: hidden; transition: .2s transform, .2s box-shadow; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 .75rem 1.5rem color-mix(in srgb, var(--brand-dark) 14%, transparent) !important; }
.product-image-wrap { position: relative; background: white; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-image-wrap img { width: 100%; height: 100%; object-fit: contain; padding: .65rem; }
.product-placeholder { font-size: 3rem; color: color-mix(in srgb, var(--brand) 35%, #adb5bd); }
.stock-badge { position: absolute; right: .5rem; bottom: .5rem; background: color-mix(in srgb, var(--brand-dark) 90%, transparent); color: #fff; border-radius: 999px; padding: .25rem .55rem; font-size: .7rem; }
.product-title { height: 2.55rem; overflow: hidden; margin: .25rem 0 .5rem; }
.price { font-size: 1.2rem; font-weight: 800; color: var(--brand); }
.cart-thumb, .admin-thumb { width: 52px; height: 52px; border-radius: .65rem; object-fit: contain; background: white; border: 1px solid #e1e9ef; }
.admin-thumb.placeholder { display: grid; place-items: center; color: #9fb0bd; }
.empty-state { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #6c7e8c; }
.empty-state > i { font-size: 4rem; color: color-mix(in srgb, var(--brand) 40%, #adb5bd); margin-bottom: 1rem; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: .3rem .65rem; font-size: .75rem; font-weight: 700; }
.status-new { background: #fff3cd; color: #664d03; }
.status-claimed { background: #cff4fc; color: #055160; }
.status-imported { background: #d1e7dd; color: #0f5132; }
.status-error { background: #f8d7da; color: #842029; }
.status-cancelled { background: #e2e3e5; color: #41464b; }
.metric-card { height: 100%; background: white; border-radius: 1rem; box-shadow: 0 .25rem 1rem rgba(20,50,74,.07); padding: 1.2rem; display: flex; align-items: center; gap: 1rem; }
.metric-card > i { width: 48px; height: 48px; border-radius: .8rem; background: var(--brand-light); color: var(--brand); display: grid; place-items: center; font-size: 1.4rem; }
.metric-card span { display: block; color: #6c7e8c; font-size: .82rem; }
.metric-card strong { display: block; font-size: 1.8rem; }

.mobile-bottom-nav { position: fixed; z-index: 1040; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #dce6ed; display: grid; grid-template-columns: repeat(3,1fr); padding: .45rem env(safe-area-inset-right) calc(.45rem + env(safe-area-inset-bottom)) env(safe-area-inset-left); box-shadow: 0 -.25rem 1rem rgba(0,0,0,.08); }
.mobile-bottom-nav a { color: color-mix(in srgb, var(--text) 75%, #6c757d); text-decoration: none; text-align: center; font-size: .72rem; display: flex; flex-direction: column; position: relative; }
.mobile-bottom-nav i { font-size: 1.25rem; }
.mobile-bottom-nav b { position: absolute; top: -2px; left: calc(50% + 9px); background: var(--accent); color: #111; border-radius: 999px; min-width: 18px; font-size: .65rem; }
.pb-mobile-nav { padding-bottom: 5.5rem !important; }

.cart-expiration-banner { display: flex; align-items: center; gap: 1rem; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: var(--navbar-text); border-radius: 1rem; padding: 1rem 1.15rem; }
.cart-expiration-icon, .cart-modal-icon, .checkout-icon { width: 48px; height: 48px; min-width: 48px; border-radius: .9rem; display: grid; place-items: center; background: rgba(255,255,255,.16); font-size: 1.45rem; }
.cart-modal-icon { width: 64px; height: 64px; background: var(--brand-light); color: var(--brand); font-size: 2rem; }
.checkout-icon { background: var(--brand-light); color: var(--brand); }
.cart-row-blocked { background: #fff5f5 !important; }
.cart-row-blocked td { color: #6c757d; }
.cart-row-blocked strong { color: #842029; }
.cart-table thead th { white-space: nowrap; }
.cart-table td { vertical-align: middle; }

/* Administração: identidade visual */
.palette-option { position: relative; display: flex; flex-direction: column; gap: .45rem; padding: 1rem; border: 2px solid #e4e9ed; border-radius: 1rem; background: #fff; cursor: pointer; transition: border-color .18s, transform .18s, box-shadow .18s; }
.palette-option:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, #e4e9ed); box-shadow: 0 .5rem 1rem rgba(0,0,0,.07); }
.palette-option.is-selected { border-color: var(--brand); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 16%, transparent); }
.palette-option .form-check-input { position: absolute; right: .8rem; top: .8rem; }
.palette-option strong { padding-right: 1.25rem; }
.palette-option small { color: #6c757d; line-height: 1.25; }
.palette-swatches { display: grid; grid-template-columns: repeat(4,1fr); height: 38px; border-radius: .65rem; overflow: hidden; margin-bottom: .2rem; }
.palette-swatches i { display: block; }
.palette-custom-icon { height: 38px; border-radius: .65rem; background: linear-gradient(90deg,#e64980,#7950f2,#228be6,#20c997,#fab005); color: #fff; display: grid; place-items: center; font-size: 1.2rem; }
.color-field-group .input-group-text { background: #fff; }
.color-field-group .form-control-color { width: 44px; height: 34px; cursor: pointer; }
.branding-upload-preview { min-height: 180px; border: 2px dashed #ced7de; border-radius: 1rem; background: color-mix(in srgb, var(--surface) 65%, #fff); display: grid; place-items: center; overflow: hidden; }
.branding-upload-preview.banner-preview { min-height: 210px; }
.branding-upload-preview img { width: 100%; height: 210px; object-fit: contain; background: #fff; }
.branding-upload-preview.logo-preview img { height: 180px; padding: 1rem; }
.branding-upload-preview > div { display: flex; flex-direction: column; align-items: center; gap: .5rem; color: #8b9aa5; }
.branding-upload-preview > div i { font-size: 2.8rem; }
.branding-live-preview {
  --preview-primary-color: var(--brand);
  --preview-primary-dark-color: var(--brand-dark);
  --preview-primary-light-color: var(--brand-light);
  --preview-accent-color: var(--accent);
  --preview-surface-color: var(--surface);
  --preview-text-color: var(--text);
  --preview-navbar-text-color: var(--navbar-text);
  --preview-button-text-color: var(--button-text);
  background: var(--preview-surface-color); color: var(--preview-text-color); min-height: 430px;
}
.preview-navbar { min-height: 66px; padding: .75rem 1.2rem; background: linear-gradient(135deg,var(--preview-primary-dark-color),var(--preview-primary-color)); color: var(--preview-navbar-text-color); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.preview-brand { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.preview-brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.preview-logo { width: 42px; height: 42px; border-radius: .55rem; background: rgba(255,255,255,.94); color: var(--preview-primary-color); display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; }
.preview-logo img { width: 100%; height: 100%; object-fit: contain; padding: .25rem; }
.preview-links { display: flex; gap: 1rem; font-size: .85rem; }
.preview-page { padding: 1.25rem; }
.preview-hero { position: relative; min-height: 190px; border-radius: 1rem; overflow: hidden; color: #fff; background: linear-gradient(135deg,var(--preview-primary-dark-color),var(--preview-primary-color),var(--preview-accent-color)); background-size: cover; background-position: center; }
.preview-hero-overlay { position: absolute; inset: 0; }
.preview-hero:not(.has-image) .preview-hero-overlay { background: linear-gradient(110deg,color-mix(in srgb,var(--preview-primary-dark-color) 88%,transparent),color-mix(in srgb,var(--preview-primary-color) 38%,transparent)) !important; }
.preview-hero-content { position: relative; z-index: 1; padding: 2rem; max-width: 620px; }
.preview-hero-content h3 { font-weight: 800; }
.preview-hero-content button, .preview-product button { border: 0; border-radius: .55rem; padding: .55rem .85rem; background: var(--preview-primary-color); color: var(--preview-button-text-color); font-weight: 700; }
.preview-products { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin-top: 1rem; }
.preview-product { background: #fff; border-radius: .8rem; padding: 1rem; display: flex; align-items: center; gap: .75rem; box-shadow: 0 .2rem .7rem rgba(0,0,0,.06); }
.preview-product > i { width: 52px; height: 52px; border-radius: .7rem; display: grid; place-items: center; background: var(--preview-primary-light-color); color: var(--preview-primary-color); font-size: 1.3rem; }
.preview-product strong { flex: 1; }
.preview-product span { color: var(--preview-primary-color); font-weight: 800; }
.sticky-save-bar { position: sticky; z-index: 1020; bottom: 1rem; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border: 1px solid #e5e9ec; border-radius: 1rem; padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

@media (min-width: 992px) { .pb-mobile-nav { padding-bottom: 2rem !important; } }
@media (max-width: 991px) { .preview-links { display: none; } }
@media (max-width: 767px) {
  .container-xl { padding-left: .8rem; padding-right: .8rem; }
  .product-card .card-body { padding: .75rem; }
  .product-title { font-size: .88rem; height: 2.3rem; }
  .price { font-size: 1rem; }
  .stock-badge { font-size: .62rem; }
  .table { font-size: .85rem; }
  .cart-expiration-banner { align-items: flex-start; flex-wrap: wrap; }
  .cart-expiration-banner .btn { margin-left: 64px; }
  .cart-table { min-width: 780px; }
  .store-hero, .store-hero-content { min-height: 200px; }
  .store-hero-content { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .store-hero-logo { width: 105px; height: 70px; }
  .preview-products { grid-template-columns: 1fr; }
  .preview-product { flex-wrap: wrap; }
  .sticky-save-bar { bottom: .5rem; align-items: stretch; flex-direction: column; }
  .sticky-save-bar .btn { width: 100%; }
}

/* Vitrine Sync 1.4 - promoções sincronizadas */
.promo-strip { background: linear-gradient(135deg, var(--brand-light), #fff); }
.promo-scroll { display:flex; gap:.75rem; overflow-x:auto; padding-bottom:.25rem; scroll-snap-type:x mandatory; }
.promo-mini-card { min-width: 220px; display:flex; gap:.75rem; align-items:center; padding:.75rem; border-radius:1rem; background:#fff; text-decoration:none; color:var(--text); box-shadow:0 .35rem 1rem rgba(0,0,0,.07); scroll-snap-align:start; }
.promo-mini-card img,.promo-mini-placeholder { width:54px; height:54px; border-radius:.85rem; object-fit:cover; background:var(--brand-light); display:grid; place-items:center; color:var(--brand); flex:0 0 auto; }
.promo-mini-card span { min-width:0; display:flex; flex-direction:column; }
.promo-mini-card b,.promo-mini-card small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.promo-mini-card em { color:#b45309; font-style:normal; font-weight:800; }
.promo-ribbon { position:absolute; top:.75rem; left:.75rem; z-index:2; padding:.28rem .55rem; border-radius:999px; background:#ffc107; color:#3b2f00; font-size:.76rem; font-weight:800; box-shadow:0 .25rem .7rem rgba(0,0,0,.18); }
.old-price { font-size:.85rem; color:#8b96a5; text-decoration:line-through; }
.promo-price { color:#b45309; }
.promotion-card { border:1px solid rgba(255,193,7,.35)!important; }
.promotion-page-hero { background: radial-gradient(circle at top left, var(--brand-light), #fff 45%, rgba(255,193,7,.16)); }
.promo-notification-toast .toast-header { background: var(--brand); color: var(--navbar-text); }
.promo-notification-toast img { width:46px; height:46px; object-fit:cover; border-radius:.7rem; }
@media (max-width: 576px){ .promo-mini-card{min-width: 78vw;} .mobile-bottom-nav{grid-template-columns: repeat(4,1fr);} }
