/* ============================================================
   SebSugar — Site header + content (CMS-hydrated) additions
   Loaded site-wide after style.css. All pieces are injected/revealed
   by js/header.js (and js/home-content.js for the featured grid) from
   /api/site-content.php + /api/catalog.php:

     1. Announcement MARQUEE   (.site-marquee, seamless gold bar)
     2. Nav ACTION ICONS       (.nav__actions — search / account / cart)
     3. SEARCH overlay          (.site-search dialog + live results)
     4. ACCOUNT dropdown        (.nav__account-menu)
     5. WhatsApp FAB            (.wa-fab, WhatsApp green)
     6. "Order online" featured cakes  (.home-featured grid)

   Uses the shared design tokens (--gold, --cream, --bg-elev,
   --border, --radius-lg, --ease-out …). No hardcoded brand colors,
   except the required WhatsApp green on the FAB.
   ============================================================ */

/* ---------- 1. ANNOUNCEMENT MARQUEE ----------------------------------- */
:root { --announce-h: 40px; }

.site-marquee {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--z-nav, 50) + 2);
  height: var(--announce-h);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(90deg, var(--gold-soft) 0%, var(--gold) 45%, var(--gold-bright) 100%);
  color: #201700;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
}
.site-marquee[hidden] { display: none; }

.site-marquee__viewport {
  width: 100%;
  overflow: hidden;
}

.site-marquee__track {
  display: inline-flex;
  width: max-content;
  will-change: transform;
  animation: siteMarquee 30s linear infinite;
}
.site-marquee:hover .site-marquee__track { animation-play-state: paused; }

.site-marquee__group { display: inline-flex; }

.site-marquee__item {
  display: inline-block;
  padding-right: 3rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-marquee__item::before {
  content: "\2726"; /* ✦ */
  padding-right: 3rem;
  opacity: 0.5;
  font-size: 0.8em;
}

/* Static (reduced-motion) variant: single centred line, no separators. */
.site-marquee--static { justify-content: center; }
.site-marquee--static .site-marquee__item { padding-right: 0; }
.site-marquee--static .site-marquee__item::before { content: none; }

@keyframes siteMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Push the fixed nav AND page content down so the bar never covers them.
   Active only while the marquee is shown (header.js adds .has-announce). */
body.has-announce .nav { top: var(--announce-h); }
body.has-announce { padding-top: var(--announce-h); }

@media (max-width: 600px) {
  .site-marquee__item { font-size: 0.72rem; padding-right: 2rem; }
  .site-marquee__item::before { padding-right: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .site-marquee__track { animation: none; }
}

/* ---------- 2. NAV ACTION ICONS (search / account / cart) ------------- */
.nav__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.nav__action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--dur-fast, 0.2s) var(--ease-out),
              background var(--dur-fast, 0.2s) var(--ease-out),
              border-color var(--dur-fast, 0.2s) var(--ease-out);
}
.nav__action svg { display: block; }
.nav__action:hover,
.nav__action:focus-visible {
  color: var(--gold);
  background: rgba(218, 180, 47, 0.08);
  border-color: var(--border);
}
.nav__action:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Cart badge — self-contained so it styles on pages without shop-commerce.css.
   Anchors to any positioned cart control (.nav__action--cart / .nav__link--cart). */
.nav__cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--gold);
  color: #0a0a09;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 10px var(--gold-glow);
  pointer-events: none;
}
.nav__cart-count[hidden] { display: none; }

/* ---------- 3. SEARCH OVERLAY ----------------------------------------- */
.site-search {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 80);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1rem, 6vh, 5rem) 1rem 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--ease-out), visibility 0.22s var(--ease-out);
}
.site-search[hidden] { display: none; }
.site-search.is-open { opacity: 1; visibility: visible; }

.site-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 5, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.site-search__panel {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: clamp(16px, 2vw, 22px);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  transform: translateY(-14px);
  transition: transform 0.28s var(--ease-out);
}
.site-search.is-open .site-search__panel { transform: translateY(0); }

.site-search__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-soft);
}
.site-search__icon { display: inline-flex; color: var(--gold); }
.site-search__input {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--cream);
  font-family: inherit;
  font-size: 1.05rem;
}
.site-search__input::placeholder { color: var(--cream-muted); }
.site-search__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--cream-muted);
  cursor: pointer;
  transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.site-search__close:hover,
