/* ==========================================================
   LOMISA · NAVEGACIÓN DE SECCIONES
   Productos · Servicios · Proyectos

   Menú superior: .nav-secciones
   Menú inferior: .nav-secciones-sub
   ========================================================== */

:root {
    --nav-section-navy: #052c59;
    --nav-section-dark: #062d59;
    --nav-section-cyan: var(--lm-color-accent);
    --nav-section-selected: #eef8fc;
}


/* ==========================================================
   1. ESTRUCTURA COMPARTIDA
   ========================================================== */

.nav-secciones,
.nav-secciones-sub {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.nav-secciones > .wp-block-group__inner-container,
.nav-secciones-sub > .wp-block-group__inner-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.nav-secciones .wp-block-navigation,
.nav-secciones-sub .wp-block-navigation {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.nav-secciones .wp-block-navigation__responsive-container,
.nav-secciones .wp-block-navigation__responsive-close,
.nav-secciones .wp-block-navigation__responsive-dialog,
.nav-secciones .wp-block-navigation__responsive-container-content,
.nav-secciones-sub .wp-block-navigation__responsive-container,
.nav-secciones-sub .wp-block-navigation__responsive-close,
.nav-secciones-sub .wp-block-navigation__responsive-dialog,
.nav-secciones-sub .wp-block-navigation__responsive-container-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.nav-secciones ul.wp-block-navigation__container,
.nav-secciones-sub ul.wp-block-navigation__container {
    display: grid;
    width: 100%;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-secciones .wp-block-navigation-item,
.nav-secciones-sub .wp-block-navigation-item {
    display: flex;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.nav-secciones .wp-block-navigation-item__content,
.nav-secciones-sub .wp-block-navigation-item__content {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    text-decoration: none;
}


/* ==========================================================
   2. MENÚ SUPERIOR · BARRA BLANCA
   ========================================================== */

.nav-secciones {
    background: #ffffff;
}

.nav-secciones ul.wp-block-navigation__container {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
}

.nav-secciones .wp-block-navigation-item__content {
    position: relative;
    min-height: 56px;
    padding: 10px 12px;
    gap: 17px;

    background: #ffffff;
    border-bottom: 2px solid transparent;

    color: var(--nav-section-navy);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;
    white-space: nowrap;

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

.nav-secciones .wp-block-navigation-item__label {
    color: inherit;
    font-weight: inherit;
}


/* ==========================================================
   3. ICONOS DEL MENÚ SUPERIOR

   Iconos asignados a las seis posiciones de Servicios.
   Para Productos y Proyectos podrán sustituirse
   mediante clases específicas.
   ========================================================== */

.nav-secciones .wp-block-navigation-item__content::before {
    content: "";
    display: block;
    flex: 0 0 23px;
    width: 23px;
    height: 23px;

    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* 1 · Compras y logística */

.nav-secciones .wp-block-navigation-item:nth-child(1)
.wp-block-navigation-item__content::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E");
}

/* 2 · Energía y eficiencia */

.nav-secciones .wp-block-navigation-item:nth-child(2)
.wp-block-navigation-item__content::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 4c-9 0-15 4-15 11a5 5 0 0 0 5 5c7 0 11-6 10-16Z'/%3E%3Cpath d='M4 21c3-6 7-10 14-14'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 4c-9 0-15 4-15 11a5 5 0 0 0 5 5c7 0 11-6 10-16Z'/%3E%3Cpath d='M4 21c3-6 7-10 14-14'/%3E%3C/svg%3E");
}

/* 3 · Infraestructuras */

.nav-secciones .wp-block-navigation-item:nth-child(3)
.wp-block-navigation-item__content::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2h4l1 3 3 1 3-1 2 4-2 2v3l2 2-2 4-3-1-3 1-1 3h-4l-1-3-3-1-3 1-2-4 2-2v-3L1 9l2-4 3 1 3-1Z'/%3E%3Ccircle cx='12' cy='12' r='3.5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2h4l1 3 3 1 3-1 2 4-2 2v3l2 2-2 4-3-1-3 1-1 3h-4l-1-3-3-1-3 1-2-4 2-2v-3L1 9l2-4 3 1 3-1Z'/%3E%3Ccircle cx='12' cy='12' r='3.5'/%3E%3C/svg%3E");
}

/* 4 · Electrónica y control */

.nav-secciones .wp-block-navigation-item:nth-child(4)
.wp-block-navigation-item__content::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Crect x='5' y='5' width='14' height='14' rx='1'/%3E%3Crect x='9' y='9' width='6' height='6'/%3E%3Cpath d='M9 1v4m6-4v4M9 19v4m6-4v4M1 9h4m-4 6h4m14-6h4m-4 6h4'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Crect x='5' y='5' width='14' height='14' rx='1'/%3E%3Crect x='9' y='9' width='6' height='6'/%3E%3Cpath d='M9 1v4m6-4v4M9 19v4m6-4v4M1 9h4m-4 6h4m14-6h4m-4 6h4'/%3E%3C/svg%3E");
}

/* 5 · Soluciones sanitarias */

.nav-secciones .wp-block-navigation-item:nth-child(5)
.wp-block-navigation-item__content::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8L12 21l8.8-8.6a5.5 5.5 0 0 0 0-7.8Z'/%3E%3Cpath d='M2 12h5l2-3 3 7 2-4h8'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8L12 21l8.8-8.6a5.5 5.5 0 0 0 0-7.8Z'/%3E%3Cpath d='M2 12h5l2-3 3 7 2-4h8'/%3E%3C/svg%3E");
}

/* 6 · Arquitectura */

.nav-secciones .wp-block-navigation-item:nth-child(6)
.wp-block-navigation-item__content::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='8' height='15'/%3E%3Crect x='11' y='3' width='10' height='19'/%3E%3Cpath d='M6 11h2m-2 4h2m-2 4h2m8-12h2m-2 4h2m-2 4h2m-2 4h2M1 22h22'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='8' height='15'/%3E%3Crect x='11' y='3' width='10' height='19'/%3E%3Cpath d='M6 11h2m-2 4h2m-2 4h2m-2 4h2m8-12h2m-2 4h2m-2 4h2m-2 4h2M1 22h22'/%3E%3C/svg%3E");
}


