/* --- GLOBAL STYLES --- */
body.overflow-hidden {
    overflow: hidden;
}

/* --- PRELOADER --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.preloader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 150px;
    height: 150px;
}

.preloader-bar {
    width: 12px;
    height: 80px;
    margin: 0 4px;
    background-color: #ac112a;
    animation: preloader-anim 1.2s infinite ease-in-out;
}

.preloader-bar:nth-child(1) {
    animation-delay: -1.1s;
    background-color: #810a1e;
}

.preloader-bar:nth-child(2) {
    animation-delay: -1.0s;
    background-color: #ac112a;
}

.preloader-bar:nth-child(3) {
    animation-delay: -0.9s;
    background-color: #e0773a;
}

.preloader-bar:nth-child(4) {
    animation-delay: -0.8s;
    background-color: #f59b2e;
}

.preloader-bar:nth-child(5) {
    animation-delay: -0.7s;
    background-color: #b33d22;
}

@keyframes preloader-anim {
    0%, 40%, 100% {
        transform: scaleY(0.4);
    }
    20% {
        transform: scaleY(1.0);
    }
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* --- NAVBAR & MENU --- */
#main-nav {
    padding: 1.25rem 1rem !important; /* Más padding vertical para el logo grande */
    min-height: 80px; /* Altura mínima para el navbar */
}

.logo-light {
    max-width: none !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.logo-light:hover {
    transform: scale(1.05);
}

/* Asegurar que el logo se vea grande en móvil */
@media (max-width: 767px) {
    .logo-light {
        min-height: 64px !important; /* h-16 - 4rem */
        max-height: 80px !important;
    }
    
    #main-nav {
        padding: 1rem !important;
        min-height: 90px;
        height: auto;
    }
    
    /* Asegurar espacio suficiente para el header en móvil */
    body {
        padding-top: 0 !important;
    }
    
    section:first-of-type,
    header:first-of-type {
        margin-top: 0 !important;
    }
}

/* Logo mediano en tablets */
@media (min-width: 768px) and (max-width: 1023px) {
    .logo-light {
        min-height: 80px !important; /* h-20 - 5rem */
        max-height: 100px !important;
    }
    
    #main-nav {
        min-height: 100px;
        height: auto;
    }
}

/* Logo grande en desktop */
@media (min-width: 1024px) {
    .logo-light {
        min-height: 96px !important; /* h-24 - 6rem */
        max-height: 120px !important;
    }
    
    #main-nav {
        padding: 1.5rem 1rem !important;
        min-height: 120px;
        height: auto;
    }
}

#main-nav a.active {
    color: #FBBF24; /* yellow-400 */
    font-weight: bold;
}

#hamburger-button span {
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

#hamburger-button.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#hamburger-button.active span:nth-child(2) {
    opacity: 0;
}

#hamburger-button.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 1023px) {
    #mobile-menu {
        position: fixed;
        top: 90px; /* Ajustado para el logo más grande */
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #111827; /* bg-gray-900 */
        transform: translateX(100%);
        transition: transform 0.5s ease-in-out;
        overflow-y: auto;
        padding: 1rem;
        z-index: 40;
    }

    #mobile-menu.active {
        transform: translateX(0);
    }
}

@media (min-width: 1024px) {
    #mobile-menu {
        display: flex !important;
    }
}