/* ============================================================
   SAÏDA / 971 — components
   ============================================================ */

/* ---------------- Floating island nav ---------------- */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 120;
  display: flex; justify-content: center; pointer-events: none;
}
/* Logged in to WordPress: sit below the admin bar rather than under it */
.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }
.island-nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; height: var(--nav-h);
  padding: 0 max(0.6rem, calc((100vw - var(--wrap)) / 2 + var(--gut) - 0.4rem)) 0 max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut)));
  /* Translucent, so content reads through as it passes underneath */
  background: rgba(250, 243, 234, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--hair);
}
.island-nav .wordmark span { color: var(--gold-glass); }
.wordmark {
  display: inline-flex; align-items: center; gap: 0.45em; min-height: 44px; margin-right: auto;
  font-family: var(--display); font-weight: 400; font-size: 1.05rem; letter-spacing: 0.28em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.wordmark span { color: var(--gold-text); letter-spacing: 0.12em; }

.island-nav__links { display: none; gap: 0.1rem; margin-right: auto; }
.island-nav__links ul { display: flex; gap: 0.1rem; list-style: none; margin: 0; padding: 0; }
.island-nav__links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border-radius: 999px;
  font-size: 0.76rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--on-glass); text-decoration: none;
  transition: color 0.4s var(--settle), background-color 0.4s var(--settle);
}
.island-nav__links a:hover { color: var(--ink); background: rgba(27, 24, 18, 0.05); }
.island-nav__links a[aria-current="page"], .island-nav__links .current-menu-item > a { color: var(--ink); background: rgba(27, 24, 18, 0.07); }
.account-link { color: var(--ink); }
@media (min-width: 980px) { .island-nav__links { display: flex; } }

.bag-pill {
  display: inline-flex; align-items: center; gap: 0.55rem; min-height: 46px; padding: 0 0.5rem 0 1rem;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--paper);
  font-size: 0.74rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  transition: transform var(--press) var(--settle), background-color 0.4s var(--settle);
}
.bag-pill:hover { background: var(--plum); }
.bag-pill:active { transform: scale(0.96); }
.bag-pill .icon { width: 18px; height: 18px; }
.bag-pill__n {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 999px;
  background: rgba(243, 228, 212, 0.16); font-size: 0.78rem; letter-spacing: 0;
}
.bag-pill__n.is-bump { animation: bump 0.6s var(--settle); }
@keyframes bump { 35% { transform: scale(1.3); background: var(--gold-text); } }
@media (max-width: 520px) { .bag-pill__label { display: none; } .bag-pill { padding-left: 0.85rem; } }

