/*
Theme Name:   Maxcare Child
Theme URI:    https://maxcare.casethemes.net/
Description:  Tema hijo para personalizar Maxcare con un mega menú avanzado.
Author:       Tu Nombre
Author URI:   https://tuweb.com
Template:     maxcare
Version:      4.3.2
*/

/* ========================================================================
   1. ESTILOS BASE Y DE CABECERA
   ======================================================================== */
.header-inner-wrap { 
    display: flex; justify-content: space-between; align-items: center; 
    min-height: 90px; width: 100%; 
}
.pxl-header-child-custom { 
    position: relative; z-index: 1000; background-color: #fff;
    border-bottom: 1px solid #eaeaea;
}

/* ========================================================================
   2. MENÚ MÓVIL (Estilos aplicados hasta 991px)
   ======================================================================== */
.desktop-navigation-wrap { display: none; }
.mobile-menu-trigger {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    width: 30px; height: 30px; cursor: pointer; background-color: transparent; border: none; gap: 5px;
}
.mobile-menu-trigger span {
    display: block; width: 24px; height: 2px; background-color: var(--link-color, #000137);
    transition: transform 0.3s ease, opacity 0.3s ease; border-radius: 2px;
}
body.mobile-menu-open .mobile-menu-trigger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.mobile-menu-open .mobile-menu-trigger span:nth-child(2) { opacity: 0; }
body.mobile-menu-open .mobile-menu-trigger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu-sidebar { 
    position: fixed; top: 0; left: 0; width: 300px; max-width: 80%; height: 100%; 
    background-color: #121212; z-index: 10001; transition: transform 0.4s ease; 
    padding: 20px; box-shadow: 0 0 20px rgba(0,0,0,0.2); overflow-y: auto; 
    transform: translateX(-100%);
}
.mobile-menu-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.6); z-index: 10000; opacity: 0; 
    visibility: hidden; transition: opacity 0.4s ease, visibility 0s 0.4s; 
}
body.mobile-menu-open .mobile-menu-sidebar { transform: translateX(0); }
body.mobile-menu-open .mobile-menu-overlay { opacity: 1; visibility: visible; transition: opacity 0.4s ease; }

