/* Bauernhof — custom styles */

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

body {
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #FAF6F0;
}
::-webkit-scrollbar-thumb {
    background: #D4BCA6;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #C17859;
}

/* Navigation link underline animation */
.nav-link::after {
    content: '';
    display: block;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
    margin-top: 2px;
}
.nav-link:hover::after {
    width: 100%;
}

/* Product items */
.product-item {
    transition: background-color 0.3s ease;
}
.product-item:hover {
    background: rgba(193, 120, 89, 0.03);
}
.product-item:first-child {
    border-top: none;
    padding-top: 0;
}

/* Mobile menu */
#mobile-menu {
    transition: opacity 0.3s ease;
}
#mobile-menu.open {
    pointer-events: all;
    opacity: 1;
}
#mobile-menu.closed {
    pointer-events: none;
    opacity: 0;
}
.mobile-nav-link {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}
#mobile-menu.open .mobile-nav-link {
    opacity: 1;
    transform: translateY(0);
}
#mobile-menu.open .mobile-nav-link:nth-child(1) { transition-delay: 0.05s; }
#mobile-menu.open .mobile-nav-link:nth-child(2) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-nav-link:nth-child(3) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-nav-link:nth-child(4) { transition-delay: 0.2s; }

/* Hamburger animation */
.hamburger-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}
#menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
#menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}
#menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    width: 1.25rem;
}

/* Scroll reveal animations — progressive enhancement */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.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; }

/* Image hover */
.group img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.group:hover img {
    transform: scale(1.03);
}

/* Input autofill override for dark section */
#contact input:-webkit-autofill,
#contact input:-webkit-autofill:hover,
#contact input:-webkit-autofill:focus,
#contact textarea:-webkit-autofill,
#contact textarea:-webkit-autofill:hover,
#contact textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: #F5F0EB;
    -webkit-box-shadow: 0 0 0px 1000px #1C1917 inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* Focus visible */
*:focus-visible {
    outline: 2px solid #C17859;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .group img { transition: none; }
    .hamburger-line { transition: none; }
    .nav-link::after { transition: none; }
    .mobile-nav-link {
        opacity: 1;
        transform: none;
        transition: color 0.3s ease;
    }
}
