/* ============================================
   The Crave Factory — Custom Styles
   Premium Dark Luxury | Charcoal + Coral + Gold
   ============================================ */

/* --- Reset & Base --- */
*, *::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;
}

::selection {
    background: rgba(212, 160, 87, 0.3);
    color: #f5f5f5;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
    background: #2d2d2d;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* --- Navbar --- */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(212, 160, 87, 0.08);
}

/* --- Mobile Menu --- */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.close {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

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

#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* --- Menu Button --- */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}
#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}
#menuBtn.active .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    width: 1.25rem;
}

/* --- Scroll Indicator Animation --- */
@keyframes scrollIndicator {
    0% { top: -12px; opacity: 1; }
    100% { top: 28px; opacity: 0; }
}

.animate-scroll-indicator {
    animation: scrollIndicator 1.5s ease-out infinite;
}

/* --- Section Reveal Animations (progressive enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

    .reveal[data-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[data-reveal="left"] {
        transform: translateX(-30px);
    }

    .reveal[data-reveal="right"] {
        transform: translateX(30px);
    }

    .reveal.visible[data-reveal] {
        opacity: 1;
        transform: translate(0, 0);
    }
}

/* --- Product Card Hover Glow --- */
.group:hover .group-hover\:scale-105 {
    will-change: transform;
}

/* --- Button Focus States --- */
a:focus-visible, button:focus-visible {
    outline: 2px solid rgba(212, 160, 87, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Image Loading --- */
img {
    display: block;
    max-width: 100%;
}

/* --- Smooth anchor offset for fixed nav --- */
section[id] {
    scroll-margin-top: 80px;
}

/* --- Gold shimmer on hover for special elements --- */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* --- Responsive adjustments --- */
@media (max-width: 767px) {
    html {
        scroll-behavior: smooth;
    }

    section[id] {
        scroll-margin-top: 60px;
    }
}