.mobile-menu-header { display: flex; justify-content: flex-end; margin-bottom: 25px; }
.mobile-menu-close { font-size: 40px; color: #fff; cursor: pointer; line-height: 1; }

.mobile-menu, .mobile-menu .sub-menu { list-style: none; padding-left: 0; margin-left: 0; }
.mobile-menu li.menu-item-has-children { position: relative; }
.mobile-menu li a {
    display: block; padding: 15px 10px; font-size: 16px; font-weight: 500; 
    color: #f0f0f0; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.2s, background-color 0.2s;
}
.mobile-menu li a:hover { color: #fff; background-color: rgba(255, 255, 255, 0.05); }

.mobile-menu .sub-menu { display: none; background-color: rgba(0, 0, 0, 0.2); }
.mobile-menu .sub-menu > li > a { padding-left: 25px; font-size: 15px; color: #ccc; }
.mobile-menu .sub-menu .sub-menu > li > a { padding-left: 40px; background-color: rgba(0, 0, 0, 0.15); }

.mobile-menu a.has-arrow { position: relative; padding-right: 50px; }
.mobile-menu a.has-arrow::after {
    content: ''; position: absolute; top: 50%; right: 20px;
    width: 8px; height: 8px; border-style: solid; border-color: #fff;
    border-width: 0 2px 2px 0; transform: translateY(-50%) rotate(45deg); transition: transform 0.3s ease;
}
.mobile-menu li.open > a.has-arrow::after { transform: translateY(-50%) rotate(-135deg); }
.mobile-menu .submenu-toggle { display: none; }

/* ========================================================================
   MENÚ DE ESCRITORIO (992px en adelante)
   ======================================================================== */
@media (min-width: 992px) {
    .desktop-navigation-wrap { 
        display: flex; 
        flex-grow: 1;
        justify-content: center;
    }
    .mobile-menu-trigger, .mobile-menu-sidebar, .mobile-menu-overlay { 
        display: none !important; 
    }

    /* <-- CORRECCIÓN FINAL: Evita que el contenedor del logo se expanda --> */
    .pxl-header-branding {
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .main-menu { list-style: none; padding: 0; margin: 0; display: flex; }
    .main-menu > li { position: relative; }
    
    .main-menu > li > a { 
        display: block; padding: 0 20px; line-height: 90px; text-transform: capitalize; 
        font-weight: 600; font-size: 16px; font-family: 'Archivo', sans-serif;
        color: var(--link-color, #000137); text-decoration: none; transition: color 0.3s ease; 
    }
    .main-menu > li > a:hover,
    .main-menu > li.current-menu-item > a,
    .main-menu > li.current-menu-ancestor > a { 
        color: var(--primary-color, #00B4D8); 
    }

    .main-menu > li > .mega-menu-container { 
        position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px);
        width: clamp(800px, 70vw, 1100px); 
        height: 450px; 
        background-color: #fff; 
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.09);
        padding: 30px; 
        border-radius: 0 0 8px 8px; 
        border-top: 2px solid var(--primary-color, #00B4D8);
        display: grid; 
        grid-template-columns: 3fr 3fr 2fr; 
        gap: 30px; 
        opacity: 0; visibility: hidden; pointer-events: none; 
        transition: opacity 0.3s ease, visibility 0s 0.3s, transform 0.3s ease;
        align-items: start;
    }
    
    .main-menu > li:hover > .mega-menu-container { 
        opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .mega-menu-image-col {
        height: 100%;
        overflow: hidden;
        border-radius: 8px;
    }
    .mega-menu-image-col img { 
        width: 100%; 
        height: 100%; 
        object-fit: cover; 
        background-color: #f0f0f0; 
    }
    
    .mega-menu-column ul { list-style: none; padding: 0; margin: 0; }
    
    .mega-menu-nav-col, .mega-menu-content-col {
        display: flex;
        flex-direction: column;
        height: calc(450px - 60px);
        overflow: hidden;
    }
    .mega-menu-scroll-wrapper {
        flex-grow: 1;
        overflow-y: auto;
        padding-right: 10px;
    }
    
    .mega-menu-scroll-wrapper::-webkit-scrollbar { width: 4px; }
    .mega-menu-scroll-wrapper::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px;}
    .mega-menu-scroll-wrapper::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px;}
    .mega-menu-scroll-wrapper::-webkit-scrollbar-thumb:hover { background: #aaa; }

    .mega-menu-nav-col ul li a { 
        display: block; padding: 12px 18px; color: var(--link-color, #000137); 
        text-decoration: none; border-radius: 5px; transition: all 0.3s ease; 
        font-weight: 500; position: relative;
    }
    
    .mega-menu-nav-col ul li.active > a, 
    .mega-menu-nav-col ul li a:hover { 
        background-color: rgba(0, 180, 216, 0.05);
        color: var(--primary-color, #00B4D8); 
        padding-left: 28px;
    }

    .mega-menu-nav-col ul li a::before {
        content: ''; position: absolute; left: 18px; top: 50%;
        transform: translateY(-50%) scaleX(0); width: 10px; height: 1px;
        background-color: var(--primary-color, #00B4D8);
        transform-origin: left; transition: transform 0.3s ease, opacity 0.3s ease;
        opacity: 0;
    }
    
    .mega-menu-nav-col ul li.active > a::before, 
    .mega-menu-nav-col ul li a:hover::before {
        transform: translateY(-50%) scaleX(1);
        opacity: 1;
    }
    
    .mega-menu-content-col { 
        border-left: 1px solid #f0f0f0; 
        padding-left: 30px; 
    }
    
    .mega-menu-content-col:empty {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mega-menu-content-col:empty::before {
        content: 'Selecciona nuestros mejores servicios médicos para diseñar una experiencia de recuperación personalizada.';
        color: #aaa; font-style: italic; font-size: 14px;
        text-align: center; padding: 0 20px; 
    }
    
    .mega-menu-content-col ul li a { 
        display: block; padding: 8px 15px; color: var(--secondary-color, #686877); 
        font-size: 0.9em; text-decoration: none; border-radius: 5px; transition: all 0.2s ease;
    }
    .mega-menu-content-col ul li a:hover { color: var(--primary-color, #00B4D8); background-color: #f7f7f7; }
    
    .mega-menu-nav-col .sub-menu-nivel3 { display: none; }
}
/* ========================================================================
   3. ESTILOS DEL BOTÓN DE CABECERA
   ======================================================================== */
.header-button-wrap-mobile { display: block; margin-bottom: 25px; }
.pxl-header-button.btn {
    background-color: var(--primary-color, #00B4D8); color: #fff; border-radius: 50px;
    font-weight: 600; font-size: 15px; text-transform: capitalize; white-space: nowrap;
    transition: background-color 0.3s ease, transform 0.3s ease; display: inline-flex;
    align-items: center; justify-content: center; padding: 1px 28px !important; 
}
.pxl-header-button.btn:hover {
    background-color: var(--link-color, #000137); color: #fff; transform: translateY(-2px);
}

@media (max-width: 991px) {
    .header-button-wrap { display: none; }
    .header-button-wrap-mobile .pxl-header-button.btn { display: block; width: 100%; text-align: center; }
    .mobile-menu-trigger { margin-left: auto; }
}

@media (min-width: 992px) {
    .header-button-wrap-mobile { display: none; }
    .header-button-wrap { display: block; }
    .header-inner-wrap { gap: 20px; }
}


