/*
  Storefront design tokens + shared components.
  --brand / --brand-2 are set inline per-request from StoreSetting (primary/secondary_color)
  and are currently black (#0d0d0d) / yellow (#FFD400) — the site's fixed 3-color brand palette
  is black + yellow + light orange (--sf-orange below is the third, fixed here since there's
  no third StoreSetting field for it).
*/
:root{
  --sf-surface: #ffffff;
  --sf-surface-2: #f5f6f8;
  --sf-ink: #0f172a;
  --sf-ink-muted: #64748b;
  --sf-border: #e2e5ea;
  --sf-radius-sm: .5rem;
  --sf-radius: .75rem;
  --sf-radius-lg: 1rem;
  --sf-shadow-sm: 0 1px 3px rgba(15,23,42,.06);
  --sf-shadow: 0 4px 16px rgba(15,23,42,.08);
  --sf-shadow-lg: 0 12px 28px rgba(15,23,42,.14);
  --sf-orange: #FF9F45;
  --sf-deal: var(--sf-orange);
}

/* ---------- Brand palette applied to Bootstrap's own primary/utility classes ----------
   Bootstrap ships precompiled (not built from our Sass source), so .btn-primary etc. are
   NOT driven by --brand/--brand-2 automatically. Bootstrap 5's per-component CSS variables
   let us retint them here without recompiling. */
.btn-primary{
  --bs-btn-bg: var(--brand-2);
  --bs-btn-border-color: var(--brand-2);
  --bs-btn-color: var(--brand);
  --bs-btn-hover-bg: var(--sf-orange);
  --bs-btn-hover-border-color: var(--sf-orange);
  --bs-btn-hover-color: var(--brand);
  --bs-btn-active-bg: var(--sf-orange);
  --bs-btn-active-border-color: var(--sf-orange);
  --bs-btn-active-color: var(--brand);
  --bs-btn-disabled-bg: var(--brand-2);
  --bs-btn-disabled-border-color: var(--brand-2);
}
.btn-outline-primary{
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand);
  --bs-btn-active-border-color: var(--brand);
}
.text-primary{ color: var(--brand) !important; }
#cart-badge{ background-color: var(--sf-orange) !important; color: var(--brand); }

/* ---------- Header ---------- */
.storefront-header{
  z-index: 1030;
}
.storefront-search{
  max-width: 720px;
}
.storefront-search .input-group{
  border-radius: 999px;
  border: 1px solid var(--sf-border);
  box-shadow: var(--sf-shadow-sm);
  /* No overflow:hidden here on purpose — it would clip the category dropdown menu,
     which Bootstrap renders as a normal (non-portaled) child of this input-group. */
}
.storefront-search .form-control{
  border: 0;
  border-radius: 0 !important;
  box-shadow: none;
  padding-left: 1.1rem;
}
.storefront-search .form-control:focus{
  box-shadow: none;
}
.storefront-search .btn-search{
  background: var(--brand);
  color: #fff;
  border: 0;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-top-right-radius: 999px !important;
  border-bottom-right-radius: 999px !important;
  padding-inline: 1.1rem;
}
.storefront-search .btn-search:hover{
  filter: brightness(.92);
  color: #fff;
}
.category-dropdown-btn{
  border: 0;
  border-right: 1px solid var(--sf-border);
  border-top-left-radius: 999px !important;
  border-bottom-left-radius: 999px !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  background: var(--sf-surface-2);
  color: var(--sf-ink);
  font-size: .85rem;
  white-space: nowrap;
}
.category-dropdown-btn:hover,
.category-dropdown-btn:focus{
  background: var(--sf-surface-2);
  color: var(--brand);
}
.category-dropdown-menu{
  max-height: 60vh;
  overflow-y: auto;
  min-width: 220px;
}

.ratio.ratio-1x1{ --bs-aspect-ratio: 100%; }

/* ---------- Product card (shared by homepage + shop grid) ---------- */
.product-card{
  border-radius: var(--sf-radius-lg);
  border: 1px solid var(--sf-border);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow: var(--sf-shadow-sm);
  background: var(--sf-surface);
}
.product-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--sf-shadow-lg);
  border-color: transparent;
}
.product-media{ position: relative; }
.img-cover{ width: 100%; height: 100%; object-fit: cover; display: block; }
.media-gradient{
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.35), rgba(0,0,0,0) 50%);
  opacity: 0; transition: opacity .2s ease;
}
.product-media:hover .media-gradient{ opacity: .9; }
.icon-stack{
  position: absolute; top: .6rem; right: .6rem;
  display: flex; flex-direction: column; gap: .4rem; z-index: 2;
}

/* Deal / discount badge, driven by real computed discount data (base_price vs final_display_price) */
.deal-badge{
  position: absolute; top: .6rem; left: .6rem; z-index: 2;
  background: var(--sf-deal); color: #fff;
  font-size: .72rem; font-weight: 700;
  padding: .2rem .5rem; border-radius: .4rem;
  box-shadow: var(--sf-shadow-sm);
}
.price-strike{
  color: var(--sf-ink-muted);
  text-decoration: line-through;
  font-size: .85rem;
  margin-right: .4rem;
}
.price-final{
  font-weight: 700;
  color: var(--sf-ink);
}

/* ---------- Quick view modal ---------- */
.qv-media{
  position: relative; min-height: 420px; background: #0b1220;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-top-left-radius: var(--sf-radius-lg); border-bottom-left-radius: var(--sf-radius-lg);
}
.qv-img{ max-width: 100%; max-height: 80vh; transition: transform .1s ease; cursor: zoom-in; user-select: none; }
@media (max-width: 991.98px){
  .qv-media{ border-bottom-left-radius: 0; border-top-right-radius: var(--sf-radius-lg); }
}

/* ---------- Filter chips ---------- */
.chip{
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--sf-surface-2); border: 1px solid var(--sf-border);
  border-radius: 999px; padding: .35rem .7rem; text-decoration: none;
  color: #334155; font-size: .9rem;
}
.chip:hover{ background: #fff; border-color: #cbd5e1; color: var(--sf-ink); }
.chip .chip-x{ color: #94a3b8; margin-left: .2rem; }

/* ---------- Pagination ---------- */
.pagination-modern{ display: flex; gap: .25rem; }
.pagination-modern .page-link{ border-radius: .6rem; border: 1px solid var(--sf-border); color: #334155; background: #fff; padding: .45rem .75rem; }
.pagination-modern .page-link:hover{ border-color: #cbd5e1; color: var(--sf-ink); }
.pagination-modern .page-item.active .page-link{ background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--brand) 20%, transparent); }
.pagination-modern .page-item.disabled .page-link{ color: #94a3b8; background: var(--sf-surface-2); border-color: var(--sf-border); }

.bg-gradient-subtle{ background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 6%, transparent), color-mix(in srgb, var(--brand-2) 6%, transparent)); }
