/* ============================================================
   ONDREA — components.css
   Reusable UI: buttons, header, footer, product cards,
   forms, modals, newsletter, loader, page transitions.
   ============================================================ */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--sans);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 400;
  padding: 1.05rem 2.2rem;
  border: 1px solid var(--charcoal);
  color: var(--charcoal);
  background: transparent;
  cursor: pointer;
  transition: background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.btn:hover { background: var(--charcoal); color: var(--cream); }

.btn--solid { background: var(--charcoal); color: var(--cream); }
.btn--solid:hover { background: var(--forest); border-color: var(--forest); color: var(--cream); }

.btn--forest { background: var(--forest); border-color: var(--forest); color: var(--cream); }
.btn--forest:hover { background: transparent; color: var(--forest); }

.btn--ghost { border-color: var(--stone-line); color: var(--charcoal-70); }
.btn--ghost:hover { background: transparent; border-color: var(--charcoal); color: var(--charcoal); }

.btn--block { width: 100%; }
.btn--sm { padding: 0.8rem 1.5rem; }

.link-underline {
  position: relative;
  display: inline-block;
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding-bottom: 3px;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.link-underline:hover::after { transform: scaleX(0); transform-origin: right; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--stone-line);
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header {
  transition: transform var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.header-inner {
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-3);
}
.header-nav { display: flex; gap: var(--sp-4); align-items: center; }
.header-nav--right { justify-self: end; }
.header-nav a.nav-link {
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--charcoal-70);
  transition: color var(--dur-fast) var(--ease);
  position: relative;
  padding-block: 0.4rem;
}
.header-nav a.nav-link:hover,
.header-nav a.nav-link[aria-current="page"] { color: var(--charcoal); }
.header-nav a.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--charcoal);
}

.header-brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
}
.header-brand img {
  height: 20px;
  width: auto;
  /* The wordmark is a very wide glyph run (10:1). It sits in a 1fr grid column,
     and an unconstrained img will not shrink below its intrinsic width — so cap
     it, or on a narrow phone it pushes the whole header past the viewport. */
  max-width: 100%;
}

.header-actions {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  justify-self: end;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  color: var(--charcoal);
  position: relative;
  transition: opacity var(--dur-fast) var(--ease);
}
.icon-btn:hover { opacity: 0.6; }
.icon-btn svg { width: 20px; height: 20px; stroke-width: 1.25; }

.cart-count {
  position: absolute;
  top: 2px; right: 0px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--forest);
  color: var(--cream);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0;
  display: grid; place-items: center;
  line-height: 1;
}
.cart-count:empty,
.cart-count[data-count="0"] { display: none; }

.burger { display: none; }

/* Mobile nav drawer */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: var(--cream);
  z-index: 150;
  transform: translateY(-100%);
  transition: transform var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
  padding: var(--gutter);
  visibility: hidden;
}
.mobile-nav.is-open { transform: translateY(0); visibility: visible; }
.mobile-nav__top { display: flex; justify-content: space-between; align-items: center; height: var(--header-h); }
.mobile-nav__links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}
.mobile-nav__links a {
  font-family: var(--serif);
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 300;
  color: var(--charcoal);
}
.mobile-nav__meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  color: var(--charcoal-55);
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
}

@media (max-width: 900px) {
  .header-inner { grid-template-columns: auto 1fr auto; }
  .header-nav--left { display: none; }
  .header-brand { justify-self: start; }
  .burger {
    display: inline-grid;
    place-items: center;
    width: 40px; height: 40px;
  }
  .burger span {
    display: block; width: 22px; height: 1px; background: var(--charcoal);
    position: relative;
  }
  .burger span::before, .burger span::after {
    content: ""; position: absolute; left: 0; width: 22px; height: 1px; background: var(--charcoal);
  }
  .burger span::before { top: -6px; }
  .burger span::after { top: 6px; }
}

/* On a narrow phone the burger, a 20px-tall wordmark and three 40px icons add up
   to more than the viewport. Left unchecked the header widens the document, and
   every centred section below it drifts right — so tighten the row here. */
@media (max-width: 540px) {
  .header-inner { gap: var(--sp-1); }
  .header-brand img { height: 15px; }
  .header-actions { gap: 0; }
  .icon-btn { width: 34px; height: 34px; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--charcoal);
  color: var(--cream);
  padding-block: var(--sp-7) var(--sp-4);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: var(--sp-5);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid rgba(239, 230, 211, 0.16);
}
.footer-brand__tagline {
  font-family: var(--serif);
  font-size: var(--fs-h3);
  font-weight: 300;
  color: var(--cream);
  margin-top: var(--sp-3);
  max-width: 22ch;
}
.footer-brand img { height: 22px; width: auto; opacity: 0.95; }
.footer-col h4 {
  font-family: var(--sans);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--cream-70);
  margin-bottom: var(--sp-3);
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.85rem; }
.footer-col a {
  color: var(--cream);
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
  opacity: 0.82;
  transition: opacity var(--dur-fast) var(--ease);
}
.footer-col a:hover { opacity: 1; }

