/* ============================================================
   JY CAFE — Shared Components
   Header, footer, cart drawer, WhatsApp widget, ordering modal,
   toasts, cards, accordion, carousel.
   ============================================================ */

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 14px;
  z-index: 60;
  padding-inline: 14px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--container);
  margin-inline: auto;
  padding: 10px 16px 10px 12px;
  background: rgba(255, 248, 245, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(232, 205, 184, 0.7);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.site-header.is-scrolled .header-inner {
  box-shadow: var(--shadow-md);
  background: rgba(255, 248, 245, 0.94);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand img { width: 42px; height: 42px; border-radius: 50%; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--lavender-900);
  line-height: 1;
}

.brand-name em {
  font-style: normal;
  color: var(--gold-500);
  font-weight: 500;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  position: relative;
  display: block;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink-700);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 0;
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--gold-500);
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}

.site-nav a:hover { color: var(--lavender-800); }
.site-nav a:hover::after { width: 16px; }

.site-nav a.active {
  background: var(--lavender-800);
  color: var(--cream-50);
}

.site-nav a.active::after { display: none; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.cart-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--lavender-800);
  color: var(--cream-50);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  box-shadow: 0 6px 16px rgba(82, 65, 122, 0.3);
}

.cart-pill:hover { transform: translateY(-2px); }
.cart-pill svg { width: 19px; height: 19px; }

.cart-pill .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 5px;
  border-radius: var(--r-pill);
  background: var(--gold-400);
  color: var(--lavender-950);
  font-size: 0.78rem;
  font-weight: 800;
}

.cart-pill .count:empty { display: none; }

.nav-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cream-200);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-toggle svg { width: 22px; height: 22px; color: var(--lavender-900); }

.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
}

@media (max-width: 899px) {
  .site-header { top: 10px; }

  .site-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    max-width: var(--container);
    margin-inline: auto;
    background: var(--cream-50);
    border: 1px solid var(--sand-300);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 14px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .site-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
  .site-nav a { text-align: center; padding: 13px; }
  .site-nav a::after { display: none; }

  .brand-name { font-size: 1.15rem; }
  .cart-pill span.label { display: none; }
  .cart-pill { padding: 10px 12px; }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(70px, 10vw, 130px) 0 clamp(50px, 8vw, 90px);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(212, 165, 116, 0.16), transparent 60%),
    radial-gradient(900px 480px at -10% 110%, rgba(157, 139, 192, 0.22), transparent 60%),
    linear-gradient(160deg, var(--cream-100), var(--cream-50));
}

.page-hero h1 {
  font-size: clamp(2.2rem, 5.6vw, 3.9rem);
  margin: 14px 0 14px;
}

.page-hero .crumbs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--gold-500);
}

.page-hero .crumbs svg { width: 14px; height: 14px; }
.page-hero .crumbs a:hover { text-decoration: underline; }

/* ---------- Section shells ---------- */
.section--cream { background: var(--cream-100); }
.section--white { background: var(--white); }
.section--lavender { background: var(--lavender-800); color: var(--cream-100); }
.section--lavender h2, .section--lavender h3 { color: var(--cream-50); }
.section--lavender .lead, .section--lavender p:not(.tag):not(.chip) { color: rgba(255, 245, 238, 0.82); }
.section--lavender .eyebrow { background: rgba(255, 245, 238, 0.12); color: var(--sand-300); }

