/* ==========================================================================
   My Zawar — base stylesheet
   Design tokens, element defaults and page behaviour.
   Component classes live in components.css; utility classes come from Tailwind.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   Mirrors assets/js/tailwind.config.js — keep the two in sync when editing.
   -------------------------------------------------------------------------- */
:root {
  /* Wine / oxblood — primary */
  --wine-50:  #FAF2F2;  --wine-100: #F0E2E3;  --wine-200: #DCC3C6;
  --wine-300: #B98D93;  --wine-400: #8A4A53;  --wine-500: #63242F;
  --wine-600: #4E1B26;  --wine-700: #3E141D;  --wine-800: #330E16;
  --wine-900: #2E0B13;  --wine-950: #22060C;

  /* Gold — accent */
  --gold-50:  #FAF5EC;  --gold-100: #F3EADA;  --gold-200: #EADCBE;
  --gold-300: #DFC99B;  --gold-400: #D2B67F;  --gold-500: #C2A05C;
  --gold-600: #A6813F;  --gold-700: #8A6A2F;  --gold-800: #6F5423;

  /* Ivory — surfaces */
  --ivory-50:  #FFFDFB; --ivory-100: #FCF8F5; --ivory-200: #FAF5F0;
  --ivory-300: #F3ECE2; --ivory-400: #E9DFD2; --ivory-500: #DCCFBE;

  /* Ink — text */
  --ink-300: #C9C3C1;  --ink-400: #A9A2A0;  --ink-500: #8A8280;
  --ink-600: #6B6260;  --ink-700: #4A4143;  --ink-800: #2A2224;
  --ink-900: #1C1618;

  /* Lines & surfaces */
  --surface:     #FFFFFF;
  --hairline:    #ECE4DB;
  --line-strong: #DED3C6;

  /* Typefaces */
  --font-serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --font-sans:  Jost, Montserrat, Inter, system-ui, sans-serif;

  /* Motion */
  --ease-silk: cubic-bezier(.22, 1, .36, 1);
  --ease-std:  cubic-bezier(.4, 0, .2, 1);
  --dur-fast:  180ms;
  --dur-base:  300ms;
  --dur-image: 700ms;

  /* Elevation */
  --shadow-sm: 0 2px 8px rgba(46, 11, 19, .05);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--ivory-100);
  color: var(--ink-600);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* clip (not hidden) so the sticky header keeps working */
  overflow-x: clip;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink-900);
  font-weight: 400;
}

::selection {
  background: var(--gold-200);
  color: var(--wine-900);
}

/* --------------------------------------------------------------------------
   3. Focus
   Baseline gold focus ring. Utilities that declare their own ring outrank this
   (0,2,0 vs 0,1,1), so nothing interactive is ever left without an indicator.
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   4. Scrollbars
   -------------------------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ivory-200); }
::-webkit-scrollbar-thumb { background: var(--ivory-500); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-400); }

.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* --------------------------------------------------------------------------
   5. Scroll reveal
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease-silk), transform .8s var(--ease-silk);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   6. Sticky header
   -------------------------------------------------------------------------- */
#siteHeader {
  transition: background-color var(--dur-base) var(--ease-silk),
              box-shadow var(--dur-base) var(--ease-silk);
}
#siteHeader .header-inner {
  height: 64px;
  transition: height var(--dur-base) var(--ease-silk);
}
#siteHeader.is-stuck {
  background-color: rgba(252, 248, 245, .92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
@media (min-width: 1024px) {
  #siteHeader .header-inner { height: 96px; }
  #siteHeader.is-stuck .header-inner { height: 68px; }
}

/* --------------------------------------------------------------------------
   7. Nav underline
   -------------------------------------------------------------------------- */
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  height: 1.5px;
  width: 0;
  background: var(--gold-500);
  transition: width var(--dur-base) var(--ease-silk);
}
.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current="page"]::after { width: 100%; }

/* --------------------------------------------------------------------------
   8. Mega menu
   -------------------------------------------------------------------------- */
.mega {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .25s var(--ease-silk),
              transform .25s var(--ease-silk),
              visibility .25s;
}
.mega.is-open { opacity: 1; visibility: visible; transform: none; }

/* --------------------------------------------------------------------------
   9. Marquee
   -------------------------------------------------------------------------- */
.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* Left → right scroll (mirrors Tailwind animate-marquee; kept here so it always runs) */
@keyframes mz-marquee-ltr {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}
.marquee-track.animate-marquee {
  animation: mz-marquee-ltr 34s linear infinite;
}

/* --------------------------------------------------------------------------
   10. Scrims
   Hand-tuned stops so ivory text clears AA over the brightest product
   photography, and so the promo photo has no hard seam where it meets wine.
   -------------------------------------------------------------------------- */
.tile-scrim,
.tile-scrim-lg,
.promo-scrim { position: absolute; inset: 0; }