.site-search__close:focus-visible { color: var(--gold); background: rgba(218, 180, 47, 0.08); }

.site-search__results {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.site-search__result {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.18s var(--ease-out);
}
.site-search__result:last-child { border-bottom: 0; }
.site-search__result:hover { background: rgba(218, 180, 47, 0.07); }
.site-search__result:focus-visible { outline: none; background: rgba(218, 180, 47, 0.13); }

.site-search__thumb {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border-soft);
}
.site-search__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.site-search__meta { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.site-search__name {
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--cream);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-search__price { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; color: var(--gold); }

.site-search__hint { padding: 1.1rem 1rem; color: var(--cream-muted); font-size: 0.9rem; }
.site-search__hint[hidden] { display: none; }

body.is-search-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .site-search,
  .site-search__panel { transition: none; }
}

/* ---------- 4. ACCOUNT DROPDOWN --------------------------------------- */
.nav__account-menu {
  position: fixed;
  z-index: calc(var(--z-modal, 80) + 1);
  min-width: 190px;
  padding: 0.4rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}
.nav__account-menu[hidden] { display: none; }
.nav__account-menu.is-open { opacity: 1; transform: translateY(0); }

.nav__account-item {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 9px;
  color: var(--cream);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  transition: color 0.18s var(--ease-out), background 0.18s var(--ease-out);
}
.nav__account-item:hover { color: var(--gold); background: rgba(218, 180, 47, 0.08); }
.nav__account-item:focus-visible { outline: none; color: var(--gold); background: rgba(218, 180, 47, 0.14); }

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

/* ---------- 5. WHATSAPP FAB ------------------------------------------- */
.wa-fab {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: calc(var(--z-nav, 50) + 5);
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #25d366;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 10px 28px -6px rgba(37, 211, 102, 0.55), 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  animation: waFabIn 0.4s var(--ease-out) both;
}
.wa-fab svg { display: block; }
.wa-fab:hover,
.wa-fab:focus-visible {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 16px 36px -6px rgba(37, 211, 102, 0.65), 0 6px 16px rgba(0, 0, 0, 0.4);
}
.wa-fab:focus-visible { outline: 3px solid rgba(37, 211, 102, 0.5); outline-offset: 3px; }

/* Lift above the sticky mobile buy-bar on product pages. */
@media (max-width: 899px) {
  body.has-buybar .wa-fab,
  body.has-buybar-fab .wa-fab { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

@keyframes waFabIn {
  from { opacity: 0; transform: translateY(12px) scale(0.85); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wa-fab { animation: none; transition: none; }
  .wa-fab:hover,
  .wa-fab:focus-visible { transform: none; }
}

/* ---------- 6. "ORDER ONLINE" FEATURED CAKES -------------------------- */
.home-featured[hidden] { display: none; }

.home-featured__head {
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.home-featured__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 2.4vw, 2rem);
}

@media (max-width: 900px) {
  .home-featured__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .home-featured__grid { grid-template-columns: 1fr; max-width: 26rem; margin-inline: auto; }
}

.home-featured__card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.5s var(--ease-out), border-color 0.5s var(--ease-out),
              box-shadow 0.5s var(--ease-out);
}

.home-featured__card:hover,
.home-featured__card:focus-visible {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: 0 22px 48px -22px rgba(0, 0, 0, 0.7);
}
.home-featured__card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.home-featured__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg);
}

.home-featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s var(--ease-out);
}
.home-featured__card:hover .home-featured__media img { transform: scale(1.06); }

.home-featured__badge {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--gold);
  border-radius: 999px;
}

.home-featured__body {
  padding: 1.15rem 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.home-featured__name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.24rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--cream);
}

.home-featured__price {
  font-size: 0.92rem;
  color: var(--cream-muted);
  letter-spacing: 0.02em;
}
.home-featured__price strong {
  color: var(--gold);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .home-featured__card,
  .home-featured__media img {
    transition: none;
  }
  .home-featured__card:hover { transform: none; }
  .home-featured__card:hover .home-featured__media img { transform: none; }
}

