/* ============================================================
   Chay Couture — global stylesheet.
   Sets type, color, layout primitives, nav, footer, buttons,
   form fields, and product card styles used across every page.
   ============================================================ */

:root {
  --ink: #1a1612;
  --paper: #f6f1ea;
  --cream: #ede4d5;
  --gold: #b08a47;
  --gold-deep: #8a6a2f;
  --emerald: #0e5640;
  --ruby: #8a1027;
  --sapphire: #14225a;
  --rose: #c89cb4;
  /* Was #7a6e60 (5.2:1 on cream — readable but felt anemic for body copy).
     Darkened toward ink so secondary text reads confidently. */
  --mute: #5d544a;
  --line: #d8cdb9;
  --error: #8a1027;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  /* Bumped 300 → 420 (Inter is variable). The old 300 read as washed-out
     on macOS subpixel-AA, especially against the cream background. 420
     gives it body without looking heavy. */
  font-weight: 420;
  font-size: 15.5px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* paper grain overlay */
body::before {
  content: ""; position: fixed; inset: 0;
  pointer-events: none; z-index: 1; opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

main { flex: 1; position: relative; z-index: 2; }

img { max-width: 100%; display: block; }
a { color: inherit; }

/* TYPE */
.display, h1, h2, h3, h4 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
}
.italiana { font-family: 'Italiana', serif; font-weight: 400; }
em, .italic { font-style: italic; color: var(--gold-deep); }

.eyebrow {
  font-family: 'Inter', sans-serif;
  font-weight: 500; font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold-deep);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 28px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: transform 0.4s, background 0.3s;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.full { width: 100%; }
.btn.gold { background: var(--gold); color: var(--paper); }
.btn.gold:hover { background: var(--gold-deep); }

/* INPUTS */
.field {
  display: block;
  position: relative;
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 8px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  border-radius: 0;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-bottom-color: var(--gold);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.field-error {
  color: var(--error);
  font-size: 12px;
  margin-top: 6px;
}

/* ============================================================
   NAV
   ============================================================ */
nav.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 20px 36px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(246,241,234,0.78);
  border-bottom: 1px solid rgba(176,138,71,0.15);
  transition: padding 0.4s ease;
}
nav.top.scrolled { padding: 12px 36px; }
.nav-left ul, .nav-right ul {
  display: flex; gap: 28px; list-style: none;
}
.nav-right ul { justify-content: flex-end; }
.nav-left a, .nav-right a {
  color: var(--ink); text-decoration: none;
  font-size: 12px; font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase;
  position: relative; padding: 4px 0;
}
.nav-left a::after, .nav-right a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s cubic-bezier(.7,0,.2,1);
}
.nav-left a:hover::after, .nav-right a:hover::after { transform: scaleX(1); }
.nav-right a.cart-link {
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-tryon {
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-tryon .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.4); }
}
.nav-trade {
  font-family: 'Inter', sans-serif;
  font-size: 10px !important;
  letter-spacing: 0.28em !important;
  text-transform: uppercase;
  color: var(--gold-deep) !important;
  padding: 4px 10px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  transition: background 0.3s ease, color 0.3s ease;
}
.nav-trade:hover {
  background: var(--gold-deep);
  color: var(--paper) !important;
}
.nav-trade::after { display: none !important; }
.cart-count {
  background: var(--gold); color: var(--paper);
  border-radius: 999px;
  font-size: 10px;
  min-width: 18px;
  padding: 1px 6px;
  text-align: center;
  font-weight: 500;
}

.logo {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; line-height: 1;
  /* Fallback text styling in case the image fails to load */
  font-family: 'Italiana', serif;
  font-size: 26px;
  letter-spacing: 0.32em;
  color: var(--ink);
}
.logo .logo-mark {
  /* High-res wordmark crop (900×380). One subtle sub-pixel gold feather
     gives the strokes a hint of weight without the dark/halo effect
     the 4-direction dilation produced. Stays readable on cream paper. */
  height: 72px; width: auto;
  display: block;
  filter: drop-shadow(0 0 0.5px rgba(176, 138, 71, 0.85));
  transition: opacity 0.3s ease;
}
/* Scrolled state — nav shrinks; keep logo proportional. */
nav.top.scrolled .logo .logo-mark { height: 56px; }
.logo:hover .logo-mark { opacity: 0.85; }
.logo .amp {
  color: var(--gold);
  font-family: 'Fraunces', serif;
  font-style: italic; font-size: 0.85em;
}

