/*--------------------------------------------------------------
# Header Styles - Aguas Bizzotto (Modern Architecture)
--------------------------------------------------------------*/

/* Base Header Styles */
.aguas-bizzotto-header {
    background: transparent;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    padding-top: 30px;
}

/* Header Container - CSS Grid Layout */
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr; /* Cambiar proporciones para centrar mejor */
    grid-template-areas: "logo nav cta";
    align-items: center;
    gap: 20px;
}

/* Logo/Branding */
.site-branding {
    grid-area: logo;
    justify-self: start; /* Alinear logo a la izquierda */
}

.logo-container .site-title {
    margin: 0;
    line-height: 1;
}

.logo-container .site-title a {
    text-decoration: none;
    display: block;
}

.custom-logo-image {
    height: 60px;
    width: auto;
    max-width: 200px;
    transition: all 0.3s ease;
}

/* Desktop Navigation */
.main-navigation {
    grid-area: nav;
    justify-self: center; /* Centrar navegación */
    width: 100%; /* Usar todo el ancho disponible */
}

.nav-menu {
    display: flex;
    justify-content: center; /* Centrar el menú dentro de su contenedor */
    width: 100%;
}

.primary-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 40px;
    justify-content: center; /* Centrar los elementos del menú */
}

.primary-menu-list a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 10px 0;
    transition: color 0.3s ease;
    position: relative;
}

.primary-menu-list a:hover {
    color: #f0f0f0;
}

.primary-menu-list a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffffff;
    transition: width 0.3s ease;
}

.primary-menu-list a:hover::after {
    width: 100%;
}

/* Desktop CTA Button */
.header-cta {
    grid-area: cta;
    justify-self: end; /* Alinear CTA a la derecha */
}

.panel-empresa-btn {
    background: #ffffff;
    color: #000000;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Alegreya', serif;
    transition: all 0.3s ease;
    border: 2px solid #ffffff;
}

.panel-empresa-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

/* Mobile Toggle Button */
.menu-toggle {
    grid-area: hamburger;
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 12px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    min-width: 44px; /* Área mínima de toque recomendada */
    min-height: 44px;
    position: relative;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block; /* Forzar display block */
    opacity: 1; /* Forzar opacidad */
    transform: translateZ(0); /* Forzar aceleración por hardware */
}

/* Animación del hamburger cuando se abre */
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    padding: 80px 20px 20px;
    height: 100vh;
    overflow-y: auto;
}

.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
}

.mobile-menu-list li {
    margin-bottom: 20px;
}

.mobile-menu-list a {
    color: #333333;
    text-decoration: none;
    font-size: 24px;
    font-weight: 600;
    padding: 15px 20px;
    display: block;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-menu-list a:hover {
    background: rgba(0, 102, 204, 0.1);
    color: #0066cc;
}

.mobile-cta {
    margin-top: 40px;
    text-align: center;
}

.panel-empresa-btn.mobile {
    background: #0066cc;
    color: #ffffff;
    border-color: #0066cc;
    display: inline-block;
    padding: 15px 30px;
    font-size: 16px;
}

/* Utility Classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Header Scroll Effect */
.aguas-bizzotto-header.scrolled {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(224, 224, 224, 0.8);
    padding-top: 0;
}

.aguas-bizzotto-header.scrolled .header-container {
    padding: 12px 20px;
}

.aguas-bizzotto-header.scrolled .custom-logo-image {
    height: 45px;
}

.aguas-bizzotto-header.scrolled .primary-menu-list a {
    color: #333333;
}

.aguas-bizzotto-header.scrolled .primary-menu-list a:hover {
    color: #0066cc;
}

.aguas-bizzotto-header.scrolled .primary-menu-list a::after {
    background: #0066cc;
}

.aguas-bizzotto-header.scrolled .panel-empresa-btn {
    background: #0066cc;
    color: #ffffff;
    border-color: #0066cc;
}

/* Hamburger en modo scrolled - cambiar a negro */
.aguas-bizzotto-header.scrolled .hamburger-line {
    background: #333333;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .aguas-bizzotto-header {
        padding-top: 15px; /* Reducir padding superior en mobile */
    }
    
    .header-container {
        grid-template-columns: 1fr auto;
        grid-template-areas: "logo hamburger";
        padding: 15px 20px;
        align-items: center; /* Asegurar alineación vertical */
        min-height: 60px; /* Altura mínima consistente */
    }
    
    .main-navigation,
    .header-cta {
        display: none;
    }
    
    /* Logo en mobile - alineación perfecta */
    .site-branding {
        display: flex;
        align-items: center;
        height: 100%;
    }
    
    .logo-container {
        display: flex;
        align-items: center;
        height: 100%;
    }
    
    .logo-container .site-title {
        display: flex;
        align-items: center;
        margin: 0;
        line-height: 1;
    }
    
    .custom-logo-image {
        height: 50px;
        width: auto;
        vertical-align: middle; /* Asegurar alineación vertical */
    }
    
    /* Forzar que el hamburger se vea en mobile */
    .menu-toggle {
        display: flex !important;
        visibility: visible;
        opacity: 1;
        align-self: center; /* Centrar verticalmente */
        justify-self: end; /* Alinear a la derecha */
    }
    
    /* Asegurar que las líneas se vean */
    .hamburger-line {
        background: #ffffff !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* En modo scrolled, cambiar color de líneas en mobile */
    .aguas-bizzotto-header.scrolled .hamburger-line {
        background: #333333 !important;
    }
    
    /* Ajustes para modo scrolled en mobile */
    .aguas-bizzotto-header.scrolled {
        padding-top: 0;
    }
    
    .aguas-bizzotto-header.scrolled .header-container {
        padding: 10px 20px;
        min-height: 50px;
    }
    
    .aguas-bizzotto-header.scrolled .custom-logo-image {
        height: 40px;
    }
    
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
}