.menu-toggle {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; color: var(--ink);
  transition: background-color 0.4s var(--settle), transform var(--press) var(--settle);
}
.menu-toggle:hover { background: rgba(27, 24, 18, 0.06); }
.menu-toggle:active { transform: scale(0.94); }
.menu-toggle__bars { position: relative; width: 20px; height: 12px; }
.menu-toggle__bars i {
  position: absolute; left: 0; width: 100%; height: 1.5px; border-radius: 2px; background: currentColor;
  transition: transform 0.55s var(--settle), top 0.55s var(--settle);
}
.menu-toggle__bars i:first-child { top: 0; }
.menu-toggle__bars i:last-child { top: 10px; }
/* The two lines rotate into an X — they don't vanish. */
.menu-toggle[aria-expanded="true"] .menu-toggle__bars i:first-child { top: 5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars i:last-child { top: 5px; transform: rotate(-45deg); }
@media (min-width: 980px) { .menu-toggle { display: none; } }

/* Full-screen menu. It grows from the button that opened it (top right)
   and returns there, so open and close travel the same path. */
.menu {
  position: fixed; inset: 0; z-index: 110;
  display: grid; align-content: center; padding: calc(var(--nav-h) + 3rem) var(--gut) 3rem;
  background: rgba(250, 243, 234, 0.82);
  -webkit-backdrop-filter: blur(30px) saturate(150%); backdrop-filter: blur(30px) saturate(150%);
  transform-origin: calc(100% - 40px) 46px;
  opacity: 0; transform: scale(0.96); filter: blur(6px);
  transition: opacity 0.45s var(--settle), transform 0.55s var(--settle), filter 0.45s var(--settle);
}
.menu.is-open { opacity: 1; transform: none; filter: none; }
.menu__list { list-style: none; display: grid; gap: 0.2rem; }
.menu__list a {
  display: inline-flex; align-items: center; min-height: 64px;
  font-family: var(--display); font-size: clamp(2.6rem, 11vw, 4rem); line-height: 1; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.menu__list a[aria-current="page"] { color: var(--plum); font-style: italic; }
.menu__list li { opacity: 0; transform: translateY(40px); transition: opacity 0.5s var(--settle), transform 0.7s var(--settle); }
.menu.is-open .menu__list li { opacity: 1; transform: none; transition-delay: calc(0.08s + var(--i) * 0.05s); }
.menu__ar { margin-top: 2rem; font-size: 1.4rem; color: var(--gold-text); opacity: 0; transition: opacity 0.6s var(--settle) 0.3s; }
.menu.is-open .menu__ar { opacity: 1; }
@media (min-width: 980px) { .menu { display: none !important; } }

/* ---------------- Product card: double bezel ---------------- */

.pcard { --r: var(--r-xl); }
.pcard__shell { height: 100%; }
.pcard__core {
  display: flex; flex-direction: column; height: 100%;
  border-radius: var(--r); overflow: hidden;
  background: var(--tint);
}
.pcard__link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.pcard__link:focus-visible { outline-offset: -4px; border-radius: var(--r); }
.pcard__stage { position: relative; display: grid; place-items: center; padding: 2.4rem 1rem 1.2rem; aspect-ratio: 4 / 3.6; }
.pcard--lg .pcard__stage { aspect-ratio: 4 / 3.2; }
.pcard__img {
  position: relative; z-index: 1; width: auto; height: 100%; max-height: 380px; object-fit: contain;
  filter: drop-shadow(0 18px 20px rgba(60, 35, 15, 0.18));
  transition: transform 0.8s var(--settle);
}
.pcard:hover .pcard__img { transform: translateY(-8px); }

.pcard__text { display: grid; gap: 0.25rem; padding: 0 1.6rem 0.4rem; }
.pcard__name { font-family: var(--display); font-weight: 400; font-size: clamp(1.35rem, 1.9vw, 1.75rem); line-height: 1.05; letter-spacing: 0.03em; }
.pcard--lg .pcard__name { font-size: clamp(1.6rem, 2.5vw, 2.3rem); letter-spacing: 0.025em; }
.pcard__ar { font-size: 1.15rem; color: var(--deep); line-height: 1.5; text-align: left; }
.pcard__line { color: var(--muted); font-style: italic; font-size: 0.98rem; line-height: 1.45; max-width: 34ch; }
.pcard__buy {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1rem 1rem 1.6rem; margin-top: auto;
}
.pcard__price { display: grid; font-size: 1.08rem; line-height: 1.25; }
.pcard__size { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.04em; }

/* Bento: two large, then three. Collapses to one column on phones. */
.bento { display: grid; gap: clamp(1rem, 2vw, 1.5rem); grid-template-columns: 1fr; }
@media (min-width: 640px) { .bento { grid-template-columns: repeat(2, 1fr); } .bento .pcard--md:last-child { grid-column: 1 / -1; } }
@media (min-width: 1000px) {
  .bento { grid-template-columns: repeat(12, 1fr); }
  .bento .pcard--lg { grid-column: span 6; }
  .bento .pcard--md, .bento .pcard--md:last-child { grid-column: span 4; }
}

/* ---------------- Framed images (double bezel) ---------------- */

.frame img { width: 100%; }

/* ---------------- Bag: a sheet that slides from the right and leaves the same way ---------------- */

.scrim { position: fixed; inset: 0; z-index: 140; background: rgba(27, 24, 18, 0.42); opacity: 0; transition: opacity 0.45s var(--settle); }
.scrim.is-open { opacity: 1; }
.bag {
  position: fixed; top: 10px; right: 10px; bottom: 10px; z-index: 150;
  width: min(440px, calc(100vw - 20px));
  border-radius: var(--r-xl);
  background: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
  transform: translateX(calc(100% + 20px)); /* driven by the spring in site.js */
  touch-action: pan-y;
  will-change: transform;
}
.bag__shell {
  display: flex; flex-direction: column; height: 100%;
  border-radius: var(--r-xl); overflow: hidden;
  background: var(--ink); color: var(--on-ink);
}
.bag__head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1rem 0.8rem 1.5rem; cursor: grab; }
.bag__head::before {
  /* the grab handle: says "you can drag this" */
  content: ""; position: absolute; left: 14px; top: 50%; width: 4px; height: 44px; margin-top: -22px;
  border-radius: 4px; background: rgba(243, 228, 212, 0.18);
}
.bag__title { font-family: var(--display); font-weight: 400; font-size: 1.9rem; letter-spacing: -0.01em; }
.bag__body { flex: 1; overflow-y: auto; padding: 0.3rem 1.5rem; overscroll-behavior: contain; }
.bag__empty { color: var(--on-ink-2); padding: 1.4rem 0; display: grid; gap: 1rem; justify-items: start; }
.bag__foot { display: grid; gap: 0.7rem; padding: 1.2rem 1.5rem 1.5rem; background: rgba(243, 228, 212, 0.03); }
.bag__row { display: flex; justify-content: space-between; color: var(--on-ink-2); }
.bag__foot .island { justify-content: space-between; margin-top: 0.4rem; }
.bag__note { text-align: center; font-size: 0.82rem; color: var(--on-ink-2); }

.line-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; align-items: start; padding: 1.1rem 0; }
.line-item + .line-item { box-shadow: 0 -1px 0 var(--hair-ink); }
.line-item__thumb { width: 64px; height: 84px; border-radius: 14px; display: grid; place-items: center; background: var(--tint, rgba(243,228,212,0.08)); }
.line-item__thumb img { height: 74px; width: auto; }
.line-item h3 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; line-height: 1.1; }
.line-item__meta { font-size: 0.9rem; color: var(--on-ink-2); margin: 0.15rem 0 0.55rem; }
.line-item__price { font-size: 1.05rem; white-space: nowrap; }
.line-item__rm {
  display: inline-flex; align-items: center; min-height: 44px; margin-left: 0.4rem; padding: 0 0.6rem; border: 0; border-radius: 999px;
  background: none; color: var(--on-ink-2); cursor: pointer; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase;
}
.line-item__rm:hover { color: var(--gold-lt); }