/* Page top spacer below fixed nav */
.page { padding-top: 110px; padding-left: 36px; padding-right: 36px; padding-bottom: 80px; max-width: 1440px; margin: 0 auto; }

/* Breadcrumbs */
.crumbs {
  display: flex; gap: 8px; align-items: center;
  margin: 24px 0 40px;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mute);
}
.crumbs a { color: var(--mute); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs span.sep { color: var(--line); }

/* ============================================================
   PRODUCT CARD
   ============================================================ */
.product-card {
  position: relative; cursor: pointer;
  text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column;
}
.product-card .img-wrap {
  position: relative; overflow: hidden;
  /* Layered studio backdrop:
     1. Tight white spotlight at the upper-center where the earring sits
     2. A second wider gold-tinted halo behind it (radial blush)
     3. Cream→ivory base gradient — bottom is darker to suggest a tabletop
     The combo reads like a photo studio sweep, not a flat tile. */
  background:
    radial-gradient(ellipse 60% 50% at 50% 38%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 65%),
    radial-gradient(ellipse 80% 65% at 50% 42%, rgba(176,138,71,0.10) 0%, rgba(176,138,71,0) 70%),
    linear-gradient(180deg, #f7f1e9 0%, #ece2d2 70%, #d9ccb7 100%);
  aspect-ratio: 3 / 4;
  margin-bottom: 18px;
  border-radius: 3px;
  /* Outer card shadow — soft, like the card itself is resting on paper. */
  box-shadow:
    0 1px 2px rgba(26,22,18,0.04),
    0 18px 32px -16px rgba(26,22,18,0.18);
  transition: box-shadow 0.5s cubic-bezier(.2,.8,.2,1), transform 0.5s cubic-bezier(.2,.8,.2,1);
}
.product-card:hover .img-wrap {
  box-shadow:
    0 1px 2px rgba(26,22,18,0.06),
    0 30px 50px -18px rgba(26,22,18,0.28);
  transform: translateY(-3px);
}
/* Vignette + subtle floor reflection. */
.product-card .img-wrap::after {
  content: ""; position: absolute; inset: 0;
  background:
    /* dark vignette in the corners */
    radial-gradient(ellipse 90% 70% at 50% 50%, transparent 60%, rgba(26,22,18,0.10) 100%),
    /* floor reflection at the very bottom */
    linear-gradient(to bottom, transparent 85%, rgba(26,22,18,0.08));
  pointer-events: none;
}
.product-card img {
  width: 100%; height: 100%;
  /* `contain` keeps the full earring visible; the inner padding gives
     the jewelry breathing room from the card edge. */
  object-fit: contain; object-position: center 45%;
  padding: 12% 14%;
  transition: transform 0.9s cubic-bezier(.2,.8,.2,1), filter 0.6s ease;
  /* Two-layer drop shadow — close-contact + ambient. Makes the earring
     feel like it casts real light onto the cream backdrop instead of
     floating on a flat surface. */
  filter:
    drop-shadow(0 4px 6px rgba(26,22,18,0.14))
    drop-shadow(0 18px 24px rgba(26,22,18,0.14));
}
.product-card:hover img {
  transform: scale(1.07);
  filter:
    drop-shadow(0 6px 10px rgba(26,22,18,0.20))
    drop-shadow(0 24px 36px rgba(26,22,18,0.18));
}
.product-card .tag {
  position: absolute; top: 14px; left: 14px;
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  background: var(--paper); color: var(--ink);
  padding: 6px 10px; z-index: 2; font-weight: 500;
}
.product-card .tag.gold { background: var(--gold); color: var(--paper); }
.product-card .tag.limited { background: var(--ruby); color: var(--paper); }
.product-card .quick {
  position: absolute; bottom: 16px; left: 50%;
  transform: translate(-50%, 8px); opacity: 0;
  transition: all 0.4s cubic-bezier(.2,.8,.2,1);
  background: var(--ink); color: var(--paper);
  padding: 10px 20px; font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase;
  border-radius: 999px; z-index: 2; white-space: nowrap;
}
.product-card:hover .quick { opacity: 1; transform: translate(-50%, 0); }
.product-card .info {
  display: grid; grid-template-columns: 1fr auto;
  align-items: start; gap: 12px; row-gap: 4px;
}
.product-card .name {
  font-family: 'Fraunces', serif; font-size: 18px;
  font-weight: 400; letter-spacing: -0.005em; line-height: 1.25;
}
.product-card .name em { font-style: italic; color: var(--gold-deep); }
.product-card .price {
  font-family: 'Fraunces', serif; font-size: 18px;
  font-weight: 400; white-space: nowrap;
}
.product-card .meta {
  grid-column: 1 / -1;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mute);
}

/* PRODUCT GRID */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 24px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer.site-foot {
  margin-top: auto;
  background: var(--ink);
  color: var(--paper);
  padding: 100px 36px 40px;
  position: relative; z-index: 2;
}
.foot-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 60px; padding-bottom: 80px;
  border-bottom: 1px solid rgba(246,241,234,0.15);
  max-width: 1440px; margin: 0 auto;
}
.foot-top .brand {
  font-family: 'Italiana', serif;
  font-size: 56px; letter-spacing: 0.18em; line-height: 1;
}
.foot-top .brand .foot-logo {
  display: block;
  width: 240px; height: auto;
  margin-left: -20px; /* The logo has internal padding; nudge it left for true alignment */
}
.foot-top .brand .amp { color: var(--gold); font-family: 'Fraunces', serif; font-style: italic; font-size: 0.8em; }
.foot-top p { color: rgba(246,241,234,0.6); font-size: 14px; margin-top: 20px; max-width: 320px; }

