/* ═══════════════════════════════════════════════════════════════
   CROWN TANDOORI — UX layer
   Interaction, accessibility and mobile behaviour.
   The COLOUR SYSTEM lives in style.css — this file must never
   redefine the palette, only fix element-level details.
   ═══════════════════════════════════════════════════════════════ */

:root { color-scheme: dark; --focus: #7cc7ff; }
html[data-theme="light"] { color-scheme: light; --focus: #0b63b8; }

body, #navbar, .nav-links, .cart-drawer, .co-box, .menu-item,
.combo-card, .review-card, .fc-pkg, .fc-info, .google-badge {
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

/* Visible, consistent keyboard focus */
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--focus) !important;
  outline-offset: 3px;
}

/* ── Navigation actions ── */
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-mobile-order { display: none; }
.theme-toggle {
  position: relative; width: 40px; height: 40px; flex: 0 0 40px;
  border: 1px solid rgba(255,255,255,.28); border-radius: 50%;
  background: rgba(255,255,255,.06); color: #fff; cursor: pointer;
  display: grid; place-items: center; overflow: hidden;
  transition: background .25s, border-color .25s, color .25s;
}
.theme-toggle span { position: absolute; font-size: 17px; transition: transform .25s, opacity .25s; }
.theme-sun  { opacity: 0; transform: translateY(20px) rotate(60deg); }
.theme-moon { opacity: 1; transform: translateY(0); }
[data-theme="light"] .theme-sun  { opacity: 1; transform: translateY(0) rotate(0); }
[data-theme="light"] .theme-moon { opacity: 0; transform: translateY(-20px); }
/* once the bar is solid, the toggle follows the theme's ink */
#navbar.scrolled .theme-toggle { background: transparent; color: var(--text); border-color: var(--line); }
.nav-backdrop { display: none; }
.cart-fab { opacity: 1; transform: none; pointer-events: auto; }
.cart-fab:not(.has-items) .cart-badge { display: none; }

/* The logo artwork is light, so give it a dark chip on light surfaces */
[data-theme="light"] #navbar.scrolled .nav-logo img,
[data-theme="light"] .footer-logo {
  background: #15130F; border-radius: 10px; padding: 5px 9px;
}

/* ── Open / closed status dot ── */
.status-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #c2554a; }
.status-dot.open { background: #3fa86a; animation: statusPulse 2.4s infinite; }
@keyframes statusPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(63,168,106,.45); } 50% { box-shadow: 0 0 0 6px rgba(63,168,106,0); } }

/* ── Mobile cart conversion bar (shown in the mobile query) ── */
.mobile-cart-bar { display: none; }

/* ── Faster one-time brand intro ── */
#intro.play::before { animation-duration: 1.2s; }
#intro.play #intro-logo { animation-duration: .65s; animation-delay: .1s; }
#intro.play .intro-logo-wrap::after { animation-duration: .6s; animation-delay: .4s; }
#intro.play .intro-rule { animation-duration: .4s; animation-delay: .4s; }
#intro.play .intro-tag { animation-duration: .4s; animation-delay: .62s; }
#intro.play #intro-skip { animation-delay: .5s; }

/* ── Comfortable touch targets ── */
.add-btn { min-height: 44px; }
.menu-tab { min-height: 42px; }
.qty-step button { width: 44px; height: 44px; }
.co-field label { font-size: 12px; }

@media (max-width: 860px) {
  body.nav-open { overflow: hidden; }
  .nav-inner { gap: 10px; }
  .nav-logo { position: relative; z-index: 1002; }
  .nav-logo img, #navbar.scrolled .nav-logo img { height: 34px; max-width: 160px; object-fit: contain; }
  .nav-actions { margin-left: auto; gap: 6px; position: relative; z-index: 1002; }
  .nav-desktop-order { display: none; }
  .nav-mobile-order { display: inline-flex; justify-content: center; }
  .theme-toggle, .cart-fab, .nav-toggle { width: 40px; height: 40px; flex: 0 0 40px; }
  .nav-toggle { align-items: center; justify-content: center; }
  .cart-fab svg { width: 19px; height: 19px; }

  /* the toggle sits over the page (not the dark hero) once the drawer
     is open or the bar is solid — keep it readable in BOTH themes */
  body.nav-open .theme-toggle { background: transparent; color: var(--text); border-color: var(--line); }

  .nav-links { z-index: 1001; padding: 96px 32px 40px; justify-content: flex-start; align-items: stretch; gap: 6px; overflow-y: auto; }
  .nav-links a { padding: 13px 4px; font-size: 16px; }
  .nav-links .nav-cta { margin-top: 14px; text-align: center; }
  .nav-backdrop {
    position: fixed; inset: 0; z-index: 1000; display: block;
    border: 0; background: rgba(0,0,0,.5); opacity: 0; visibility: hidden;
    transition: opacity .3s, visibility .3s;
  }
  .nav-backdrop.open { opacity: 1; visibility: visible; }

  .hero-content { padding: 0 var(--pad-x); }
  .hero-scroll { display: none; }

  .mobile-cart-bar {
    position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 1450;
    min-height: 54px; padding: 0 20px; border: 0; border-radius: 14px;
    background: var(--gold); color: var(--on-gold); box-shadow: 0 10px 28px rgba(0,0,0,.3);
    align-items: center; justify-content: space-between; gap: 16px;
    font: 600 14px 'Montserrat', sans-serif; opacity: 0; transform: translateY(85px);
    pointer-events: none; transition: opacity .25s, transform .25s;
  }
  .mobile-cart-bar.show { display: flex; opacity: 1; transform: translateY(0); pointer-events: auto; }
  body.cart-has-items .wa-float { bottom: 84px; }
  body.cart-has-items .toast { bottom: 150px; }
  .wa-float { width: 48px; height: 48px; right: 16px; bottom: 16px; }
  .wa-float svg { width: 25px; height: 25px; }
}

@media (max-width: 420px) {
  .nav-logo img, #navbar.scrolled .nav-logo img { height: 30px; max-width: 140px; }
  .theme-toggle, .cart-fab, .nav-toggle { width: 38px; height: 38px; flex-basis: 38px; }
  .nav-actions { gap: 4px; }
  .hero-tags span { font-size: 11.5px; padding: 6px 12px; }
  .about-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .about-stats div strong { font-size: 32px; }
  .about-stats div span { font-size: 9.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .reviews-track { animation: none; }
  .status-dot.open { animation: none; }
}
