.cabecera-menu-zona {
    min-width: 0;
}

.menu-principal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.menu-item {
    position: relative;
}


/* =========================================================
   ENLACES PRINCIPALES
========================================================= */

.menu-enlace {
    min-height: 42px;
    padding: 0 11px;
    border: 0;
    border-radius: 9px;

    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: var(--cabecera-texto);
    background: transparent;

    font-size: var(--cabecera-menu-texto, 16px);
    font-weight: 800;

    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;

    transition:
        color .15s ease,
        background .15s ease,
        border-color .15s ease;
}

.menu-enlace > svg:not(.menu-flecha) {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;

    fill: none;
    stroke: currentColor;
}

.menu-enlace:hover,
.menu-item.abierto > .menu-enlace {
    color: var(--cabecera-hover);
    background: #f3f6f8;
}

.menu-flecha {
    width: 14px;
    height: 14px;

    margin-left: auto;

    transition: transform .16s ease;
}

.menu-item.abierto > .menu-enlace .menu-flecha {
    transform: rotate(180deg);
}


/* =========================================================
   PANEL DESKTOP
========================================================= */

.menu-panel {
    position: fixed;

    top: calc(var(--cabecera-altura, 68px) + 10px);
    left: 50vw;

    z-index: 1400;

    width: min(760px, calc(100vw - 24px));
    max-height: calc(100dvh - var(--cabecera-altura, 68px) - 24px);

    overflow-x: hidden;
    overflow-y: auto;

    padding: 14px;

    border: 1px solid #dce5ed;
    border-radius: 17px;

    background: #ffffff;

    box-shadow: 0 22px 55px rgba(16, 42, 67, .14);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translate(-50%, 8px);

    overscroll-behavior: contain;

    transition:
        opacity .16s ease,
        visibility .16s ease,
        transform .16s ease;
}

.menu-item.abierto > .menu-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: translate(-50%, 0);
}

.menu-panel-servicios {
    width: min(850px, calc(100vw - 24px));
}

.menu-panel-facturacion,
.menu-panel-empleos,
.menu-panel-blog {
    width: min(760px, calc(100vw - 24px));
}


/* =========================================================
   CABECERA MEGA MENU
========================================================= */

.menu-mega-cabecera {
    padding: 4px 5px 12px;
    margin-bottom: 8px;

    border-bottom: 1px solid #e9eef3;
}

.menu-mega-etiqueta {
    display: block;

    color: #16804a;

    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;

    text-transform: uppercase;
}

.menu-mega-cabecera strong {
    display: block;

    margin-top: 5px;

    color: #102a43;

    font-size: 15px;
}

.menu-mega-cabecera small {
    display: block;

    margin-top: 3px;

    color: #748598;

    font-size: 11px;
}


/* =========================================================
   GRIDS
========================================================= */

.menu-mega-grid {
    display: grid;
    gap: 7px;
}

.menu-mega-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.menu-mega-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.menu-mega-grid-servicios {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}


/* =========================================================
   TARJETAS
========================================================= */

.menu-mega-card {
    min-width: 0;
    min-height: 72px;

    padding: 10px;

    border: 1px solid transparent;
    border-radius: 12px;

    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;

    color: #172033;
    background: #ffffff;

    text-decoration: none;

    transition:
        color .16s ease,
        background .16s ease,
        border-color .16s ease,
        transform .16s ease,
        box-shadow .16s ease;
}

.menu-mega-card-servicio {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: 72px;
}


/* =========================================================
   ICONOS
========================================================= */

.menu-mega-icono {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border: 1px solid #eed5db;
    border-radius: 10px;

    color: #6b1e2e;
    background: #f8ecef;

    line-height: 0;

    transition:
        color .16s ease,
        background .16s ease,
        border-color .16s ease,
        transform .16s ease;
}

.menu-mega-icono svg {
    display: block;

    width: 21px;
    height: 21px;

    fill: none;
    stroke: currentColor;
}

.menu-mega-icono svg * {
    vector-effect: non-scaling-stroke;
}


/* =========================================================
   TEXTOS
========================================================= */

.menu-mega-texto {
    min-width: 0;
}

.menu-mega-texto strong,
.menu-mega-texto small {
    display: block;

    transition: color .16s ease;
}

.menu-mega-texto strong {
    color: #172033;

    font-size: 12.5px;
    line-height: 1.25;
}

.menu-mega-texto small {
    margin-top: 3px;

    color: #738497;

    font-size: 10.5px;
    line-height: 1.35;
}


