/* ==========================================================================
   ps_multimegamenu — Frontend CSS
   Arquitectura separada para Desktop y Mobile
   ========================================================================== */

/* ──────────────────────────────────────────────────────────────────────────
 * 1. DESKTOP MEGA MENU (Grid + Hover)
 * ──────────────────────────────────────────────────────────────────────── */
.ps-mmenu-desktop {
    position: relative;
    z-index: 100;
    width: 100%;
    background: #1c343c;
    border-bottom: 1px solid #1c343c;
    font-family: inherit;
}

.ps-mmenu-list {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ps-mmenu-item {
    position: relative;
    /* Para posicionar el dropdown si no es full-width, 
                           pero en megamenús suele ser static si se quiere al 100% */
}

/* Enlaces principales (Nivel 1) */
.ps-mmenu-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.ps-mmenu-item:hover>.ps-mmenu-link {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.3);
}

.ps-mmenu-caret {
    font-size: 16px;
    margin-left: 4px;
    color: #999;
    transition: transform 0.2s;
}

.ps-mmenu-item:hover>.ps-mmenu-link .ps-mmenu-caret {
    transform: rotate(180deg);
    color: #009ed6;
}

/* Contenedor Dropdown */
.ps-mmenu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    min-width: 800px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-radius: 0 0 8px 8px;
    border: 1px solid #eee;
    border-top: 2px solid #009ed6;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.ps-mmenu-item:hover .ps-mmenu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Alineación inteligente para los últimos 3 elementos para evitar que se salgan por la derecha de la pantalla */
.ps-mmenu-list .ps-mmenu-item:nth-last-child(-n+3) .ps-mmenu-dropdown {
    left: auto;
    right: 0;
}

/* Grid del Dropdown */
.ps-mmenu-dropdown-inner {
    display: flex;
    flex-wrap: wrap;
    padding: 25px;
    gap: 20px;
}

.ps-mmenu-col {
    flex: 1;
    min-width: 150px;
}

.ps-mmenu-col-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #222;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    text-transform: uppercase;
}

.m-toggle.ps-mmenu-toggle .m-toggle-title,
.m-toggle.ps-mmenu-toggle i {
    color: #FFF;
}

.ps-mmenu-col-title:hover {
    color: #069ad4;
}

.ps-mmenu-sublist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ps-mmenu-sublist li {
    margin-bottom: 6px;
}

.ps-mmenu-sublist a {
    color: #666;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
}

.ps-mmenu-sublist a:hover {
    color: #009ed6;
    padding-left: 4px;
}

/* ──────────────────────────────────────────────────────────────────────────
 * 2. MOBILE MEGA MENU (Off-Canvas + Accordion)
 * ──────────────────────────────────────────────────────────────────────── */
.ps-mmenu-mobile {
    font-family: inherit;
    display: block;
}

/* Botón Hamburguesa */
.ps-mmenu-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #333;
}

.ps-mmenu-toggle i {
    font-size: 28px;
}

.ps-mmenu-toggle .m-toggle-title {
    margin-left: 8px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

/* Overlay Oscuro Premium */
.ps-mmenu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
    /* Efecto cristal premium */
}

.ps-mmenu-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Panel Off-Canvas Premium */
.ps-mmenu-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -340px;
    width: 340px;
    max-width: 85vw;
    background: #ffffff;
    z-index: 9999;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.ps-mmenu-drawer.is-active {
    transform: translateX(340px);
}

/* Cabecera del Drawer */
.ps-mmenu-drawer-header {
    background: #1c343c;
    color: #ffffff;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.ps-mmenu-drawer-header .mbmenu-title {
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
}

.ps-mmenu-close {
    cursor: pointer;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s, transform 0.2s;
}

.ps-mmenu-close:hover {
    color: #ffffff;
    transform: rotate(90deg);
}

/* Acordeón */
.ps-mmenu-accordion {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    background: #fdfdfd;
}

/* Ocultar barra de scroll en navegadores webkit */
.ps-mmenu-accordion::-webkit-scrollbar {
    width: 6px;
}

.ps-mmenu-accordion::-webkit-scrollbar-thumb {
    background-color: #cccccc;
    border-radius: 4px;
}

.ps-mmenu-acc-item,
.ps-mmenu-acc-subitem {
    border-bottom: 1px solid #f0f0f0;
}

.ps-mmenu-acc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    transition: background 0.2s;
}

.ps-mmenu-acc-item.is-expanded>.ps-mmenu-acc-header {
    background: #f4f6f8;
}

.ps-mmenu-acc-link {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    color: #222222;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    flex-grow: 1;
    position: relative;
    z-index: 5;
    transition: color 0.3s ease;
}

.ps-mmenu-acc-link:hover {
    color: #009ed6;
}

.ps-mmenu-acc-link.fw-bold {
    font-weight: 600;
    text-transform: uppercase;
}

/* Toggle (+) más ancho y fácil de clicar, con diseño premium */
.ps-mmenu-acc-toggle {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #eaeaea;
    cursor: pointer;
    color: #1c343c;
    font-size: 22px;
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
    background: #ffffff;
}

.ps-mmenu-acc-toggle:hover {
    background: #f0f4f6;
    color: #009ed6;
}

.ps-mmenu-acc-toggle i {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ps-mmenu-acc-item.is-expanded>.ps-mmenu-acc-header .ps-mmenu-acc-toggle i,
.ps-mmenu-acc-subitem.is-expanded>.ps-mmenu-acc-header .ps-mmenu-acc-toggle i {
    transform: rotate(180deg) scale(1.1);
    color: #009ed6;
}

/* Panel Desplegable (Oculto por defecto) */
.ps-mmenu-acc-panel {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f8f9fa;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: block !important;
}

.ps-mmenu-acc-item.is-expanded>.ps-mmenu-acc-panel,
.ps-mmenu-acc-subitem.is-expanded>.ps-mmenu-acc-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Nivel 3 - Enlaces finales */
.ps-mmenu-acc-subitem>.ps-mmenu-acc-header {
    padding-left: 16px;
    background: transparent;
}

.ps-mmenu-acc-link-leaf {
    display: block;
    padding: 14px 24px 14px 40px;
    color: #444444;
    font-size: 14px;
    text-decoration: none;
    border-bottom: 1px dashed #eeeeee;
}

.ps-mmenu-acc-link-leaf:last-child {
    border-bottom: none;
}

.ps-mmenu-acc-link-leaf:hover {
    color: #1c343c;
    background: #f0f4f6;
}

/* Utility Classes para breakpoints estándar de PS/Bootstrap 4 */
@media (min-width: 992px) {
    .hidden-lg-up {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .hidden-md-down {
        display: none !important;
    }
}

#header .mbmenu-title {
    background-color: #1c343c !important;
}