.stepper { display: inline-flex; align-items: center; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--hair-2); }
.stepper button {
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: none; color: inherit; cursor: pointer; transition: background-color 0.3s var(--settle), transform var(--press);
}
.stepper button:hover { background: rgba(127, 127, 127, 0.12); }
.stepper button:active { transform: scale(0.9); }
.stepper .icon { width: 16px; height: 16px; }
.stepper output { min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }
.bag .stepper { box-shadow: inset 0 0 0 1px var(--hair-ink); }

/* ---------------- Toast ---------------- */

.toast {
  position: fixed; left: 50%; bottom: 1.4rem; z-index: 160;
  max-width: calc(100vw - 2rem); padding: 0.85rem 1.4rem; border-radius: 999px;
  background: rgba(27, 24, 18, 0.88); color: var(--on-ink);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  font-size: 0.95rem; box-shadow: var(--lift-2);
  opacity: 0; transform: translate(-50%, 14px) scale(0.98); pointer-events: none;
  transition: opacity 0.4s var(--settle), transform 0.5s var(--settle);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 899px) {
  .toast { top: calc(var(--nav-h) + 12px); bottom: auto; transform: translate(-50%, -10px) scale(0.98); }
  .toast.is-on { transform: translate(-50%, 0); }
}

/* ---------------- Forms ---------------- */

