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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    overflow-x: hidden;
}

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

/* ===== Scroll Reveal (progressive enhancement) ===== */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(32px);
        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; }
}

/* ===== Mobile Menu Transitions ===== */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}

/* ===== Header Scroll State ===== */
#site-header.scrolled {
    box-shadow: 0 1px 20px rgba(27, 67, 50, 0.08);
}

/* ===== Custom Selection ===== */
::selection {
    background-color: #52B788;
    color: #1B4332;
}

/* ===== Focus Styles ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #52B788;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== Smooth Image Loading ===== */
img {
    background-color: #F5EFE0;
}

/* ===== Mobile Menu Button Animation ===== */
#menu-btn[aria-expanded="true"] #bar1 {
    transform: translateY(3.5px) rotate(45deg);
}

#menu-btn[aria-expanded="true"] #bar2 {
    opacity: 0;
    transform: scaleX(0);
}

#menu-btn[aria-expanded="true"] #bar3 {
    transform: translateY(-3.5px) rotate(-45deg);
    width: 1.5rem;
}

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

/* ===== Subtle Pattern for Sections ===== */
.section-pattern {
    background-image: radial-gradient(circle, rgba(27, 67, 50, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #FAF6EE;
}

::-webkit-scrollbar-thumb {
    background: #aed0b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7fb88f;
}

/* ===== Image Aspect Ratio Helpers ===== */
.aspect-card {
    aspect-ratio: 4 / 3;
}

/* ===== Mobile Link Hover ===== */
.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #52B788;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.mobile-link:hover::after {
    width: 100%;
}

/* ===== Footer Link Hover ===== */
footer a:hover {
    color: #D5E6DB;
}

/* ===== 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;
    }
}