/* ---------- 7. FOOTER NEWSLETTER (injected site-wide by header.js) ---- */
.site-newsletter {
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(120% 140% at 50% -20%, rgba(218, 180, 47, 0.10), transparent 60%),
    var(--bg-elev);
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.site-newsletter__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.site-newsletter__copy { flex: 1 1 16rem; min-width: 0; }

.site-newsletter__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.site-newsletter__heading {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--cream);
}

.site-newsletter__sub {
  margin: 0;
  max-width: 36ch;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--cream-muted);
}

.site-newsletter__form { flex: 1 1 22rem; min-width: 0; max-width: 30rem; }

/* Visually-hidden label (kept for screen readers). */
.site-newsletter__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.site-newsletter__field {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color var(--dur-fast, 0.2s) var(--ease-out),
              box-shadow var(--dur-fast, 0.2s) var(--ease-out);
}
.site-newsletter__field:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(218, 180, 47, 0.14);
}
.site-newsletter__field[hidden] { display: none; }

.site-newsletter__input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.95rem;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.95rem;
}
.site-newsletter__input::placeholder { color: var(--cream-muted); }

.site-newsletter__btn {
  flex: 0 0 auto;
  padding: 0.6rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  color: #201700;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform var(--dur-fast, 0.2s) var(--ease-out),
              box-shadow var(--dur-fast, 0.2s) var(--ease-out),
              opacity var(--dur-fast, 0.2s) var(--ease-out);
}
.site-newsletter__btn:hover,
.site-newsletter__btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px var(--gold-glow);
}
.site-newsletter__btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.site-newsletter__btn:disabled,
.site-newsletter__btn.is-loading {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.site-newsletter__note {
  margin: 0.75rem 0 0;
  padding-left: 0.4rem;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--cream-muted);
}
.site-newsletter__link { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.site-newsletter__link:hover { color: var(--gold-bright); }

.site-newsletter__msg {
  margin: 0.75rem 0 0;
  padding-left: 0.4rem;
  font-size: 0.85rem;
  line-height: 1.5;
}
.site-newsletter__msg[hidden] { display: none; }
.site-newsletter__msg--ok { color: var(--gold-bright); }
.site-newsletter__msg--error { color: #e6968b; }

@media (max-width: 720px) {
  .site-newsletter__inner { flex-direction: column; align-items: stretch; }
  .site-newsletter__form { max-width: none; }
}
@media (max-width: 420px) {
  .site-newsletter__field { flex-direction: column; border-radius: var(--radius); }
  .site-newsletter__btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .site-newsletter__field,
  .site-newsletter__btn { transition: none; }
  .site-newsletter__btn:hover,
  .site-newsletter__btn:focus-visible { transform: none; }
}

/* ---------- 8. HOMEPAGE TESTIMONIALS (hydrated by home-content.js) ---- */
.testimonials[hidden] { display: none; }

.testimonials__head { text-align: center; margin-bottom: clamp(2rem, 4vw, 3rem); }

.testimonials__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.1rem, 2.2vw, 1.75rem);
}
@media (max-width: 900px) {
  .testimonials__grid { grid-template-columns: 1fr; max-width: 32rem; margin-inline: auto; }
}

.testimonial-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 0;
  padding: clamp(1.5rem, 2.5vw, 2rem) clamp(1.4rem, 2.2vw, 1.9rem) clamp(1.4rem, 2.2vw, 1.75rem);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.testimonial-card::before {
  content: "\201C"; /* “ */
  position: absolute;
  top: -0.32em;
  right: 0.6rem;
  font-family: var(--font-display);
  font-size: 5.5rem;
  line-height: 1;
  color: var(--gold);
  opacity: 0.14;
  pointer-events: none;
}

.testimonial-card__stars {
  display: inline-flex;
  gap: 0.15rem;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--gold);
}
.testimonial-card__star.is-empty { color: var(--border-soft); }

.testimonial-card__quote {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  font-style: italic;
  line-height: 1.5;
  color: var(--cream);
}

.testimonial-card__author {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin-top: auto;
}
.testimonial-card__name {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold);
}
.testimonial-card__meta {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--cream-muted);
}
