/* ============================================================
   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;
  --mute: #7a6e60;
  --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;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  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 {
  height: 42px; width: auto;
  display: block;
  /* On scroll-state nav (white bg), the gold monogram pops naturally;
     no filter needed since the mark itself is gold-on-transparent. */
  transition: opacity 0.3s, transform 0.4s cubic-bezier(.7,0,.2,1);
}
.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: 100px; 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;
  background: var(--cream); aspect-ratio: 3 / 4;
  margin-bottom: 18px;
}
.product-card .img-wrap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(26,22,18,0.06));
  pointer-events: none;
}
.product-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s cubic-bezier(.2,.8,.2,1);
}
.product-card:hover img { transform: scale(1.04); }
.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; }
}
@media (max-width: 640px) {
  nav.top { padding: 14px 16px; }
  .nav-left ul, .nav-right ul { gap: 14px; }
  .nav-left a, .nav-right a { font-size: 10px; }
  .logo { font-size: 18px; }
  .logo .logo-mark { height: 32px; }
  .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;
}