/* ---------- Generic cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--cream-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  background: var(--lavender-950);
  color: rgba(255, 245, 238, 0.78);
  padding-top: clamp(64px, 8vw, 100px);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.5;
  pointer-events: none;
}

.site-footer .footer-top {
  display: grid;
  gap: 44px;
  padding-bottom: 56px;
  position: relative;
}

.footer-brand { max-width: 340px; }
.footer-brand .brand img { width: 46px; height: 46px; }
.footer-brand .brand-name { color: var(--cream-50); }
.footer-brand p { margin-top: 18px; font-size: 0.95rem; }

.footer-socials { display: flex; gap: 10px; margin-top: 22px; }

.footer-socials a {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 245, 238, 0.1);
  color: var(--cream-100);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.footer-socials a:hover { background: var(--gold-400); color: var(--lavender-950); transform: translateY(-3px); }
.footer-socials svg { width: 19px; height: 19px; }

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand-300);
  margin-bottom: 18px;
}

.footer-col ul { display: grid; gap: 11px; font-size: 0.95rem; }

.footer-col li { display: flex; align-items: flex-start; gap: 8px; }

.footer-col a { transition: color 0.2s var(--ease); display: inline-flex; align-items: center; gap: 8px; }
.footer-col a:hover { color: var(--gold-400); }

.footer-col a svg, .footer-col li > svg { width: 15px; height: 15px; color: var(--lavender-500); flex: none; margin-top: 3px; }

.footer-bottom {
  border-top: 1px solid rgba(255, 245, 238, 0.14);
  padding-block: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  position: relative;
}

.footer-bottom a { color: var(--gold-400); }

@media (min-width: 768px) {
  .footer-top {
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  }
}

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: grid;
  gap: 10px;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--lavender-950);
  color: var(--cream-50);
  padding: 14px 18px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.92rem;
  animation: toast-in 0.4s var(--ease);
}

.toast.is-leaving { animation: toast-out 0.35s var(--ease) forwards; }

.toast svg { width: 20px; height: 20px; flex: none; color: var(--gold-400); }
.toast b { display: block; color: var(--white); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

@keyframes toast-out {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateY(12px); }
}

/* ---------- Floating cart (page dock) ---------- */
.cart-dock {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--lavender-700), var(--lavender-900));
  color: var(--cream-50);
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(61, 46, 92, 0.4);
  transition: transform 0.3s var(--ease);
}

.cart-dock:hover { transform: translateY(-4px) scale(1.03); }
.cart-dock svg { width: 22px; height: 22px; }

.cart-dock .dock-total { font-size: 0.92rem; opacity: 0.85; font-weight: 600; }
.cart-dock .dock-count {
  background: var(--gold-400);
  color: var(--lavender-950);
  min-width: 24px;
  height: 24px;
  padding-inline: 6px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.cart-dock.is-hidden { opacity: 0; transform: translateY(30px); pointer-events: none; }

/* ---------- Cart drawer ---------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 34, 64, 0.55);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}

.cart-overlay.is-open { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  width: min(440px, 100vw);
  background: var(--cream-50);
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.45s var(--ease);
  box-shadow: var(--shadow-lg);
}

.cart-drawer.is-open { transform: none; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--cream-200);
}

.drawer-head h3 { font-size: 1.3rem; }
.drawer-close {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--cream-200);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--lavender-900);
}
.drawer-close svg { width: 18px; height: 18px; }

.drawer-items { flex: 1; overflow-y: auto; padding: 20px 24px; display: grid; gap: 14px; align-content: start; }

.cart-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-500);
}

.cart-empty svg { width: 64px; height: 64px; margin: 0 auto 16px; color: var(--sand-300); }
.cart-empty h4 { margin-bottom: 8px; }

.drawer-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--cream-200);
  border-radius: var(--r-md);
}

.drawer-item .di-name { font-weight: 700; color: var(--ink-900); font-size: 0.95rem; }
.drawer-item .di-price { font-size: 0.86rem; color: var(--gold-500); font-weight: 600; margin-top: 2px; }
.drawer-item .di-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.drawer-item .remove-btn {
  font-size: 0.75rem;
  color: var(--ink-500);
  text-decoration: underline;
  padding: 2px;
}
.drawer-item .remove-btn:hover { color: var(--red-badge); }

.drawer-item .stepper button { width: 26px; height: 26px; font-size: 1rem; }
.drawer-item .stepper span { min-width: 24px; font-size: 0.9rem; }

.drawer-summary {
  border-top: 1px solid var(--cream-200);
  background: var(--cream-100);
  padding: 20px 24px 24px;
  display: grid;
  gap: 12px;
}

.sum-row { display: flex; justify-content: space-between; font-size: 0.92rem; }
.sum-row.total { font-size: 1.1rem; font-weight: 800; color: var(--ink-900); padding-top: 8px; border-top: 1.5px dashed var(--sand-300); }
.sum-row.discount { color: var(--green-badge); font-weight: 600; }
.sum-row .sum-label { color: var(--ink-500); }
.sum-row.total .sum-label { color: var(--ink-900); }

.coupon-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 4px;
}

.coupon-box input {
  padding: 10px 14px;
  border: 1.5px dashed var(--sand-300);
  border-radius: var(--r-md);
  background: var(--white);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.coupon-box input:focus { outline: none; border-color: var(--lavender-500); }

.coupon-hint { font-size: 0.8rem; color: var(--ink-500); margin-top: 6px; }
.coupon-hint b { color: var(--gold-500); }

@media (min-width: 768px) {
  .cart-dock { display: none; }
}