.tile-scrim {
  background-image: linear-gradient(to top,
    rgba(34, 6, 12, .94) 0%, rgba(34, 6, 12, .78) 26%,
    rgba(34, 6, 12, .34) 54%, rgba(34, 6, 12, 0) 82%);
}
.tile-scrim-lg {
  background-image: linear-gradient(to top,
    rgba(34, 6, 12, .92) 0%, rgba(34, 6, 12, .62) 32%,
    rgba(34, 6, 12, .20) 62%, rgba(34, 6, 12, 0) 86%);
}
.promo-scrim {
  background-image: linear-gradient(270deg,
    rgba(51, 14, 22, 0) 0%, rgba(51, 14, 22, .45) 26%, #330E16 46%);
}

/* --------------------------------------------------------------------------
   11. Gold corner brackets (bento tiles)
   -------------------------------------------------------------------------- */
.bracket::before,
.bracket::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  opacity: 0;
  transition: opacity .4s var(--ease-silk), transform .4s var(--ease-silk);
}
.bracket::before {
  top: 14px; left: 14px;
  border-top: 1px solid var(--gold-400);
  border-left: 1px solid var(--gold-400);
  transform: translate(6px, 6px);
}
.bracket::after {
  bottom: 14px; right: 14px;
  border-bottom: 1px solid var(--gold-400);
  border-right: 1px solid var(--gold-400);
  transform: translate(-6px, -6px);
}
.group:hover .bracket::before,
.group:hover .bracket::after,
.group:focus-within .bracket::before,
.group:focus-within .bracket::after { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   12. Drawers & overlays
   -------------------------------------------------------------------------- */
.panel { transition: transform .5s var(--ease-silk); }
.backdrop { transition: opacity .4s var(--ease-silk), visibility .4s; }
.backdrop.is-open { opacity: 1; visibility: visible; }

/* --------------------------------------------------------------------------
   13. Details / summary
   -------------------------------------------------------------------------- */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.footer-col[open] > summary svg { transform: rotate(180deg); }

/* Footer columns are accordions on mobile only */
@media (min-width: 768px) {
  .footer-col > summary { pointer-events: none; cursor: default; }
}

/* --------------------------------------------------------------------------
   14. Back to top
   -------------------------------------------------------------------------- */
[data-to-top].is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   15. Helpers
   -------------------------------------------------------------------------- */
.shimmer { position: relative; overflow: hidden; }
.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(194, 160, 92, .14), transparent);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.vertical-text { writing-mode: vertical-rl; text-orientation: mixed; }

/* Expands a small control's hit area to 44px without changing how it looks */
.tap-44 { position: relative; }
.tap-44::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

/* --------------------------------------------------------------------------
   16. Filter sidebar (PLP)
   -------------------------------------------------------------------------- */
.filter-acc > summary { list-style: none; }
.filter-acc > summary::-webkit-details-marker { display: none; }

/* Plus collapses to a minus when the group is open */
.filter-icon-bar {
  transform-origin: center;
  transition: opacity var(--dur-base) var(--ease-silk),
              transform var(--dur-base) var(--ease-silk);
}
.filter-acc[open] > summary .filter-icon-bar {
  opacity: 0;
  transform: rotate(90deg);
}

.filter-check:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFDFB' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}

/* Two range inputs stacked over one drawn track. The track is inset by half a
   thumb (see .inset-x-2 in the markup) so the fill lines up with the handles. */
.price-thumb {
  pointer-events: none;
  z-index: 2;
  margin: 0;
}
.price-thumb:focus-visible { outline: none; }
.price-thumb:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(194, 160, 92, .45);
}
.price-thumb:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(194, 160, 92, .45);
}
.price-thumb::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--wine-700);
  border: 2px solid var(--ivory-50);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.price-thumb::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--wine-700);
  border: 2px solid var(--ivory-50);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.price-thumb::-webkit-slider-runnable-track { background: transparent; height: 6px; }
.price-thumb::-moz-range-track { background: transparent; height: 6px; }

/* --------------------------------------------------------------------------
   18. Product detail (PDP)
   -------------------------------------------------------------------------- */
.gallery-thumb.is-active {
  box-shadow: 0 0 0 2px var(--wine-700);
}
.gallery-thumb img { transition: opacity var(--dur-base) var(--ease-silk); }
.gallery-thumb:not(.is-active) img { opacity: .72; }
.gallery-thumb:hover img,
.gallery-thumb:focus-visible img { opacity: 1; }

.gallery-stage { cursor: zoom-in; }
.gallery-stage.is-zooming { cursor: crosshair; }
.gallery-stage.is-zooming [data-gallery-main] {
  /* Inline transition:none is set by JS; this backs it up if a utility fights back */
  transition: none !important;
}
/* Keep the zoom lens above the badge while hovering; the zoom button stays clickable */
.gallery-stage.is-zooming .badge { pointer-events: none; }

.swatch {
  display: grid;
  place-items: center;
  height: 44px;
  width: 44px;
  border: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-silk),
              box-shadow var(--dur-base) var(--ease-silk);
}
.swatch:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(194, 160, 92, .4);
}
.swatch.is-active {
  border-color: var(--wine-700);
  box-shadow: 0 0 0 1px var(--wine-700);
}
.swatch-disc {
  display: block;
  height: 28px;
  width: 28px;
  border-radius: 9999px;
  border: 1px solid rgba(46, 11, 19, .12);
}

.lightbox-dot {
  height: 8px;
  width: 8px;
  border-radius: 9999px;
  background: rgba(255, 253, 251, .35);
  transition: background-color var(--dur-fast) var(--ease-std),
              transform var(--dur-fast) var(--ease-std);
}
.lightbox-dot.is-active {
  background: var(--gold-500);
  transform: scale(1.25);
}
.lightbox-dot:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 3px;
}

#sizeGuide {
  transition: opacity .4s var(--ease-silk), visibility .4s;
}
#sizeGuide > div {
  transform: translateY(12px);
  transition: transform .45s var(--ease-silk);
}
#sizeGuide.opacity-100 > div { transform: none; }
@media (min-width: 640px) {
  #sizeGuide > div { transform: translateY(8px) scale(.98); }
  #sizeGuide.opacity-100 > div { transform: none; }
}

#lightbox {
  transition: opacity .35s var(--ease-silk), visibility .35s;
}

/* --------------------------------------------------------------------------
   17. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  /* Keep the assurance marquee moving; hover still pauses it */
  .marquee-track.animate-marquee {
    animation: mz-marquee-ltr 34s linear infinite !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
