/* Custom styles for Farmer's Market and Deli */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #faf7f2;
}
::-webkit-scrollbar-thumb {
    background: #d4ad55;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #c49038;
}

/* Selection */
::selection {
    background: #d45a2a;
    color: #fff;
}

/* Navbar */
#navbar {
    background: rgba(250, 247, 242, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(61, 43, 31, 0.06);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

#navbar.scrolled {
    background: rgba(250, 247, 242, 0.95);
    box-shadow: 0 4px 30px rgba(61, 43, 31, 0.08);
}

/* Nav Links */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #d45a2a;
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* Hero Badge Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}
.hero-badge {
    animation: float 3s ease-in-out infinite;
}

/* Marquee Animation */
@keyframes marquee {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}
.animate-marquee {
    animation: marquee 25s linear infinite;
}

/* Product Cards */
.product-card {
    transform: translateY(0);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.product-card:hover {
    transform: translateY(-8px);
}

/* Scroll Reveal (progressive enhancement - only applies when JS runs and reduced motion not preferred) */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
    .reveal-delay-5 { transition-delay: 0.5s; }
    .reveal-delay-6 { transition-delay: 0.6s; }
}

/* Mobile Menu */
#mobile-menu {
    box-shadow: none;
    transition: box-shadow 0.3s ease;
}
#mobile-menu.open {
    box-shadow: inset 0 -1px 0 rgba(61, 43, 31, 0.1);
}

.mobile-link {
    opacity: 1;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #d45a2a;
    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;
    }
    .animate-marquee {
        animation: none;
    }
}

/* Image lazy load fallback */
img[loading="lazy"] {
    transition: opacity 0.3s ease;
}
img[loading="lazy"].loaded {
    opacity: 1;
}
img[loading="lazy"] {
    opacity: 0;
}

/* Print styles */
@media print {
    #navbar, .animate-marquee, #mobile-menu {
        display: none;
    }
    body {
        background: white;
        color: black;
    }
    .product-card {
        break-inside: avoid;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) {
    .hero-badge {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Large desktop */
@media (min-width: 1280px) {
    .max-w-7xl {
        max-width: 80rem;
    }
}