.foot-col h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 500; font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  margin-bottom: 22px; color: var(--gold);
}
.foot-col ul { list-style: none; display: grid; gap: 10px; }
.foot-col a {
  color: rgba(246,241,234,0.78);
  text-decoration: none; font-size: 14px;
  transition: color 0.3s;
}
.foot-col a:hover { color: var(--paper); }

.foot-newsletter p { margin-top: 0; margin-bottom: 14px; font-size: 13px; }
.foot-newsletter form {
  display: flex;
  border-bottom: 1px solid rgba(246,241,234,0.3);
  padding-bottom: 8px; margin-top: 10px;
}
.foot-newsletter input {
  flex: 1; background: transparent; border: none;
  color: var(--paper); font-family: 'Inter', sans-serif;
  font-size: 14px; padding: 8px 0; outline: none;
}
.foot-newsletter input::placeholder { color: rgba(246,241,234,0.4); }
.foot-newsletter button {
  background: transparent; border: none;
  color: var(--gold); cursor: pointer; font-size: 18px;
}

.foot-bottom {
  padding-top: 40px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(246,241,234,0.45);
  max-width: 1440px; margin: 0 auto;
}
.foot-bottom .stones-line {
  font-family: 'Fraunces', serif; font-style: italic;
  text-transform: none; letter-spacing: 0;
  color: rgba(246,241,234,0.55); font-size: 13px;
}
.foot-legal {
  display: flex; gap: 24px; justify-content: center;
  padding-top: 24px; margin-top: 24px;
  border-top: 1px solid rgba(246,241,234,0.08);
  max-width: 1440px; margin-left: auto; margin-right: auto;
}
.foot-legal a {
  color: rgba(246,241,234,0.45);
  font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}
