/* ===== Custom Styles for Tres Leches Deli and Bakery ===== */

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

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(58, 158, 142, 0.3);
    color: #f0f4f8;
}

/* ===== Hero Animations ===== */
.hero-subtitle {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
    transform: translateY(20px);
}

.hero-headline {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
    transform: translateY(30px);
}

.hero-body {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
    transform: translateY(20px);
}

.hero-cta {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.8s;
    opacity: 0;
    transform: translateY(20px);
}

.hero-image-wrapper {
    animation: fadeInScale 1s ease forwards;
    animation-delay: 0.5s;
    opacity: 0;
    transform: scale(0.95);
}

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

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Floating card animation */
.floating-card {
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

/* ===== Section Labels ===== */
.section-label {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Menu Cards ===== */
.menu-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.5s ease, background 0.5s ease;
}

.menu-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Gallery Images ===== */
.gallery-item {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery-item.visible {
    opacity: 1;
    transform: scale(1);
}

/* ===== Navbar ===== */
.nav-scrolled {
    background: rgba(6, 15, 25, 0.92) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(94, 191, 173, 0.08);
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.3);
}

.nav-scrolled .menu-line {
    background: #97d9c8 !important;
}

/* ===== Mobile Menu ===== */
.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: all !important;
}

.mobile-menu-open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.mobile-menu-open .menu-line:nth-child(2) {
    opacity: 0;
    transform: translateX(10px);
}

.mobile-menu-open .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 1.25rem;
}

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

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

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

/* ===== Scroll Reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    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; }

/* ===== Typography ===== */
.font-serif {
    font-weight: 500;
}

.font-serif em {
    font-style: italic;
}

/* ===== Custom scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #060f19;
}

::-webkit-scrollbar-thumb {
    background: rgba(58, 158, 142, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(58, 158, 142, 0.5);
}

/* ===== Responsive adjustments ===== */
@media (max-width: 768px) {
    .hero-headline {
        font-size: 3.5rem;
    }

    .floating-card {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 1rem;
        display: inline-block;
    }
}

@media (max-width: 640px) {
    .hero-headline {
        font-size: 2.75rem;
    }
}

/* ===== Focus visible for accessibility ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(94, 191, 173, 0.6);
    outline-offset: 2px;
}

/* ===== Reduced motion ===== */
@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;
    }

    .reveal,
    .menu-card,
    .gallery-item {
        opacity: 1;
        transform: none;
    }
}