.footer-news p { color: var(--cream-70); font-size: var(--fs-small); margin-bottom: var(--sp-3); max-width: 32ch; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  padding-top: var(--sp-4);
  flex-wrap: wrap;
}
.footer-bottom p { color: var(--cream-70); font-size: 0.78rem; letter-spacing: 0.06em; }
.footer-social { display: flex; gap: var(--sp-3); }
.footer-social a { color: var(--cream); opacity: 0.82; }
.footer-social a:hover { opacity: 1; }
.footer-social svg { width: 18px; height: 18px; }

@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: var(--sp-5) var(--sp-4); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-news { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---- Newsletter (inline field) ---- */
.news-form { display: flex; border-bottom: 1px solid rgba(239,230,211,0.4); }
.news-form input {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 0.75rem 0;
  color: var(--cream);
  letter-spacing: 0.04em;
  font-size: var(--fs-small);
}
.news-form input::placeholder { color: rgba(239,230,211,0.5); }
.news-form input:focus { outline: none; }
.news-form button {
  background: transparent;
  color: var(--cream);
  padding: 0 0.25rem;
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.news-form button:hover { opacity: 0.65; }
.form-note { font-size: 0.72rem; margin-top: 0.6rem; letter-spacing: 0.04em; }
.form-note--ok { color: var(--stone); }

/* ============================================================
   Product card
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5) var(--sp-4);
}
.product-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-4) var(--sp-3); } }
@media (max-width: 520px) { .product-grid { grid-template-columns: 1fr; } }

.product-card { position: relative; }
.product-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--cream-2);
}
.product-card__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.product-card__media img.is-hover {
  opacity: 0;
}
.product-card:hover .product-card__media img.is-primary { opacity: 0; }
.product-card:hover .product-card__media img.is-hover { opacity: 1; }

.wish-btn {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  color: var(--charcoal);
  background: transparent;
}
.wish-btn svg { width: 20px; height: 20px; stroke-width: 1.25; transition: transform var(--dur-fast) var(--ease); }
.wish-btn:hover svg { transform: scale(1.08); }
.wish-btn[aria-pressed="true"] svg { fill: var(--rust); stroke: var(--rust); }

.product-card__body { padding-top: var(--sp-2); display: flex; flex-direction: column; gap: 0.35rem; }
.product-card__name { font-family: var(--serif); font-size: var(--fs-h3); font-weight: 300; line-height: 1.2; }
.product-card__meta { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); }
.product-card__price { font-size: var(--fs-small); letter-spacing: 0.04em; color: var(--charcoal-70); }
.product-card__swatches { display: flex; gap: 6px; margin-top: 0.35rem; }
.swatch {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1px solid var(--stone-line);
}

/* ============================================================
   Monogram — the O/A mark
   Brief §2: secondary mark, larger visual moments only. The min-width is a
   hard floor: below ~40px the interlock stops reading and use is off-brief.
   ============================================================ */
.monogram {
  display: block;
  width: clamp(60px, 7vw, 104px);
  min-width: 44px;
  height: auto;
  margin-inline: auto;
}
/* Pressed into the cloth, not pasted on top of it — hence the low opacity.
   Still 52px at its smallest, well clear of the brief's ~40px legibility floor. */
.monogram--band {
  width: clamp(56px, 5.6vw, 80px);
  margin-bottom: var(--sp-3);
  opacity: 0.8;
}
.monogram--seal { width: clamp(48px, 5vw, 76px); opacity: 0.42; }

/* Placeholder media — drawn artwork stands in until real photography lands.
   The frame fills like a real image would, so layout reads at full weight. */
.ph-media {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cream-2) 0%, var(--stone) 100%);
  color: var(--charcoal-40);
}
.ph-media__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Names the photography still outstanding. Sits on a scrim so it stays legible
   over both the light and the dark artwork. */
.ph-media__label {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 1;
  padding: 5px 12px;
  background: var(--cream-70);
  backdrop-filter: blur(3px);
  font-size: var(--fs-label); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--charcoal-70);
  /* Stay inside the frame on narrow cells rather than being clipped by it. */
  max-width: calc(100% - 20px);
}
/* The old faint monogram watermark. Kept for the empty states that still use
   it; brief §2 forbids the mark below ~40px, so it never shrinks past that. */
.ph-media__mark { width: 34%; min-width: 44px; max-width: 120px; opacity: 0.28; }

