/* ==========================================================================
   Global base styles, typography, layout primitives, header & footer
   ========================================================================== */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
}

body.no-scroll { overflow: hidden; height: 100%; }

/* Film-grain + vignette atmosphere layer for the whole site */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(201, 167, 104, 0.06), transparent 60%),
    radial-gradient(ellipse 80% 60% at 100% 100%, rgba(39, 51, 82, 0.4), transparent 60%);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  line-height: 1.05;
  font-weight: 500;
}

h5, h6 { font-family: var(--font-body); font-weight: 600; }

p { color: var(--text-muted); }

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 600;
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.lede {
  font-size: var(--fs-body-lg);
  color: var(--text-muted);
  max-width: 46ch;
  line-height: 1.7;
}

.text-ivory { color: var(--text); }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--accent); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--ivory);
  color: var(--navy-950);
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: var(--radius-sm);
  transition: top var(--dur-fast) var(--ease-out-soft);
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

/* ---- Buttons ---- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 2.2rem;
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: color var(--dur-fast) var(--ease-out-soft), border-color var(--dur-fast) var(--ease-out-soft), transform var(--dur-fast) var(--ease-out-soft);
}
.btn span { position: relative; z-index: 2; }

.btn-primary {
  background: var(--accent);
  color: var(--navy-950);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold-200);
  transform: translateY(101%);
  transition: transform var(--dur-med) var(--ease-luxe);
  z-index: 1;
}
.btn-primary:hover::before { transform: translateY(0); }
.btn-primary:active { transform: scale(0.97); }

.btn-outline {
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-outline::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--text);
  transform: translateY(101%);
  transition: transform var(--dur-med) var(--ease-luxe);
  z-index: 1;
}
.btn-outline:hover { color: var(--navy-950); border-color: var(--text); }
.btn-outline:hover::before { transform: translateY(0); }

.btn-ghost {
  color: var(--text);
  padding: 0.5rem 0;
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 500;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-soft); }

.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---- Header ---- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: height var(--dur-med) var(--ease-out-soft), background-color var(--dur-med) var(--ease-out-soft), border-color var(--dur-med) var(--ease-out-soft);
  border-bottom: 1px solid transparent;
}

.site-header .container {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-md);
}

.site-header.is-scrolled {
  height: var(--header-h-scrolled);
  background: rgba(8, 11, 22, 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-brand svg { width: 38px; height: 38px; transition: transform var(--dur-med) var(--ease-out-soft); }
.header-brand:hover svg { transform: rotate(-4deg) scale(1.04); }

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand-wordmark small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.56rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-top: 0.3em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.4vw, 2.75rem);
  justify-self: center;
}

.main-nav a {
  position: relative;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text);
  padding: 0.4rem 0;
}
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
  transition: right var(--dur-med) var(--ease-luxe);
}
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { right: 0; }
.main-nav a[aria-current="page"] { color: var(--accent-soft); }

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.1rem;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  color: var(--text);
  border-radius: 50%;
  transition: background var(--dur-fast) var(--ease-out-soft), color var(--dur-fast);
}
.icon-btn:hover { background: rgba(247, 243, 234, 0.08); color: var(--accent-soft); }
.icon-btn svg { width: 19px; height: 19px; }

.cart-count {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--navy-950);
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  transform: scale(0);
  transition: transform var(--dur-fast) var(--ease-luxe);
}
.cart-count.is-visible { transform: scale(1); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 9px; right: 9px;
  height: 1px;
  background: var(--text);
  transition: transform var(--dur-fast) var(--ease-out-soft), opacity var(--dur-fast);
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 25px; }
.nav-toggle.is-active span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---- Mobile drawer ---- */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  background: var(--navy-950);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + 1rem) var(--container-pad) var(--space-lg);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.mobile-drawer.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.mobile-drawer-nav a {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 10vw, 3rem);
  padding: 0.3em 0;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(24px);
}
.mobile-drawer.is-open .mobile-drawer-nav a { animation: drawerLinkIn 0.7s var(--ease-luxe) forwards; }
.mobile-drawer-nav a:nth-child(1) { animation-delay: 0.08s; }
.mobile-drawer-nav a:nth-child(2) { animation-delay: 0.14s; }
.mobile-drawer-nav a:nth-child(3) { animation-delay: 0.2s; }
.mobile-drawer-nav a:nth-child(4) { animation-delay: 0.26s; }
.mobile-drawer-nav a:nth-child(5) { animation-delay: 0.32s; }

