/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(var(--header-height) + 25px); /* Aumenta la altura total del fondo */
    padding-top: 22px; /* Empuja todo el contenido hacia abajo alejándolo del borde */
    z-index: 999;
    transition: background-color var(--transition-fast), color var(--transition-fast), border-bottom var(--transition-fast);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Estados del Header */
.site-header.is-transparent {
    background-color: transparent;
    color: var(--color-white);
    border-bottom: 1px solid transparent;
}

.site-header.is-solid {
    background-color: var(--color-white);
    color: var(--color-black);
    border-bottom: 1px solid var(--color-border);
}

/* Típoografía Logo y Menú */
.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.header-menu-list {
    display: flex;
    gap: 2rem;
}

.header-menu-list a {
    font-size: 18px;
    font-weight: 700;
}
@media (max-width: 992px) {
    .header-menu-list a {
        font-size: 15.2px;
    }
}

.header-menu-list a:hover {
    opacity: 0.7;
}

/* Acciones (Buscar, Idioma) */
.header-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
}

/* Buscador Modal Overlay */
.dhema-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dhema-search-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-inner {
    position: relative;
    width: 100%;
    max-width: 800px;
    padding: 0 2rem;
}

.close-search-btn {
    position: absolute;
    top: -50px;
    right: 2rem;
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color 0.3s ease;
}

.close-search-btn:hover {
    color: var(--color-black);
}

.search-overlay-form {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--color-black);
    padding-bottom: 1rem;
}

.search-overlay-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 600;
    color: var(--color-black);
    outline: none;
}

.search-overlay-input::placeholder {
    color: #ccc;
}

.search-overlay-submit {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-black);
    padding-left: 1rem;
}

.search-overlay-submit svg {
    width: 40px;
    height: 40px;
}

  /* ==========================================================================
    FOOTER
   ========================================================================== */
   
.site-footer {
    background-color: var(--color-footer-bg);
    color: var(--color-white);
    padding: 3rem 0;
    font-size: 0.85rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.social-circle:hover {
    background-color: var(--color-white);
    color: var(--color-footer-bg);
    border-color: var(--color-white);
}

.footer-menu-list {
    display: flex;
    gap: 1.5rem;
}

.footer-menu-list a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   GLOBAL MOBILE MENU (Full Screen Overlay)
   ========================================================================== */
.mobile-menu-top, 
.mobile-menu-bottom, 
.menu-toggle-btn {
    display: none;
}

@media (max-width: 992px) {
    /* Devuelve el header a su tamaño original en móviles (o ajusta los píxeles aquí) */
    .site-header {
        height: var(--header-height);
        padding-top: 0;
    }

    #masthead .desktop-only { 
        display: none; 
    }
    
    #masthead .menu-toggle-btn { 
        display: flex; 
        background: none; 
        border: none; 
        color: var(--color-black); 
        cursor: pointer; 
        padding: 0.5rem;
        z-index: 1000;
    }

    .header-nav {
        position: fixed;
        top: 0;
        left: -100%; 
        width: 100%;
        height: 100vh;
        background-color: var(--color-white);
        z-index: 9999;
        display: flex;
        flex-direction: column;
        padding: 2rem;
        transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        overflow-y: auto;
    }

    .header-nav.is-open {
        left: 0;
    }

    .mobile-menu-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 3rem;
    }

    .menu-close-btn {
        background: none;
        border: none;
        font-size: 1rem;
        font-weight: 500;
        color: var(--color-black);
        cursor: pointer;
        padding: 0;
    }

    .header-menu-list {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .header-menu-list li {
        width: 100%;
        border-bottom: 1px solid #e0e0e0;
    }

    .header-menu-list li a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 1.2rem 0; /* Reducido */
        font-size: 1.6rem; /* Reducido para que no se corte en pantallas pequeñas */
        font-weight: 500;
        letter-spacing: -0.5px;
        color: var(--color-black);
        text-decoration: none;
    }

    .header-menu-list li a::after {
        content: "›";
        font-size: 2.2rem;
        font-weight: 300;
        color: var(--color-black);
        line-height: 1;
    }

    .mobile-menu-bottom {
        display: block;
        margin-top: 2rem;
        padding-bottom: 2rem;
        border-top: 1px solid #e0e0e0;
        padding-top: 1.5rem;
    }
}

/* ==========================================================================
   GLOBAL FOOTER (Mobile Compacto)
   ========================================================================== */
@media (max-width: 768px) {
    .site-footer {
        padding: 2rem 0 1rem 0; /* Reduce drásticamente el espacio exterior */
    }

    .footer-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.2rem; /* Espacio muy reducido entre copyright, iconos y links */
        padding: 0 1rem;
    }

    .footer-copy p {
        margin: 0;
        font-size: 0.85rem;
    }

    .footer-social {
        display: flex;
        gap: 0.8rem; /* Iconos más juntos */
        justify-content: center;
    }

    .footer-menu-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem; /* Enlaces legales más juntos */
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .footer-menu-list li a {
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   GLOBAL CALL TO ACTION (CTA)
   ========================================================================== */
.home-cta {
    padding: 5rem 0;
    text-align: center;
    background-color: #f7f7f7;
}

.cta-title {
    font-size: clamp(2rem, 3vw, 2.5rem);
    margin-bottom: 0.5rem;
    color: var(--color-black);
}

.cta-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.btn-outline {
    display: inline-block;
    padding: 1rem 3rem;
    border: 1px solid var(--color-black);
    border-radius: 30px;
    font-weight: 500;
    color: var(--color-black);
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-outline:hover {
    background-color: var(--color-black);
    color: var(--color-white);
}

/* Ajuste móvil para el CTA */
@media (max-width: 768px) {
    .home-cta {
        padding: 4rem 1.5rem; 
    }
    
    .cta-title {
        font-size: 1.8rem;
    }
}

/* ==========================================================================
   BOTÓN FLOTANTE WHATSAPP
   ========================================================================== */
.dhema-whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background-color: #25d366; /* Verde oficial */
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Resplandor verde difuminado exacto al diseño */
    box-shadow: 0 0 25px rgba(37, 211, 102, 0.6); 
    z-index: 9999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dhema-whatsapp-float:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
}

.dhema-whatsapp-float svg {
    width: 32px;
    height: 32px;
}

@media (max-width: 768px) {
    .dhema-whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    .dhema-whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}

/* ==========================================================================
   DHEMA LOGO PERSONALIZADO (Límites de Escala Dinámicos)
   ========================================================================== */
/* Logo cambia a blanco cuando el header es transparente */
.site-header.is-transparent .dhema-custom-logo {
    filter: brightness(0) invert(1);
}

.dhema-custom-logo {
    display: block;
    max-width: 270px;
    max-height: 58px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: all 0.3s ease;
}

.dhema-custom-logo-mobile {
    display: block;
    max-width: 200px;
    max-height: 48px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Responsivo para Tablets y Móviles (Ajuste de Cabecera) */
@media (max-width: 992px) {
    .dhema-custom-logo {
        max-width: 200px;
        max-height: 40px;
    }
}

@media (max-width: 768px) {
    .dhema-custom-logo {
        max-width: 150px;
        max-height: 35px;
    }
}