/* ═══════════════════════════ BASE ═══════════════════════════ */
html { scroll-behavior: smooth; }

/* Grain texture overlay for warmth */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.045;
  background-image: url('data:image/svg+xml,<svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="1"/></svg>');
  background-repeat: repeat;
  background-size: 200px;
}

/* ═══════════════════════════ NAVBAR ═══════════════════════════ */

/* Default navbar state (transparent, over hero) */
#navbar .nav-link { color: rgba(250, 246, 241, 0.7); }
#navbar .nav-link:hover { color: #DBAD56; }
#navbar .nav-logo-text { color: #FAF6F1; }
#navbar .nav-cta {
  background: rgba(250, 246, 241, 0.12);
  color: #FAF6F1;
  backdrop-filter: blur(8px);
}
#navbar .nav-cta:hover {
  background: #C8875C;
}
#navbar .ham-line { background: #FAF6F1; }

/* Scrolled navbar state */
#navbar.scrolled {
  background: rgba(250, 246, 241, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 213, 195, 0.5);
}
#navbar.scrolled .nav-link { color: rgba(74, 55, 40, 0.55); }
#navbar.scrolled .nav-link:hover { color: #C8875C; }
#navbar.scrolled .nav-logo-text { color: #4A3728; }
#navbar.scrolled .nav-cta {
  background: #4A3728;
  color: #FAF6F1;
  backdrop-filter: none;
}
#navbar.scrolled .nav-cta:hover {
  background: #C8875C;
}
#navbar.scrolled .ham-line { background: #4A3728; }

/* ═══════════════════════════ NAVBAR TOGGLE BUTTON ═══════════════════════════ */
.nav-toggle-btn {
  background: rgba(250, 246, 241, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(250, 246, 241, 0.22);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.nav-toggle-btn:hover {
  background: rgba(250, 246, 241, 0.28);
}
#navbar.scrolled .nav-toggle-btn {
  background: rgba(74, 55, 40, 0.06);
  border-color: rgba(229, 213, 195, 0.7);
}
#navbar.scrolled .nav-toggle-btn:hover {
  background: rgba(74, 55, 40, 0.12);
}

/* Hamburger lines */
.hamburger-lines {
  width: 22px;
  height: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.ham-line {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  transform-origin: center;
}

/* Hamburger → X when open */
.ham-open .ham-1 { transform: translateY(7px) rotate(45deg); }
.ham-open .ham-2 { opacity: 0; transform: scaleX(0); }
.ham-open .ham-3 { transform: translateY(-7px) rotate(-45deg); }
.ham-open .ham-line { background: #FAF6F1 !important; }

/* ═══════════════════════════ MOBILE MENU — SLIDE PANEL ═══════════════════════════ */
.mobile-menu-closed {
  pointer-events: none;
  visibility: hidden;
}
.mobile-menu-closed .mobile-menu-bg {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.mobile-menu-closed .mobile-menu-panel {
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-menu-closed .mobile-link {
  opacity: 0;
  transform: translateX(16px);
}

.mobile-menu-open {
  pointer-events: auto;
  visibility: visible;
}
.mobile-menu-open .mobile-menu-bg {
  opacity: 1;
  background: rgba(20, 12, 8, 0.70);
  transition: opacity 0.35s ease;
  /* Removed backdrop-filter: blur(2px) — causes sibling compositing bugs
     in mobile WebKit, making the panel background disappear. */
}
.mobile-menu-panel {
  background-color: #FAF6F1 !important;
  /* Force own compositing layer to prevent parent backdrop-filter
     (#navbar.scrolled) from eating this element's background on mobile WebKit */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
  isolation: isolate;
}
.mobile-menu-open .mobile-menu-panel {
  transform: translateX(0);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu-open .mobile-link {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.mobile-menu-open .mobile-link:nth-child(1) { transition-delay: 0.12s; }
.mobile-menu-open .mobile-link:nth-child(2) { transition-delay: 0.18s; }
.mobile-menu-open .mobile-link:nth-child(3) { transition-delay: 0.24s; }
.mobile-menu-open .mobile-link:nth-child(4) { transition-delay: 0.30s; }
.mobile-menu-open .mobile-link:nth-child(5) { transition-delay: 0.36s; }

/* ═══════════════════════════ HERO ═══════════════════════════ */
.hero-img {
  animation: heroZoom 20s ease-out forwards;
}
@keyframes heroZoom {
  from { transform: scale(1.1); }
  to   { transform: scale(1.0); }
}

/* Scroll indicator */
.scroll-indicator .scroll-dot {
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(36px); opacity: 0; }
}

/* Hero text reveal */
.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  animation: revealUp 0.8s ease forwards;
}
@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════ SCROLL REVEAL ═══════════════════════════ */
.reveal-section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-section.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════ LOGO ═══════════════════════════ */
/* Gentle scale pulse on hover instead of spin */
.group:hover img.rounded-full {
  animation: logoPulse 0.6s ease;
}
@keyframes logoPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ═══════════════════════════ DISH CARDS ═══════════════════════════ */
.dish-card {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@media (min-width: 768px) {
  .dish-card:hover {
    transform: translateY(-8px);
  }
  .dish-card > div {
    transition: box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  .dish-card:hover > div {
    box-shadow: 0 20px 48px rgba(74, 55, 40, 0.12);
  }
}

/* Horizontal scroll on mobile */
@media (max-width: 767px) {
  .dish-scroll {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .dish-scroll::-webkit-scrollbar { display: none; }
  .dish-card {
    scroll-snap-align: start;
  }
}

/* ═══════════════════════════ REVIEW CARDS ═══════════════════════════ */
.review-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Review photo items */
#review-photos .review-photo-item {
  flex-shrink: 0;
  width: 8rem;
  height: 8rem;
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: center;
}
@media (min-width: 768px) {
  #review-photos .review-photo-item {
    width: 10rem;
    height: 10rem;
  }
}
#review-photos .review-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
#review-photos .review-photo-item:hover img {
  transform: scale(1.08);
}

/* ═══════════════════════════ MENU PREVIEW ═══════════════════════════ */
.menu-category ul li {
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed rgba(229, 213, 195, 0.5);
}
.menu-category ul li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ═══════════════════════════ CAROUSEL DOTS ═══════════════════════════ */
#dish-dots .dot {
  cursor: pointer;
}
#dish-dots .dot.active {
  background: #C8875C;
  width: 1.25rem;
  border-radius: 9999px;
}

/* ═══════════════════════════ MOBILE STICKY BAR ═══════════════════════════ */
#sticky-order {
  filter: drop-shadow(0 -4px 16px rgba(74, 55, 40, 0.10));
}
#sticky-order.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Add padding to body on mobile so content isn't hidden behind sticky bar */
@media (max-width: 767px) {
  body { padding-bottom: 80px; }
}

/* ═══════════════════════════ SELECTION & FOCUS ═══════════════════════════ */
::selection {
  background: rgba(200, 135, 92, 0.2);
  color: #4A3728;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid #C8875C;
  outline-offset: 2px;
  border-radius: 4px;
}
