/* ===============================================
   MODERN MENU MOBILE - Drawer / panel lateral
   ===============================================
   Sustituye al acordeon generico "mean-menu" en movil por un panel
   deslizante (off-canvas) con overlay, buscador de categorias y
   acordeon de un nivel. Fichero nuevo e independiente (no toca
   modern-menu.css, que sigue gobernando el menu de escritorio): se
   activa por cliente desde _HeadComun.cshtml / _PieScriptsComun.cshtml,
   igual que fimsa-mega-menu.css. El arbol de categorias no se duplica:
   el JS (modern-menu-mobile.js) lo lee directamente del menu de
   escritorio ya renderizado (#mnuWeb), que sigue intacto. */

/* El acordeon "mean-menu" de base deja de usarse en los clientes que
   activan este fichero; se oculta por completo en vez de dejarlo
   ocupando espacio o interfiriendo con el nuevo boton. */
.mobile-menu-wrapper,
#mnuMobile {
    display: none !important;
}

/* Botón que sustituye a la casilla que insertaba meanmenu. Vive dentro
   de .navigation-menu-area (fondo degradado ya definido en
   modern-menu.css), a la izquierda de la barra. */
.mmm-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    color: #fff;
    -webkit-user-select: none;
    user-select: none;
}

.mmm-bar:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .8);
    outline-offset: -2px;
}

.mmm-bar__icon {
    position: relative;
    width: 22px;
    height: 16px;
    flex-shrink: 0;
}

.mmm-bar__icon span,
.mmm-bar__icon span::before,
.mmm-bar__icon span::after {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: #fff;
}

.mmm-bar__icon span {
    top: 7px;
}

.mmm-bar__icon span::before {
    content: '';
    top: -7px;
}

.mmm-bar__icon span::after {
    content: '';
    top: 7px;
}

.mmm-bar__label {
    font-size: 15px;
    font-weight: 700;
}

@media (max-width: 991px) {
    .mmm-bar {
        display: flex;
    }
}

/* Overlay oscuro tras el panel */
.mmm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 20, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 1199;
}

.mmm-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Panel lateral */
.mmm-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    height: 100dvh;
    width: 86%;
    max-width: 360px;
    background: var(--colorFondo, #fff);
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mmm-drawer.is-open {
    transform: translateX(0);
}

body.mmm-open {
    overflow: hidden;
}

.mmm-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    background: linear-gradient(135deg, var(--colorCorporativo, #d92d1e) 0%, var(--colorCorporativoOscuro, #a01f14) 100%);
    color: #fff;
    flex-shrink: 0;
}

.mmm-drawer__title {
    font-size: 17px;
    font-weight: 800;
    margin: 0;
    letter-spacing: .2px;
}

.mmm-drawer__close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color .2s ease;
}

.mmm-drawer__close:hover {
    background: rgba(255, 255, 255, .32);
}

.mmm-drawer__search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 16px;
    padding: 4px 4px 4px 14px;
    background: #f2f3f5;
    border: 1.5px solid #e5e6ea;
    border-radius: 999px;
    flex-shrink: 0;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.mmm-drawer__search:focus-within {
    border-color: var(--colorCorporativo, #d92d1e);
    box-shadow: 0 0 0 3px rgba(var(--colorCorporativoRGB, 217, 45, 30), .15);
}

.mmm-drawer__search i {
    color: #9aa0ac;
    font-size: 15px;
    flex-shrink: 0;
}

.mmm-drawer__search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    padding: 9px 4px;
    color: #222;
}

.mmm-drawer__search-clear {
    border: none;
    background: transparent;
    color: #9aa0ac;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mmm-drawer__search-clear.is-visible {
    display: flex;
}

.mmm-drawer__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 24px;
}

.mmm-drawer__section-title {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #9aa0ac;
    padding: 16px 18px 6px;
    margin: 0;
}

.mmm-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mmm-list>li {
    border-bottom: 1px solid #f0f0f2;
}

.mmm-list a.mmm-link {
    display: block;
    padding: 13px 18px;
    font-size: 14.5px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.mmm-list a.mmm-link:hover,
.mmm-list a.mmm-link:active {
    color: var(--colorCorporativo, #d92d1e);
    background: #fafafa;
}

.mmm-row {
    display: flex;
    align-items: stretch;
}

.mmm-row>a.mmm-link {
    flex: 1;
    min-width: 0;
}

.mmm-expand {
    width: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-left: 1px solid #f0f0f2;
    cursor: pointer;
    color: #9aa0ac;
}

.mmm-expand svg {
    width: 14px;
    height: 14px;
    transition: transform .25s ease, color .25s ease;
}

.mmm-item--parent.is-open>.mmm-row .mmm-expand svg {
    transform: rotate(180deg);
    color: var(--colorCorporativo, #d92d1e);
}

.mmm-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    background: #fafafa;
    transition: max-height .3s ease;
}

.mmm-item--parent.is-open>.mmm-sublist {
    max-height: 2000px;
}

.mmm-sublist a.mmm-link {
    padding: 11px 18px 11px 34px;
    font-size: 13.5px;
    font-weight: 500;
    color: #555;
    border-bottom: 1px solid #eee;
}

.mmm-sublist>li:last-child a.mmm-link {
    border-bottom: none;
}

.mmm-empty {
    padding: 30px 18px;
    text-align: center;
    color: #9aa0ac;
    font-size: 13.5px;
    margin: 0;
}

/* Salvaguarda: en escritorio nunca debe verse nada de esto, aunque el
   boton se construya dinamicamente por JS. */
@media (min-width: 992px) {

    .mmm-overlay,
    .mmm-drawer,
    .mmm-bar {
        display: none !important;
    }
}