.form-core { display: grid; gap: 1.2rem; padding: clamp(1.4rem, 3vw, 2.2rem); border-radius: var(--r-xl); background: var(--paper-lt); box-shadow: inset 0 0 0 1px var(--hair); }
.field { display: grid; gap: 0.45rem; }
.field label, .field legend { font-size: 0.74rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; height: 54px; padding: 0 1.1rem;
  font-family: var(--text); font-size: 1.05rem; color: var(--ink);
  background: #fffaf3; border: 1px solid var(--field); border-radius: var(--r-md);
  transition: border-color 0.3s var(--settle), box-shadow 0.3s var(--settle);
}
.field textarea { height: auto; min-height: 150px; padding: 0.9rem 1.1rem; resize: vertical; }
.field select {
  padding-right: 2.75rem; -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231b1812' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1.1rem center; background-size: 12px 8px;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 1px; }
.field [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(140, 47, 36, 0.1); }
.field__err { font-size: 0.92rem; color: var(--danger); }
.field__err:empty { display: none; }
.site-footer__join .field label { color: var(--on-ink-2); }
.site-footer__join .field input { background: rgba(243, 228, 212, 0.06); color: var(--on-ink); border-color: #8f8374; }
.site-footer__join .field__err { color: #f1b8a7; }
.notice-done { padding: 1rem 1.2rem; border-radius: var(--r-md); background: rgba(122, 92, 59, 0.08); box-shadow: inset 0 0 0 1px rgba(122, 92, 59, 0.2); }
.two { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .two { grid-template-columns: 1fr 1fr; } }

/* ---------------- Sticky buy bar (product pages) ---------------- */

.buybar {
  position: fixed; left: 50%; bottom: 14px; z-index: 100;
  width: min(calc(100% - 24px), 560px);
  transform: translate(-50%, calc(100% + 30px)); opacity: 0;
  transition: transform 0.6s var(--settle), opacity 0.4s var(--settle);
}
.buybar.is-on { transform: translate(-50%, 0); opacity: 1; }
.buybar__shell {
  display: flex; align-items: center; gap: 0.9rem; padding: 0.45rem 0.45rem 0.45rem 0.8rem; border-radius: 999px;
  background: rgba(250, 243, 234, 0.85);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 0 1px var(--hair), var(--lift-2);
}
.buybar__img { height: 40px; width: auto; }
.buybar__name { flex: 1; font-family: var(--display); font-size: 1.2rem; font-weight: 400; line-height: 1.1; }
.buybar__name span { display: block; font-family: var(--text); font-size: 0.86rem; font-weight: 400; color: var(--on-glass); }

/* ---------------- Footer ---------------- */

.site-footer { background: var(--ink); color: var(--on-ink); padding: clamp(3.5rem, 7vw, 6rem) 0 2.2rem; }
.site-footer__top { display: grid; gap: 3rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .site-footer__top { grid-template-columns: 1.8fr 1fr 1fr 1fr; } }
.site-footer__join { display: grid; gap: 0.6rem; margin-top: 2rem; max-width: 30rem; }
.site-footer__join h2 { color: var(--gold-lt); }
.site-footer__note { color: var(--on-ink-2); }
.site-footer__joinrow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.8rem; }
.site-footer__joinrow .field { flex: 1 1 14rem; }
.site-footer__joinrow .island { margin-top: 1.55rem; }
.wordmark--lg { font-size: 1.7rem; color: var(--on-ink); }
.wordmark--lg span { color: var(--gold-lt); }
.site-footer__ar { margin-top: 1rem; font-size: 1.5rem; color: var(--gold-lt); }
.site-footer__line { margin-top: 0.3rem; color: var(--on-ink-2); font-style: italic; }
.site-footer__col h2 { color: var(--gold-lt); margin-bottom: 0.8rem; }
.site-footer__col ul { list-style: none; display: grid; }
.site-footer__col a { display: flex; align-items: center; min-height: 44px; color: var(--on-ink-2); text-decoration: none; transition: color 0.4s var(--settle); }
.site-footer__col a:hover { color: var(--on-ink); }
.site-footer__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3.5rem; padding-top: 1.75rem;
  background: linear-gradient(90deg, transparent, var(--hair-ink) 20%, var(--hair-ink) 80%, transparent) top / 100% 1px no-repeat;
  font-size: 0.76rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--on-ink-2);
}

/* ---------------- Preferences ---------------- */

@media (prefers-reduced-transparency: reduce) {
  .island-nav, .buybar__shell, .menu, .toast { background: var(--paper-lt); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .toast { background: var(--ink); }
}
@media (prefers-contrast: more) {
  .island-nav, .buybar__shell { background: var(--paper-lt); box-shadow: 0 0 0 2px var(--ink); }
  .pcard__core, .form-core { box-shadow: inset 0 0 0 2px var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  .menu, .menu__list li, .scrim, .buybar, .toast { transition: opacity 0.2s ease !important; transform: none !important; filter: none !important; }
  .menu:not(.is-open) { opacity: 0; }
  .pcard:hover .pcard__img { transform: none; }
}

/* ================= Phones ================= */

/* 9. Shop cards: about 480px tall instead of 628 */
@media (max-width: 639px) {
  .pcard__stage, .pcard--lg .pcard__stage { aspect-ratio: 4 / 3; padding: 1.6rem 1rem 0.6rem; }
  .pcard__img { max-height: 250px; }
}
/* 4. The sticky buy bar mustn't cover the end of a product page */
.view-product .site-footer { padding-bottom: calc(2.2rem + 96px); }
/* Long names in the buy bar */
@media (max-width: 420px) { .buybar__name { font-size: 1.05rem; } }
/* 10. The five perfumes in the phone menu */
.menu__sub { list-style: none; display: grid; margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--hair-2); }
.menu__sub a { display: flex; align-items: center; min-height: 44px; font: 1.05rem var(--text); color: var(--muted); text-decoration: none; }
.menu__sub a:hover, .menu__sub a[aria-current] { color: var(--ink); }

/* WhatsApp: shown once a number is set (s971_contact). Bottom-left, clear of the bag and buy bar. */
.wa {
  position: fixed; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 110;
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 48px; padding: 0 1.1rem 0 0.9rem;
  border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none;
  box-shadow: var(--lift-2); font: 500 0.8rem var(--text); letter-spacing: 0.14em; text-transform: uppercase;
}
.wa:hover { background: var(--plum); }
.view-product .wa { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 84px); }
@media (max-width: 639px) { .wa__label { display: none; } .wa { padding: 0 0.9rem; } }
