/* ============================================
   Panaderia Y Pasteleria Ahtziri
   Custom Styles & Animations
   ============================================ */

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

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

/* --- Selection Color --- */
::selection {
    background-color: #9cc59e;
    color: #1d3622;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #F5F2EB;
}
::-webkit-scrollbar-thumb {
    background: #9cc59e;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6fa370;
}

/* --- Hero Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-anim {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-anim:nth-child(1) { animation-delay: 0.1s; }
.hero-anim:nth-child(2) { animation-delay: 0.3s; }
.hero-anim:nth-child(3) { animation-delay: 0.5s; }
.hero-anim:nth-child(4) { animation-delay: 0.7s; }
.hero-anim:nth-child(5) { animation-delay: 0.9s; }

/* --- Scroll Reveal --- */
.reveal {
    opacity: 1;
    transform: translateY(0);
    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="hidden"] {
    opacity: 0;
    transform: translateY(40px);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(40px);
    }
}

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

#navbar.scrolled {
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

#navbar.scrolled .font-serif,
#navbar.scrolled span {
    color: #1d3622 !important;
}

#navbar.scrolled .text-forest-600 {
    color: #2c5133 !important;
}

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

.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s 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; }

/* --- Image Hover --- */
.rounded-2xl.overflow-hidden {
    will-change: transform;
}

/* --- Button Focus States --- */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #4d8252;
    outline-offset: 2px;
}

/* --- Form Inputs --- */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(77, 130, 82, 0.15);
}

/* --- Smooth Image Loading --- */
img {
    loading: lazy;
}

/* --- Print Styles --- */
@media print {
    #navbar, #mobileMenu, .reveal { display: none; }
    body { background: white; color: black; }
    a { color: black; text-decoration: underline; }
}