/* =========================================================
   FLECHA
========================================================= */

.menu-mega-flecha {
    color: #6b1e2e;

    font-size: 15px;

    opacity: 0;

    transform: translateX(-4px);

    transition:
        color .16s ease,
        opacity .16s ease,
        transform .16s ease;
}


/* =========================================================
   HOVER
========================================================= */

.menu-mega-card:hover,
.menu-mega-card:focus-visible {
    border-color: var(--cuenta-fondo, #6b1e2e);

    color: #ffffff;
    background: var(--cuenta-fondo, #6b1e2e);

    box-shadow: 0 10px 24px rgba(107, 30, 46, .20);

    transform: translateY(-1px);

    outline: none;
}

.menu-mega-card:hover .menu-mega-texto strong,
.menu-mega-card:hover .menu-mega-texto small,
.menu-mega-card:focus-visible .menu-mega-texto strong,
.menu-mega-card:focus-visible .menu-mega-texto small {
    color: #ffffff;
}

.menu-mega-card:hover .menu-mega-icono,
.menu-mega-card:focus-visible .menu-mega-icono {
    color: #ffffff;

    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .32);

    transform: scale(1.03);
}

.menu-mega-card:hover .menu-mega-icono svg,
.menu-mega-card:focus-visible .menu-mega-icono svg {
    color: #ffffff;
    stroke: currentColor;
}

.menu-mega-card:hover .menu-mega-flecha,
.menu-mega-card:focus-visible .menu-mega-flecha {
    color: #ffffff;

    opacity: 1;

    transform: translateX(0);
}


/* =========================================================
   VACÍO
========================================================= */

.menu-mega-vacio {
    grid-column: 1 / -1;

    padding: 14px;

    border-radius: 10px;

    color: #7a8998;
    background: #f8fafc;

    font-size: 11px;
}


/* =========================================================
   TABLETS
========================================================= */

@media (max-width: 1080px) {

    .menu-enlace {
        padding: 0 8px;
        font-size: 14px;
    }

    .menu-enlace > svg:not(.menu-flecha) {
        width: 16px;
        height: 16px;

        flex-basis: 16px;
    }

    .menu-panel {
        width: min(720px, calc(100vw - 20px));
    }

    .menu-panel-servicios {
        width: min(820px, calc(100vw - 20px));
    }
}


/* =========================================================
   MÓVIL - COMPACTO TIPO CASA GREEN
========================================================= */

@media (max-width: 980px) {

    .cabecera-menu-zona {
        position: static;

        width: auto;
        min-width: 0;

        display: flex;
        align-items: center;
        justify-content: flex-end;

        overflow: visible;

        opacity: 1;
        visibility: visible;

        transform: none;
    }


    /* =====================================================
       PANEL PRINCIPAL
       YA NO OCUPA TODA LA PANTALLA
    ===================================================== */

    .menu-principal {
        position: fixed;

        top: calc(var(--cabecera-altura, 66px) + 6px);
        right: 10px;
        left: 10px;

        z-index: 1350;

        width: auto;
        height: auto;

        max-height: calc(
            100dvh - var(--cabecera-altura, 66px) - 16px
        );

        padding: 8px;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 4px;

        overflow-x: hidden;
        overflow-y: auto;

        color: #172033;
        background: #ffffff;

        border: 1px solid #e0e7e4;
        border-radius: 14px;

        box-shadow:
            0 18px 45px rgba(15, 23, 42, .16);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transform: translateY(-8px);

        overscroll-behavior: contain;

        transition:
            opacity .18s ease,
            visibility .18s ease,
            transform .18s ease;
    }

    .cabecera-sitio.menu-movil-abierto
    .menu-principal {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform: translateY(0);
    }


    /* =====================================================
       OPCIONES PRINCIPALES
    ===================================================== */

    .menu-item {
        position: relative;

        width: 100%;
    }

    .menu-enlace {
        width: 100%;
        min-height: 44px;

        padding: 0 11px;

        justify-content: flex-start;

        gap: 9px;

        border: 1px solid #e2e9e6;
        border-radius: 9px;

        color: #172033;
        background: #f7faf8;

        font-size: 13px;
        font-weight: 800;

        text-align: left;
    }

    .menu-enlace:hover,
    .menu-item.abierto > .menu-enlace {
        color: #166534;

        background: #eef7f1;

        border-color: #c8ddd0;
    }

    .menu-enlace > svg:not(.menu-flecha) {
        width: 18px;
        height: 18px;

        flex: 0 0 18px;

        margin: 0;
    }

    .menu-enlace > span {
        flex: 1;
    }

    .menu-flecha {
        width: 13px;
        height: 13px;

        margin-left: auto;
    }


    /* =====================================================
       SUBMENÚ
    ===================================================== */

    .menu-panel,
    .menu-panel-servicios,
    .menu-panel-facturacion,
    .menu-panel-empleos,
    .menu-panel-blog {
        position: static;

        width: 100%;
        max-width: none;
        max-height: 0;

        margin: 0;
        padding: 0;

        overflow: hidden;

        border: 0;
        border-radius: 9px;

        background: #ffffff;

        box-shadow: none;

        opacity: 1;
        visibility: visible;

        pointer-events: auto;

        transform: none;

        transition:
            max-height .24s ease,
            padding .24s ease,
            margin .24s ease,
            border-color .24s ease;
    }

    .menu-item.abierto > .menu-panel {
        width: 100%;

        max-height: 460px;

        margin: 3px 0 2px;

        padding: 4px;

        overflow-x: hidden;
        overflow-y: auto;

        border: 1px solid #e5ebe8;

        transform: none;
    }


    /* CABECERA GRANDE NO SE USA EN CELULAR */

    .menu-mega-cabecera {
        display: none;
    }


    /* UNA SOLA COLUMNA */

    .menu-mega-grid,
    .menu-mega-grid-2,
    .menu-mega-grid-3,
    .menu-mega-grid-servicios {
        grid-template-columns: 1fr;

        gap: 2px;
    }


    /* =====================================================
       TARJETAS SUBMENÚ
       MUCHO MÁS COMPACTAS
    ===================================================== */

    .menu-mega-card,
    .menu-mega-card-servicio {
        min-height: 44px;

        padding: 5px 7px;

        grid-template-columns:
            32px minmax(0, 1fr) auto;

        gap: 8px;

        border: 1px solid transparent;
        border-radius: 8px;

        background: #ffffff;
    }

    .menu-mega-card:hover,
    .menu-mega-card:focus-visible {
        color: #ffffff;

        background: var(--cuenta-fondo, #6b1e2e);

        border-color: var(--cuenta-fondo, #6b1e2e);

        transform: none;

        box-shadow: none;
    }


    /* =====================================================
       ICONOS SUBMENÚ
    ===================================================== */

    .menu-mega-icono {
        width: 30px;
        height: 30px;

        border-radius: 7px;
    }

    .menu-mega-icono svg {
        width: 15px;
        height: 15px;
    }


    /* =====================================================
       TEXTO SUBMENÚ
    ===================================================== */

    .menu-mega-texto strong {
        font-size: 11px;
        line-height: 1.2;
    }

    /*
     * En celular quitamos las descripciones.
     * Igual que Casa Green: opción limpia y directa.
     */
    .menu-mega-texto small {
        display: none;
    }


    /* FLECHA */

    .menu-mega-flecha {
        font-size: 13px;

        opacity: .85;

        transform: none;
    }

    .menu-mega-card:hover .menu-mega-flecha,
    .menu-mega-card:focus-visible .menu-mega-flecha {
        transform: none;
    }


    /* VACÍO */

    .menu-mega-vacio {
        padding: 9px;

        border: 1px solid #e4ebe8;

        background: #f8faf9;

        font-size: 10.5px;
    }
}


/* =========================================================
   TELÉFONOS
========================================================= */

@media (max-width: 560px) {

    .menu-principal {
        top: calc(var(--cabecera-altura, 66px) + 5px);

        right: 7px;
        left: 7px;

        max-height:
            calc(100dvh - var(--cabecera-altura, 66px) - 12px);

        padding: 6px;

        gap: 3px;

        border-radius: 12px;
    }

    .menu-enlace {
        min-height: 42px;

        padding: 0 10px;

        font-size: 12.5px;

        border-radius: 8px;
    }

    .menu-item.abierto > .menu-panel {
        max-height: 430px;

        padding: 3px;
    }

    .menu-mega-card,
    .menu-mega-card-servicio {
        min-height: 42px;

        padding: 4px 6px;

        grid-template-columns:
            30px minmax(0, 1fr) auto;

        gap: 7px;
    }

    .menu-mega-icono {
        width: 28px;
        height: 28px;

        border-radius: 7px;
    }

    .menu-mega-icono svg {
        width: 14px;
        height: 14px;
    }

    .menu-mega-texto strong {
        font-size: 10.5px;
    }
}