.foot-legal a:hover { color: var(--gold); }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-stack {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200; pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--paper);
  padding: 14px 22px; border-radius: 999px;
  font-size: 13px; letter-spacing: 0.04em;
  box-shadow: 0 18px 40px rgba(26,22,18,0.25);
  opacity: 0; transform: translateY(20px);
  animation: toastIn 0.4s cubic-bezier(.2,.8,.2,1) forwards;
  pointer-events: auto;
}
.toast.error { background: var(--ruby); }
@keyframes toastIn {
  to { opacity: 1; transform: translateY(0); }
}
.toast.out { animation: toastOut 0.3s forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateY(20px); }
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 1.1s cubic-bezier(.2,.8,.2,1),
              transform 1.1s cubic-bezier(.2,.8,.2,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  nav.top { padding: 16px 20px; }
  .page { padding-left: 20px; padding-right: 20px; }
  .nav-left ul li:nth-child(n+3) { display: none; }
}
/* ============================================================
   MOBILE NAV — hamburger drawer
   Hidden above 640px. Below, the side text links collapse into a
   drawer behind a hamburger; the logo stays in the center.
   ============================================================ */
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  background: transparent; border: 0;
  padding: 8px; cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-burger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}
html.drawer-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
html.drawer-open .nav-burger span:nth-child(2) { opacity: 0; }
html.drawer-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-drawer {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(246, 241, 234, 0.98);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(176,138,71,0.20);
  padding: 96px 24px 28px;
  display: none;
  flex-direction: column;
  z-index: 95;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.22s ease;
}
.mobile-drawer-link {
  display: block;
  padding: 18px 0;
  font-family: 'Italiana', serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(176,138,71,0.15);
}
.mobile-drawer-link:last-child { border-bottom: 0; }
html.drawer-open .mobile-drawer {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
html.drawer-open body { overflow: hidden; }

@media (max-width: 640px) {
  /* Hide both side text-link rails; show the burger on the left
     and keep the logo + bag on the right of it. The grid collapses
     to: [burger] [logo] [right icons]. */
  .nav-left, .nav-right ul li:not(.cart-li) { display: none; }
  .nav-burger { display: inline-flex; }
  .mobile-drawer { display: flex; }

  nav.top {
    padding: 10px 16px;
    grid-template-columns: 40px 1fr auto;
    gap: 8px;
  }
  nav.top.scrolled { padding: 8px 16px; }

  /* Center the logo perfectly within its (1fr) column. */
  .logo { width: 100%; justify-content: center; }
  /* Mobile: same subtle gold feather as desktop, smaller size. */
  .logo .logo-mark {
    height: 56px;
    filter: drop-shadow(0 0 0.5px rgba(176, 138, 71, 0.85));
  }
  nav.top.scrolled .logo .logo-mark { height: 48px; }

  /* The cart link still shows on the right (we keep the .cart-li
     above; without that, the JS-injected Trade chip also stays). */
  .nav-right ul { gap: 14px; }
  .nav-right a { font-size: 11px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 14px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  footer.site-foot { padding: 60px 20px 30px; }
  .foot-top { grid-template-columns: 1fr; gap: 40px; padding-bottom: 50px; }
  .foot-top .brand { font-size: 38px; }
  .foot-top .brand .foot-logo { width: 180px; margin-left: -14px; }
  .foot-bottom { flex-direction: column; gap: 14px; text-align: center; }
}

/* ============================================================
   Native (Capacitor) wrapper adjustments.
   These styles only apply when running inside the iOS or Android
   app — partials.js adds .platform-native to <html> at boot.
   ============================================================ */
.platform-native {
  /* Block overscroll bounce on iOS so the app feels chrome-less. */
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}
.platform-ios body {
  /* Respect the iPhone notch / Dynamic Island. */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.platform-ios nav.top {
  /* Push the nav under the notch on iOS. */
  padding-top: calc(20px + env(safe-area-inset-top));
}
.platform-ios footer.site-foot {
  padding-bottom: calc(30px + env(safe-area-inset-bottom));
}
.platform-native a, .platform-native button {
  /* Kill the iOS tap-highlight blue overlay. */
  -webkit-tap-highlight-color: transparent;
}
.platform-native img {
  /* Prevent the iOS context menu on long-press of product images. */
  -webkit-touch-callout: none;
  user-select: none;
}

/* ============================================================
   ADMIN MODAL + IMAGE UPLOAD
   Originally lived inside admin.html's <style>; lifted out so the
   inline-edit pencil on the public pages (admin-inline.js) can
   reuse the same UI without duplicating styles.
   ============================================================ */
.img-upload-zone {
  position: relative;
  border: 1.5px dashed rgba(31, 20, 25, 0.25);
  border-radius: 6px;
  padding: 16px;
  background: var(--cream);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 18px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.img-upload-zone:hover,
.img-upload-zone.dragover {
  border-color: var(--gold-deep, #8E7144);
  background: #FFFFFF;
}
.img-upload-zone .preview {
  max-width: 220px;
  max-height: 220px;
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: none;
}
.img-upload-zone .preview.has-image { display: block; }
.img-upload-zone .hint {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--ink-soft, #4A3B40);
  font-size: 14px;
}
.img-upload-zone .replace {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep, #8E7144);
  text-decoration: underline;
  display: none;
}
.img-upload-zone .preview.has-image ~ .replace { display: inline; }
.img-upload-zone .preview.has-image ~ .hint { display: none; }
.img-upload-zone.uploading {
  pointer-events: none;
  opacity: 0.7;
}
.img-upload-zone.uploading::after {
  content: 'Uploading…';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.7);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink, #1F1419);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 20, 25, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 60px 16px;
}
.modal-overlay.open { display: flex; }
.modal-content {
  background: #FFFFFF;
  max-width: 640px;
  width: 100%;
  padding: 32px 36px 28px;
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  position: relative;
}
.modal-content h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 28px;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--ink-faint, #8B7B7F);
  cursor: pointer;
}
.modal-close:hover { color: var(--ink, #1F1419); }
.modal-content .field { margin-bottom: 14px; }
.modal-content .field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft, #4A3B40);
  margin-bottom: 6px;
}
.modal-content .field input,
.modal-content .field select,
.modal-content .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(31, 20, 25, 0.18);
  border-radius: 4px;
  background: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--ink, #1F1419);
}
.modal-content .field textarea { resize: vertical; min-height: 80px; }
.modal-content .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}
.modal-content .actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  justify-content: flex-end;
}
.modal-content .btn {
  padding: 12px 22px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 0;
  border-radius: 4px;
  background: var(--ink, #1F1419);
  color: var(--cream, #f6f1ea);
  cursor: pointer;
}
.modal-content .btn.ghost {
  background: transparent;
  color: var(--ink, #1F1419);
  border: 1px solid rgba(31, 20, 25, 0.25);
}
@media (max-width: 600px) {
  .modal-content { padding: 24px 20px; }
  .modal-content .field-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ============================================================
   FAVORITES — heart button + nav count
   ============================================================ */
.fav-btn {
  background: rgba(255,255,255,0.85);
  border: none; padding: 8px; border-radius: 50%;
  cursor: pointer; color: #1a1612;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.2s, background 0.2s, color 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}
.fav-btn:hover { background: #fff; transform: scale(1.08); }
.fav-btn.is-fav { color: var(--ruby, #8b2d2d); }
.fav-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Card hearts sit top-right inside the image wrap. */
.product-card .fav-btn {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 38px; height: 38px;
}

/* PDP heart sits inline next to "Add to Bag" — larger tap target. */
.pdp .fav-btn {
  width: 52px; height: 52px;
  background: transparent; border: 1px solid var(--line);
  box-shadow: none; border-radius: 4px;
}
.pdp .fav-btn:hover { border-color: var(--ink); background: rgba(255,255,255,0.4); }
.pdp .fav-btn.is-fav { border-color: var(--ruby, #8b2d2d); }

/* Nav favorites count chip. */
.nav-right .favorites-count {
  font-size: 10px; background: var(--gold);
  color: var(--paper); border-radius: 999px;
  padding: 1px 6px; margin-left: 2px;
  font-family: 'Inter', sans-serif; letter-spacing: 0.06em;
}