/* ==========================================================
   4. MENÚ SUPERIOR · HOVER Y SELECCIÓN
   ========================================================== */

.nav-secciones .wp-block-navigation-item__content:hover {
    background: #f4fafc;
    color: var(--nav-section-navy);
}

.nav-secciones
.wp-block-navigation-item__content[aria-current="page"],
.nav-secciones
.wp-block-navigation-item.current-menu-item
.wp-block-navigation-item__content,
.nav-secciones
.wp-block-navigation-item.current-menu-ancestor
.wp-block-navigation-item__content {
    background: var(--nav-section-selected);
    border-bottom-color: var(--nav-section-cyan);
    color: var(--nav-section-navy);
    font-weight: 700;
}


/* ==========================================================
   5. SUBMENÚ · BARRA AZUL OSCURO
   ========================================================== */

.nav-secciones-sub {
    background: var(--nav-section-dark);
}

/* SUBMENÚ · COLUMNAS AUTOMÁTICAS */

.nav-secciones-sub ul.wp-block-navigation__container {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    width: 100%;
    gap: 0;
}

.nav-secciones-sub .wp-block-navigation-item {
    position: relative;
}

/* Separadores cortos, centrados verticalmente */

.nav-secciones-sub .wp-block-navigation-item
+ .wp-block-navigation-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: rgba(255, 255, 255, .22);
    pointer-events: none;
}

.nav-secciones-sub .wp-block-navigation-item__content {
    min-height: 52px;
    padding: 12px 10px;

    background: transparent;
    color: #ffffff;

    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    white-space: nowrap;

    transition:
        color .2s ease,
        background .2s ease;
}

/* Forzar blanco en el span de Gutenberg */

.nav-secciones-sub
.wp-block-navigation-item__content,
.nav-secciones-sub
.wp-block-navigation-item__content:visited,
.nav-secciones-sub
.wp-block-navigation-item__label {
    color: #ffffff;
}

.nav-secciones-sub
.wp-block-navigation-item__content:hover,
.nav-secciones-sub
.wp-block-navigation-item__content:hover
.wp-block-navigation-item__label {
    color: var(--nav-section-cyan);
}

