/* Custom styles for K & M Cellars */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf8f5;
}
::-webkit-scrollbar-thumb {
    background: #f6a5b8;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #dc4466;
}

/* Selection color */
::selection {
    background: #fce7eb;
    color: #6f1d37;
}

/* Mobile menu animation */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

body.menu-open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

body.menu-open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
body.menu-open .mobile-link:nth-child(2) { transition-delay: 0.2s; }
body.menu-open .mobile-link:nth-child(3) { transition-delay: 0.3s; }
body.menu-open .mobile-link:nth-child(4) { transition-delay: 0.4s; }

/* Hamburger animation */
#menuIcon line {
    transition: transform 0.4s ease, opacity 0.3s ease;
    transform-origin: center;
}

body.menu-open #menuIcon line:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}
body.menu-open #menuIcon line:nth-child(2) {
    opacity: 0;
}
body.menu-open #menuIcon line:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

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

/* Reduced motion - ensure content is always visible */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* Image loading placeholder */
img {
    background: linear-gradient(135deg, #fce7eb 0%, #faf0ef 100%);
}

/* Subtle grain texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Navbar glass effect */
#navbar.scrolled {
    background: rgba(254, 252, 251, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(161, 26, 61, 0.08), 0 4px 20px rgba(161, 26, 61, 0.06);
}

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

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid #dc4466;
    outline-offset: 2px;
    border-radius: 4px;
}
