/*
Theme Name: Astra Child
Theme URI: https://wpastra.com/
Description: Tema hijo de Astra para Cafencia - protege tus plantillas personalizadas y activa el menú móvil global
Author: Cafencia
Author URI: https://rutacafe.cundicode.com
Template: astra
Version: 1.1.0
Text Domain: astra-child
*/

/* ==========================================================================
   1. RESET FULL-WIDTH Y CONTENEDOR DE ASTRA (CORRECCIÓN VISTA ESCRITORIO)
   ========================================================================== */
html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

#page,
.site,
.site-content,
.site-content > .ast-container,
#primary,
.site-main {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

#secondary {
    display: none !important;
}

/* Header de escritorio centrado correctamente sin recorte derecho */
.site-header .ast-container,
.ast-primary-header-bar .ast-container {
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    width: 100% !important;
}

.ast-single-post .site-main, .site-main { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
.entry-header, .ast-archive-description { display: none !important; }
.entry-content { margin: 0 !important; padding: 0 !important; }

/* ==========================================================================
   2. LOGO UNIVERSIDAD DE CUNDINAMARCA (Solo en Escritorio, a la derecha del menú)
   ========================================================================== */
.university-logo-header {
    display: none;
}

@media (min-width: 769px) {
    .university-logo-header {
        display: inline-flex !important;
        align-items: center !important;
        margin-left: 25px !important;
        margin-right: 0 !important;
        vertical-align: middle !important;
    }

    .university-logo-header img {
        max-height: 48px !important;
        width: auto !important;
        object-fit: contain !important;
        display: block !important;
    }

    .ast-primary-header-bar .ast-builder-grid-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
}

@media (max-width: 768px) {
    .university-logo-header,
    .logo-udec,
    .udec-logo {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ==========================================================================
   3. MENÚ MÓVIL GLOBAL (VISIBLE EN TODAS LAS PLANTILLAS Y PÁGINAS)
   ========================================================================== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 70px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 99999;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.mobile-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 100%;
    max-width: 100%;
}

.mobile-header-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
    display: block;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 28px;
    color: #8B4513;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
}

/* SIDE PANEL Y OVERLAY MÓVIL */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: white;
    z-index: 99999;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 25px;
    border-bottom: 2px solid #f0f0f0;
    background: #FAF6F0;
}

.mobile-menu-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-logo-container img {
    height: 38px;
    width: auto;
}

.mobile-menu-logo-text {
    font-size: 1.4rem;
    color: #8B4513;
    font-weight: 700;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 26px;
    color: #666;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.mobile-menu-items {
    padding: 15px 0;
    flex-grow: 1;
}

.mobile-menu-items a {
    display: block;
    padding: 14px 25px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s ease;
}

.mobile-menu-items a:hover,
.mobile-menu-items a:active {
    background: #FAF6F0;
    color: #8B4513;
    padding-left: 30px;
}

.has-submenu {
    position: relative;
}

.submenu-toggle::after {
    content: '▼';
    float: right;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.has-submenu.open .submenu-toggle::after {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    background: #f9f9f9;
}

.has-submenu.open .submenu {
    display: block;
}

.submenu a {
    padding: 12px 25px 12px 40px !important;
    font-size: 15px !important;
    border-bottom: 1px solid #eee !important;
}

/* ==========================================================================
   4. ACTIVACIÓN EN MÓVILES (PANTALLAS <= 921px - BREAKPOINT ASTRA)
   ========================================================================== */
@media (max-width: 921.99px) {
    /* Mostrar ÚNICAMENTE el header móvil oficial de Cafencia */
    .mobile-header {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 70px !important;
        z-index: 99999 !important;
    }

    /* OCULTAR COMPLETAMENTE el header original de Astra en móvil para evitar doble menú */
    #masthead,
    .site-header,
    #ast-mobile-header,
    #ast-desktop-header,
    #ast-mobile-popup-wrapper,
    .ast-mobile-header-wrap,
    .main-navigation,
    .ast-primary-header-bar,
    .ast-builder-grid-row,
    [data-section="section-header-mobile-trigger"],
    .menu-toggle,
    .ast-mobile-menu-trigger-outline,
    .rc-mobile-menu-toggle,
    .rc-mobile-menu,
    .rc-mobile-menu-overlay {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Dar margen superior para compensar el header fijo */
    body,
    .site-content,
    .content-area,
    .cafencia-hero,
    .marcas-hero,
    .silvania-hero,
    .fusagasuga-hero,
    .arbelaez-hero,
    .pasca-hero,
    .tibacuy-hero,
    .sanbernardo-hero,
    .hero-section,
    .fusa-page-wrapper {
        margin-top: 70px !important;
    }

    .marcas-hero,
    .fusa-hero {
        margin-top: 0 !important;
    }
}

