/* ============================================
   Nashville Nutrition — Custom Styles
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0f0f1a;
}
::-webkit-scrollbar-thumb {
  background: #841632;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a11633;
}

/* ---------- Selection ---------- */
::selection {
  background: rgba(132, 22, 50, 0.3);
  color: inherit;
}

/* ---------- Navbar Scroll State ---------- */
#navbar.scrolled {
  background: rgba(15, 15, 26, 0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}

#navbar.scrolled .menu-line {
  background: #fff;
}

/* ---------- Hero Animations ---------- */
.hero-anim {
  opacity: 0;
  transform: translateY(30px);
  animation: heroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-anim:nth-child(1) { animation-delay: 0.1s; }
.hero-anim:nth-child(2) { animation-delay: 0.25s; }
.hero-anim:nth-child(3) { animation-delay: 0.4s; }
.hero-anim:nth-child(4) { animation-delay: 0.55s; }

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Reveal Animations (below-fold) ---------- */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.reveal-grid > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-grid.revealed > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-grid.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-grid.revealed > *:nth-child(3) { transition-delay: 0.15s; }
.reveal-grid.revealed > *:nth-child(4) { transition-delay: 0.2s; }

.reveal-grid.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Mobile Menu ---------- */
#mobileMenu.open {
  max-height: 400px;
  opacity: 1;
}

#mobileMenu .mobile-link {
  display: block;
  padding: 0.5rem 0;
}

/* ---------- Mobile Menu Button X State ---------- */
#menuBtn.active .menu-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
#menuBtn.active .menu-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#menuBtn.active .menu-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  width: 5rem;
}

/* ---------- Product Card Hover Image Tilt ---------- */
.group:hover .group-hover\:scale-105 {
  transform: scale(1.05);
}

/* ---------- Smooth Focus ---------- */
:focus-visible {
  outline: 2px solid #841632;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .reveal, .reveal-grid > * {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Print ---------- */
@media print {
  #navbar, #mobileMenu, .reveal { display: none; }
  body { background: #fff; color: #000; }
}