/* ============================================================
   Modal / overlay (size guide, quick view)
   ============================================================ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(31, 31, 29, 0.55);
  z-index: 160;
  display: grid; place-items: center;
  padding: var(--gutter);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
}
.overlay.is-open { opacity: 1; visibility: visible; }
.modal {
  background: var(--cream);
  max-width: 720px; width: 100%;
  max-height: 86vh; overflow-y: auto;
  padding: clamp(1.5rem, 4vw, 3rem);
  transform: translateY(14px);
  transition: transform var(--dur) var(--ease);
}
.overlay.is-open .modal { transform: none; }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--sp-3); }
.modal__title { font-family: var(--serif); font-size: var(--fs-h2); font-weight: 300; }
.modal__close { width: 40px; height: 40px; display: grid; place-items: center; }
.modal__close svg { width: 20px; height: 20px; }

.size-table { width: 100%; border-collapse: collapse; margin-top: var(--sp-2); }
.size-table th, .size-table td {
  text-align: left; padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--stone-line);
  font-size: var(--fs-small);
}
.size-table th {
  font-family: var(--sans); font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.14em; font-size: var(--fs-label);
  color: var(--charcoal-55);
}

/* ============================================================
   Loader — branded wordmark fade (first visit only)
   ============================================================ */
.loader {
  position: fixed; inset: 0; z-index: 300;
  background: var(--cream);
  display: grid; place-items: center;
  transition: opacity var(--dur-slow) var(--ease), visibility var(--dur-slow) var(--ease);
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader img {
  width: clamp(120px, 22vw, 180px);
  opacity: 0;
  animation: markIn 1400ms var(--ease) forwards;
}
@keyframes markIn {
  0%   { opacity: 0; transform: translateY(8px); }
  40%  { opacity: 1; transform: none; }
  75%  { opacity: 1; }
  100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .loader img { animation: none; opacity: 1; }
}

/* ============================================================
   Page transition veil (cross-fade)
   ============================================================ */
.page-veil {
  position: fixed; inset: 0; z-index: 250;
  background: var(--cream);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
}
.page-veil.is-active { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) {
  .page-veil { display: none; }
}

/* ---- Toast ---- */
.toast-wrap {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 320; display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--charcoal); color: var(--cream);
  padding: 0.85rem 1.4rem; font-size: var(--fs-small); letter-spacing: 0.06em;
  opacity: 0; transform: translateY(10px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.is-in { opacity: 1; transform: none; }

/* ============================================================
   Footer legal row
   ============================================================ */
.footer-legal {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding-top: var(--sp-4);
}
.footer-legal a {
  color: var(--cream);
  opacity: 0.7;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  transition: opacity var(--dur-fast) var(--ease);
}
.footer-legal a:hover { opacity: 1; }

/* ============================================================
   Cookie consent — quiet, luxury, non-intrusive
   ============================================================ */
.cookie-consent {
  position: fixed;
  left: var(--gutter);
  bottom: var(--gutter);
  right: auto;
  z-index: 210;
  max-width: 420px;
  background: var(--charcoal);
  color: var(--cream);
  padding: var(--sp-3) var(--sp-3);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.cookie-consent.is-in { opacity: 1; transform: none; }
.cookie-consent__text {
  font-size: var(--fs-small);
  color: var(--cream-70);
  letter-spacing: 0.02em;
  line-height: 1.6;
  margin-bottom: var(--sp-3);
  max-width: none;
}
.cookie-consent__text a { color: var(--cream); text-decoration: underline; text-underline-offset: 3px; }
.cookie-consent__actions { display: flex; gap: var(--sp-2); justify-content: flex-end; }
/* Ghost + solid buttons on dark ground — no bright colors */
.cookie-consent .btn { border-color: rgba(239,230,211,0.4); color: var(--cream); }
.cookie-consent .btn:hover { background: var(--cream); color: var(--charcoal); border-color: var(--cream); }
.cookie-consent .btn--ghost { border-color: rgba(239,230,211,0.25); color: var(--cream-70); }
.cookie-consent .btn--ghost:hover { background: transparent; border-color: var(--cream); color: var(--cream); }

@media (max-width: 520px) {
  .cookie-consent { left: 0; right: 0; bottom: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-consent { transition: none; }
}

/* ============================================================
   Legal / long-form content pages
   ============================================================ */
.legal-body { max-width: 760px; }
.legal-body h2 {
  font-size: var(--fs-h2);
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-3);
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 {
  font-size: var(--fs-h3);
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-2);
}
.legal-body p { color: var(--charcoal-70); margin-bottom: var(--sp-3); }
.legal-body ul { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: var(--sp-3); }
.legal-body ul li { display: flex; gap: 0.7rem; color: var(--charcoal-70); }
.legal-body ul li::before { content: "—"; color: var(--charcoal-40); flex-shrink: 0; }
.legal-body a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.legal-meta {
  font-size: var(--fs-small);
  color: var(--charcoal-55);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--stone-line);
}
.placeholder-note {
  background: var(--cream-2);
  border-left: 2px solid var(--rust);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-small);
  color: var(--charcoal-70);
  margin-bottom: var(--sp-4);
}
.placeholder-note strong { color: var(--charcoal); font-weight: 400; }
