/* ===== BASE STYLES ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: #C4725A;
    color: white;
}

/* ===== HEADER ===== */
#header {
    background: transparent;
    transition: background 0.5s ease, box-shadow 0.5s ease, padding 0.5s ease;
}

#header.scrolled {
    background: rgba(253, 248, 243, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(196, 114, 90, 0.1);
    padding: 0;
}

#header.scrolled .font-serif {
    color: #8F4636 !important;
}

/* ===== MOBILE MENU ===== */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

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

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

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

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

/* Menu button animation */
#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 24px;
}

/* ===== HERO ANIMATIONS ===== */
.hero-subtitle {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.hero-title {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

.hero-desc {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.6s;
}

.hero-cta {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.8s;
}

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

/* ===== SCROLL INDICATOR ===== */
.scroll-line {
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ===== FEATURE ITEMS ===== */
.feature-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== MENU CARDS ===== */
.menu-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ===== GALLERY ===== */
.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);
}

/* ===== CONTACT INFO ===== */
.contact-info {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.contact-info.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: #C4725A;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease, background 0.3s ease;
    z-index: 40;
    box-shadow: 0 4px 20px rgba(196, 114, 90, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.back-to-top:hover {
    background: #B05945;
    transform: translateY(-3px);
}

/* ===== FORM STYLES ===== */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-bottom-color: #C4725A !important;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    transition: opacity 0.3s ease;
}

.form-group input:focus::placeholder,
.form-group textarea:focus::placeholder {
    opacity: 0.5;
}

/* ===== SECTION REVEAL ===== */
.section-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3.5rem !important;
    }

    #inicio .lg\:col-span-7 {
        text-align: center;
    }

    #inicio .lg\:col-start-8 {
        margin-top: 2rem;
    }

    #inicio img {
        height: 350px !important;
    }

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

    .about-img-grid {
        gap: 0.75rem !important;
    }

    .about-img-grid img {
        height: 180px !important;
    }

    .menu-card img {
        height: 200px !important;
    }

    .wine-section-img {
        height: 400px !important;
    }

    .gallery-item img {
        height: 150px !important;
    }

    .footer-grid {
        gap: 2.5rem !important;
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.75rem !important;
    }

    .section-title {
        font-size: 2.25rem !important;
    }

    .menu-card img {
        height: 160px !important;
    }

    .contact-form {
        padding: 1.5rem !important;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .hero-subtitle,
    .hero-title,
    .hero-desc,
    .hero-cta {
        opacity: 1;
        transform: none;
    }
}
