/* ===== Custom Styles for Baxter Bi-Rite ===== */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #fdf9f0;
}
::-webkit-scrollbar-thumb {
  background: #065f46;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #047857;
}

/* Selection */
::selection {
  background: #065f46;
  color: #fdf9f0;
}

/* Header scroll state */
#site-header.scrolled {
  box-shadow: 0 1px 20px rgba(6, 95, 70, 0.08);
}

/* Nav link underline animation */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #059669;
  transition: all 0.25s ease;
  transform: translateX(-50%);
}
.nav-link:hover::after {
  width: 60%;
}

/* Mobile link hover */
.mobile-link {
  position: relative;
}

/* Fade-in animation */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.fade-in-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.fade-in-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.fade-in-stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.fade-in-stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.fade-in-stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.fade-in-stagger.visible > *:nth-child(6) { transition-delay: 0.3s; }
.fade-in-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Product card image hover */
.group:hover .group-hover\:scale-105 {
  transform: scale(1.05);
}

/* Form focus ring animation */
input:focus,
textarea:focus {
  animation: focusRing 0.3s ease forwards;
}
@keyframes focusRing {
  from { box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1); }
  to   { box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.25); }
}

/* Pulse dot */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.animate-pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Mobile menu animation */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
#mobile-menu.open {
  max-height: 400px;
  padding: 0.5rem 0;
}

/* Counter animation */
.counter {
  display: inline-block;
}

/* Reduce 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; }
  .fade-in { opacity: 1; transform: none; }
  .fade-in-stagger > * { opacity: 1; transform: none; }
}
