/* ===== Xela Panadería & Restaurante — Custom Styles ===== */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FAF5EC;
}
::-webkit-scrollbar-thumb {
    background: #1B4332;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2d6e2d;
}

/* --- Selection --- */
::selection {
    background: #D4A373;
    color: #1B4332;
}

/* --- Hero Blobs Animation --- */
@keyframes blob-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}
@keyframes blob-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-25px, 15px) scale(1.08); }
    66% { transform: translate(15px, -25px) scale(0.92); }
}
@keyframes blob-float-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, 25px) scale(1.06); }
    66% { transform: translate(-15px, -15px) scale(0.94); }
}
@keyframes blob-float-4 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-15px, -20px) scale(1.04); }
    66% { transform: translate(20px, 10px) scale(0.96); }
}

.hero-blob {
    animation: blob-float-1 12s ease-in-out infinite;
}
.blob-2 { animation: blob-float-2 15s ease-in-out infinite; }
.blob-3 { animation: blob-float-3 10s ease-in-out infinite; }
.blob-4 { animation: blob-float-4 13s ease-in-out infinite; }

/* --- Scroll Reveal (progressive enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(32px);
        transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 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; }
    .reveal-delay-4 { transition-delay: 0.4s; }
}

/* --- Gallery Items --- */
.gallery-item {
    aspect-ratio: 1 / 1;
}
.gallery-item:nth-child(2),
.gallery-item:nth-child(7) {
    aspect-ratio: 4 / 5;
}

/* --- Navbar Scroll State --- */
#navbar.scrolled {
    background: rgba(253, 251, 247, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(27, 67, 50, 0.08), 0 4px 20px rgba(27, 67, 50, 0.06);
}

/* --- Mobile Menu Transition --- */
#mobile-menu {
    animation: slideDown 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Form Styles --- */
input:focus, textarea:focus {
    outline: none;
    border-color: #D4A373;
    box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.2);
}

/* --- Success Message --- */
.form-success {
    animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive Tweaks --- */
@media (max-width: 640px) {
    .font-serif {
        word-spacing: -0.02em;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}