@keyframes drawerLinkIn {
  to { opacity: 1; transform: translateY(0); }
}

.mobile-drawer-foot {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: var(--fs-small);
}
.mobile-drawer-foot a { color: var(--accent-soft); }

/* ---- Search overlay ---- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(5, 7, 13, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: min(18vh, 180px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-out-soft), visibility var(--dur-med);
}
.search-overlay.is-open { visibility: visible; opacity: 1; pointer-events: auto; }

.search-panel { width: min(680px, 90vw); }

.search-field {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1rem;
}
.search-field svg { width: 22px; height: 22px; color: var(--accent-soft); flex-shrink: 0; }
.search-field input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  outline: none;
}
.search-field input::placeholder { color: var(--fog-dim); }
.search-close { color: var(--text-muted); font-size: var(--fs-small); letter-spacing: 0.1em; text-transform: uppercase; }

.search-results { margin-top: 1.75rem; display: flex; flex-direction: column; gap: 0.25rem; max-height: 50vh; overflow-y: auto; }
.search-result {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  transition: background var(--dur-fast);
}
.search-result:hover, .search-result:focus-visible { background: rgba(247,243,234,0.06); }
.search-result img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-sm); }
.search-result-name { font-weight: 600; font-size: 0.95rem; }
.search-result-cat { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-soft); }
.search-result-price { margin-left: auto; color: var(--text-muted); font-size: var(--fs-small); }
.search-empty { color: var(--fog-dim); padding: 1rem 0.75rem; font-size: var(--fs-small); }

/* ---- Footer ---- */
.site-footer {
  position: relative;
  background: var(--navy-950);
  border-top: 1px solid var(--line);
  padding-top: var(--space-2xl);
  overflow: hidden;
}

.footer-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  width: 70vw;
  height: 50vw;
  max-height: 600px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(201,167,104,0.1), transparent 70%);
  pointer-events: none;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--space-md);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--line);
  position: relative;
}

.footer-brand p { margin-top: 1rem; max-width: 36ch; }
.footer-brand .header-brand { margin-bottom: 0.5rem; }

.footer-social { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.footer-social a {
  width: 38px; height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.footer-social a:hover { border-color: var(--accent); color: var(--accent-soft); transform: translateY(-3px); }
.footer-social svg { width: 16px; height: 16px; }

.footer-col h6 {
  font-size: var(--fs-micro);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 1.4rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.85rem; }
.footer-col a { color: var(--text-muted); font-size: 0.92rem; transition: color var(--dur-fast); }
.footer-col a:hover { color: var(--text); }

.footer-wordmark {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 15vw, 13rem);
  line-height: 0.8;
  letter-spacing: -0.02em;
  text-align: center;
  padding: var(--space-xl) 0 var(--space-md);
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  user-select: none;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--line);
  font-size: var(--fs-small);
  color: var(--fog-dim);
}
.footer-bottom-links { display: flex; gap: 1.5rem; }
.footer-bottom-links a:hover { color: var(--accent-soft); }

/* ---- Page intro header (used by inner pages) ---- */
.page-intro {
  padding: calc(var(--header-h) + var(--space-xl)) 0 var(--space-xl);
  position: relative;
}
.page-intro h1 {
  font-size: var(--fs-display-lg);
  margin-top: 0.75rem;
  max-width: 16ch;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-small);
  color: var(--fog-dim);
}
.breadcrumb a:hover { color: var(--accent-soft); }
.breadcrumb span[aria-hidden] { opacity: 0.5; }

/* ---- Page transition curtain ---- */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--navy-950);
  transform: translateY(100%);
  transition: transform 0.65s var(--ease-luxe);
  pointer-events: none;
}
.page-transition.is-covering,
.page-transition.is-active { transform: translateY(0); pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  .page-transition { transition: none; display: none; }
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translate(-50%, 140%);
  z-index: var(--z-toast);
  background: var(--ivory);
  color: var(--navy-950);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lift);
  transition: transform var(--dur-med) var(--ease-luxe);
}
.toast.is-visible { transform: translate(-50%, 0); }
.toast svg { width: 18px; height: 18px; color: var(--success); }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
