/* ─── Custom Styles for Artesanía Rancho Tío Manuel ─── */

/* Base */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Navigation ─── */
#site-header {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#site-header.scrolled {
    background: rgba(11, 26, 26, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #c9a96e;
    transition: width 0.3s ease;
}

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

/* Mobile menu button animation */
#menu-btn.active #bar1 {
    transform: translateY(4px) rotate(45deg);
}

#menu-btn.active #bar2 {
    opacity: 0;
    transform: scaleX(0);
}

#menu-btn.active #bar3 {
    transform: translateY(-4px) rotate(-45deg);
}

#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

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

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

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

/* ─── Hero Animations ─── */
.hero-element {
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-element:nth-child(1) { animation-delay: 0.2s; }
.hero-element:nth-child(2) { animation-delay: 0.4s; }
.hero-element:nth-child(3) { animation-delay: 0.6s; }
.hero-element:nth-child(4) { animation-delay: 0.8s; }

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Scroll Reveal ─── */
.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.revealed:nth-child(2) { transition-delay: 0.1s; }
.reveal.revealed:nth-child(3) { transition-delay: 0.2s; }

/* ─── Scroll Gallery ─── */
@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-scroll {
    animation: scroll 30s linear infinite;
}

.animate-scroll:hover {
    animation-play-state: paused;
}

/* ─── Selection ─── */
::selection {
    background: rgba(26, 95, 95, 0.2);
    color: #1a5f5f;
}

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

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #4a9a9a;
}

/* ─── Responsive ─── */
@media (max-width: 767px) {
    .hero-element {
        animation-duration: 0.6s;
    }
}