.nav-secciones-sub
.wp-block-navigation-item__content:hover {
    background: rgba(255, 255, 255, .035);
}

/* Selección del submenú */

.nav-secciones-sub
.wp-block-navigation-item__content[aria-current="location"],
.nav-secciones-sub
.wp-block-navigation-item__content[aria-current="page"],
.nav-secciones-sub
.wp-block-navigation-item__content[aria-current="location"]
.wp-block-navigation-item__label,
.nav-secciones-sub
.wp-block-navigation-item__content[aria-current="page"]
.wp-block-navigation-item__label,
.nav-secciones-sub
.wp-block-navigation-item.is-active
.wp-block-navigation-item__content,
.nav-secciones-sub
.wp-block-navigation-item.is-active
.wp-block-navigation-item__label {
    color: var(--nav-section-cyan);
    font-weight: 600;
}


/* ==========================================================
   6. TRANSICIÓN ENTRE AMBAS BARRAS
   ========================================================== */

.nav-secciones + .nav-secciones-sub {
    margin-top: 0;
}

.nav-secciones,
.nav-secciones-sub {
    border: 0;
    box-shadow: none;
}


/* ==========================================================
   7. TABLET
   ========================================================== */

@media (max-width: 1100px) {

    .nav-secciones .wp-block-navigation-item__content {
        gap: 9px;
        padding: 10px 7px;
        font-size: 12px;
    }

    .nav-secciones .wp-block-navigation-item__content::before {
        flex-basis: 19px;
        width: 19px;
        height: 19px;
    }

    .nav-secciones-sub
    .wp-block-navigation-item__content {
        font-size: 11px;
        padding: 10px 6px;
    }
}


/* ==========================================================
   8. MÓVIL
   Navegación horizontal desplazable
   ========================================================== */

@media (max-width: 767px) {

    .nav-secciones,
    .nav-secciones-sub {
        overflow: hidden;
    }

    /* Ocultamos únicamente las hamburguesas
       de estas dos barras, no la del header */

    .nav-secciones
    .wp-block-navigation__responsive-container-open,
    .nav-secciones-sub
    .wp-block-navigation__responsive-container-open {
        display: none !important;
    }

    /* Presentación horizontal de los enlaces */

    .nav-secciones
    .wp-block-navigation__responsive-container:not(.is-menu-open),
    .nav-secciones-sub
    .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: block !important;
        position: static !important;
        visibility: visible !important;
        width: 100%;
        height: auto;
        background: transparent;
    }

    .nav-secciones
    .wp-block-navigation__responsive-container-content,
    .nav-secciones-sub
    .wp-block-navigation__responsive-container-content {
        display: block;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-secciones
    .wp-block-navigation__responsive-container-content::-webkit-scrollbar,
    .nav-secciones-sub
    .wp-block-navigation__responsive-container-content::-webkit-scrollbar {
        display: none;
    }

    .nav-secciones ul.wp-block-navigation__container,
    .nav-secciones-sub ul.wp-block-navigation__container {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start;
        width: max-content;
        min-width: 100%;
    }

    .nav-secciones .wp-block-navigation-item {
        flex: 0 0 auto;
    }

    .nav-secciones .wp-block-navigation-item__content {
        min-height: 58px;
        padding: 12px 17px;
        gap: 9px;
        font-size: 12px;
    }

    .nav-secciones-sub .wp-block-navigation-item {
        flex: 0 0 auto;
    }

    .nav-secciones-sub .wp-block-navigation-item__content {
        min-height: 48px;
        padding: 12px 19px;
        font-size: 11px;
    }
}


/* ==========================================================
   9. ACCESIBILIDAD
   ========================================================== */

.nav-secciones a:focus-visible,
.nav-secciones-sub a:focus-visible {
    outline: 2px solid var(--nav-section-cyan);
    outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
    .nav-secciones a,
    .nav-secciones-sub a {
        transition: none;
    }
}





/* Paneles de servicios - PC */

@media (min-width: 769px) {

    body.lm-service-tabs-ready .lm-service-panel {
        display: none;
    }

    body.lm-service-tabs-ready .lm-service-panel.is-active {
        display: block;
    }

}