﻿/* ============================================
   nav.css - Megamenu oposiciones
   ZBrain Oposiciones
   BEM namespace: lp-opo-nav*
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --opo-primary: var(--color-primary);
    --opo-primary-hover: #d94044;
    --opo-primary-light: #fef2f2;
    --opo-dark: var(--color-bg-dark);
    --opo-dark-medium: #2d3748;
    --opo-gray-100: var(--color-bg-soft);
    --opo-gray-200: var(--color-border);
    --opo-gray-500: var(--color-text-muted);
    --opo-gray-700: #495057;
    --opo-white: #ffffff;
    --opo-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --opo-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
    --opo-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --opo-nav-height: 70px;
    --opo-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   lp-opo-NAV: Main navigation bar
   ============================================ */
.lp-opo-nav {
    position: sticky;
    top: 0;
    z-index: 1040;
    background-color: var(--opo-white);
    transition: box-shadow var(--opo-transition);
    height: var(--opo-nav-height);
    display: flex;
    align-items: center;
}

.lp-opo-nav--scrolled {
    box-shadow: var(--opo-shadow-md);
}

.lp-opo-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

/* --- Logo --- */
.lp-opo-nav__logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.lp-opo-nav__logo-img {
    height: 34px;
    width: auto;
    /* Sanidad usa formacionsanidad.svg, que ya viene con los colores
       corporativos correctos — no aplicamos filter de recoloreado. */
    filter: none;
}

.lp-opo-nav__logo-img:hover {
    filter: none;
    opacity: 0.9;
}

/* --- Desktop menu items --- */
.lp-opo-nav__menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 0.25rem;
    height: 100%;
}

.lp-opo-nav__item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.lp-opo-nav__link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--opo-dark);
    text-decoration: none;
    position: relative;
    transition: color var(--opo-transition);
    white-space: nowrap;
    height: 100%;
}

.lp-opo-nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--opo-primary);
    border-radius: 3px 3px 0 0;
    transition: width var(--opo-transition), left var(--opo-transition);
}

.lp-opo-nav__link:hover,
.lp-opo-nav__link:focus {
    color: var(--opo-primary);
}

.lp-opo-nav__link:hover::after,
.lp-opo-nav__link:focus::after,
.lp-opo-nav__item--active .lp-opo-nav__link::after {
    width: 100%;
    left: 0;
}

.lp-opo-nav__link-chevron {
    font-size: 0.625rem;
    transition: transform var(--opo-transition);
}

.lp-opo-nav__item--open .lp-opo-nav__link-chevron {
    transform: rotate(180deg);
}

/* --- Desktop Actions (CTA + phone) --- */
.lp-opo-nav__actions {
    display: none;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.lp-opo-nav__phone {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--opo-gray-700);
    text-decoration: none;
    transition: color var(--opo-transition);
}

.lp-opo-nav__phone:hover {
    color: var(--opo-primary);
}

.lp-opo-nav__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    background-color: var(--opo-primary);
    color: var(--opo-white);
    font-size: 0.9375rem;
    font-weight: 600;
    border: 2px solid var(--opo-primary);
    border-radius: 50px;
    text-decoration: none;
    transition: background-color var(--opo-transition), transform 0.2s ease, box-shadow var(--opo-transition);
    cursor: pointer;
    white-space: nowrap;
}

.lp-opo-nav__cta:hover,
.lp-opo-nav__cta:focus {
    background-color: var(--opo-primary-hover);
    border-color: var(--opo-primary-hover);
    color: var(--opo-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(235, 86, 89, 0.35);
}

/* ============================================
   lp-opo-MEGA: Desktop megamenu dropdown
   ============================================ */
.lp-opo-mega {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 780px;
    background-color: var(--opo-white);
    border-radius: 12px;
    box-shadow: var(--opo-shadow-lg);
    border: 1px solid var(--opo-gray-200);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--opo-transition), transform var(--opo-transition), visibility var(--opo-transition);
    z-index: 1050;
}

.lp-opo-mega::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 16px;
    height: 16px;
    background-color: var(--opo-white);
    border-left: 1px solid var(--opo-gray-200);
    border-top: 1px solid var(--opo-gray-200);
    border-radius: 3px 0 0 0;
}

.lp-opo-nav__item--open .lp-opo-mega {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.lp-opo-mega__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* --- Familia card inside megamenu --- */
.lp-opo-mega__card {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--opo-dark);
    transition: background-color var(--opo-transition), transform 0.2s ease;
    border: 1px solid transparent;
}

.lp-opo-mega__card:hover,
.lp-opo-mega__card:focus {
    background-color: var(--opo-primary-light);
    color: var(--opo-dark);
    border-color: rgba(235, 86, 89, 0.15);
    transform: translateY(-1px);
}

.lp-opo-mega__card-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background-color: var(--opo-gray-100);
    font-size: 1.25rem;
    color: var(--opo-primary);
    transition: background-color var(--opo-transition), color var(--opo-transition);
}

.lp-opo-mega__card:hover .lp-opo-mega__card-icon {
    background-color: var(--opo-primary);
    color: var(--opo-white);
}

.lp-opo-mega__card-body {
    flex: 1;
    min-width: 0;
}

.lp-opo-mega__card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--opo-dark);
    margin: 0 0 0.125rem 0;
    line-height: 1.3;
}

.lp-opo-mega__card-desc {
    font-size: 0.8125rem;
    color: var(--opo-gray-500);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Megamenu footer link --- */
.lp-opo-mega__footer {
    margin-top: 0;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--opo-gray-200);
    text-align: center;
}

.lp-opo-mega__footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--opo-primary);
    text-decoration: none;
    transition: gap var(--opo-transition);
}

/* --- Multi-column layout: una columna por familia --- */
.lp-opo-mega__cols {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--opo-gray-200);
    padding-bottom: 1rem;
    margin-bottom: 0;
}

.lp-opo-mega__col {
    flex: 1;
    min-width: 0;
    padding: 0 1rem;
    border-right: 1px solid var(--opo-gray-200);
}

.lp-opo-mega__col:first-child {
    padding-left: 0;
}

.lp-opo-mega__col:last-child {
    border-right: none;
    padding-right: 0;
}

/* Cabecera de familia (enlace a la landing de familia) */
.lp-opo-mega__col-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--opo-dark);
    text-decoration: none;
    padding: 0.25rem 0 0.625rem;
    border-bottom: 2px solid var(--opo-primary);
    margin-bottom: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: color var(--opo-transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-opo-mega__col-title .bi {
    flex-shrink: 0;
    color: var(--opo-primary);
    font-size: 0.9rem;
}

.lp-opo-mega__col-title:hover {
    color: var(--opo-primary);
}

/* Lista de cursos de la familia */
.lp-opo-mega__col-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

/* Enlace individual de curso */
.lp-opo-mega__col-link {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
    color: var(--opo-gray-700);
    text-decoration: none;
    border-radius: 6px;
    transition: background-color var(--opo-transition), color var(--opo-transition), padding-left var(--opo-transition);
    line-height: 1.35;
}

.lp-opo-mega__col-link .bi {
    flex-shrink: 0;
    font-size: 0.6rem;
    color: var(--opo-primary);
    opacity: 0;
    transition: opacity var(--opo-transition), transform var(--opo-transition);
    transform: translateX(-4px);
}

.lp-opo-mega__col-link:hover,
.lp-opo-mega__col-link:focus {
    background-color: var(--opo-primary-light);
    color: var(--opo-dark);
    padding-left: 0.75rem;
}

.lp-opo-mega__col-link:hover .bi,
.lp-opo-mega__col-link:focus .bi {
    opacity: 1;
    transform: translateX(0);
}

/* --- Megamenu en viewports estrechos: ancho fijo reducido --- */
@media (min-width: 992px) and (max-width: 1199px) {
    .lp-opo-mega {
        width: 660px;
    }
    .lp-opo-mega__col-link {
        font-size: 0.75rem;
    }
    .lp-opo-mega__col-title {
        font-size: 0.8rem;
    }
    .lp-opo-mega__tabs {
        width: 175px;
    }
    .lp-opo-mega__tab {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }
    .lp-opo-mega__panel-list {
        grid-template-columns: 1fr;
    }
    .lp-opo-mega__panel-link {
        font-size: 0.75rem;
    }
}

.lp-opo-mega__footer-link:hover {
    color: var(--opo-primary-hover);
    gap: 0.625rem;
}

/* ============================================
   lp-opo-MEGA: Two-panel layout (tabs + panels)
   ============================================ */
.lp-opo-mega__body {
    display: flex;
    height: 360px;
}

/* Left: family tabs */
.lp-opo-mega__tabs {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--opo-gray-200);
    padding: 0.5rem 0;
    overflow-y: auto;
}

.lp-opo-mega__tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--opo-dark-medium);
    text-decoration: none;
    transition: background-color var(--opo-transition), color var(--opo-transition);
    position: relative;
    white-space: nowrap;
    border-bottom: 1px solid var(--opo-gray-200);
}

.lp-opo-mega__tab:last-child {
    border-bottom: none;
}

.lp-opo-mega__tab .bi:first-child {
    font-size: 0.8125rem;
    color: var(--opo-gray-500);
    flex-shrink: 0;
    transition: color var(--opo-transition);
}

.lp-opo-mega__tab:hover {
    background-color: var(--opo-gray-100);
    color: var(--opo-primary);
}

.lp-opo-mega__tab:hover .bi:first-child {
    color: var(--opo-primary);
}

.lp-opo-mega__tab--active {
    background-color: var(--opo-primary-light);
    color: var(--opo-primary);
    font-weight: 600;
}

.lp-opo-mega__tab--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--opo-primary);
    border-radius: 0 2px 2px 0;
}

.lp-opo-mega__tab--active .bi:first-child {
    color: var(--opo-primary);
}

.lp-opo-mega__tab-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-opo-mega__tab-arrow {
    font-size: 0.55rem;
    color: var(--opo-gray-500);
    flex-shrink: 0;
    transition: color var(--opo-transition);
}

.lp-opo-mega__tab--active .lp-opo-mega__tab-arrow,
.lp-opo-mega__tab:hover .lp-opo-mega__tab-arrow {
    color: var(--opo-primary);
}

/* Right: panels */
.lp-opo-mega__panels {
    flex: 1;
    min-width: 0;
    position: relative;
}

.lp-opo-mega__panel {
    display: none;
    padding: 1.25rem;
    overflow-y: auto;
    height: 100%;
}

.lp-opo-mega__panel--active {
    display: block;
}

.lp-opo-mega__panel-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--opo-dark);
    text-decoration: none;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--opo-primary);
    margin-bottom: 0.875rem;
    transition: color var(--opo-transition);
}

.lp-opo-mega__panel-heading:hover {
    color: var(--opo-primary);
}

.lp-opo-mega__panel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.125rem;
}

.lp-opo-mega__panel-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.625rem;
    font-size: 0.8125rem;
    color: var(--opo-gray-700);
    text-decoration: none;
    border-radius: 6px;
    transition: background-color var(--opo-transition), color var(--opo-transition), padding-left var(--opo-transition);
    line-height: 1.35;
}

/* Icono del producto en chip cuadrado (mismo tratamiento visual que la
   bandera en el menú "Por Comunidad"): fondo soft con acento primario. */
.lp-opo-mega__panel-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    border-radius: 3px;
    background: var(--color-primary-light, rgba(var(--color-primary-rgb), 0.1));
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    color: var(--color-primary);
    flex-shrink: 0;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.lp-opo-mega__panel-link-icon .bi {
    font-size: 0.9rem;
    line-height: 1;
}

.lp-opo-mega__panel-link:hover {
    background-color: var(--opo-primary-light);
    color: var(--opo-dark);
    padding-left: 0.875rem;
}

.lp-opo-mega__panel-link:hover .lp-opo-mega__panel-link-icon {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.lp-opo-mega__panel-empty {
    font-size: 0.875rem;
    color: var(--opo-gray-500);
    font-style: italic;
    margin: 0;
    padding: 0.25rem 0;
}

/* ============================================
   lp-opo-HAMBURGER: Animated hamburger button
   ============================================ */
.lp-opo-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1060;
    gap: 5px;
}

.lp-opo-hamburger__line {
    display: block;
    width: 24px;
    height: 2.5px;
    background-color: var(--opo-dark);
    border-radius: 2px;
    transition: transform var(--opo-transition), opacity var(--opo-transition);
    transform-origin: center;
}

.lp-opo-hamburger--active .lp-opo-hamburger__line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.lp-opo-hamburger--active .lp-opo-hamburger__line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.lp-opo-hamburger--active .lp-opo-hamburger__line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ============================================
   lp-opo-OFFCANVAS: Mobile drawer
   ============================================ */
.lp-opo-offcanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    background-color: var(--opo-white);
    z-index: 1055;
    transform: translateX(-100%);
    transition: transform var(--opo-transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lp-opo-offcanvas--open {
    transform: translateX(0);
}

.lp-opo-offcanvas__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--opo-gray-200);
    flex-shrink: 0;
}

.lp-opo-offcanvas__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--opo-gray-500);
    cursor: pointer;
    border-radius: 8px;
    transition: background-color var(--opo-transition), color var(--opo-transition);
    padding: 0;
}

.lp-opo-offcanvas__close:hover {
    background-color: var(--opo-gray-100);
    color: var(--opo-dark);
}

.lp-opo-offcanvas__body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch;
}

.lp-opo-offcanvas__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lp-opo-offcanvas__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--opo-dark);
    text-decoration: none;
    transition: background-color var(--opo-transition), color var(--opo-transition);
    min-height: 48px;
}

.lp-opo-offcanvas__link:hover,
.lp-opo-offcanvas__link:focus {
    background-color: var(--opo-gray-100);
    color: var(--opo-primary);
}

.lp-opo-offcanvas__link-chevron {
    font-size: 0.75rem;
    transition: transform var(--opo-transition);
    color: var(--opo-gray-500);
}

.lp-opo-offcanvas__item--open .lp-opo-offcanvas__link-chevron {
    transform: rotate(180deg);
    color: var(--opo-primary);
}

/* --- Mobile accordion sub-items --- */
.lp-opo-offcanvas__sub {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background-color: var(--opo-gray-100);
}

.lp-opo-offcanvas__item--open .lp-opo-offcanvas__sub {
    max-height: 3000px;
}

.lp-opo-offcanvas__sub-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.25rem 0.75rem 2rem;
    font-size: 0.9375rem;
    color: var(--opo-dark-medium);
    text-decoration: none;
    transition: color var(--opo-transition), padding-left var(--opo-transition);
    min-height: 44px;
    border-bottom: 1px solid var(--opo-gray-200);
}

.lp-opo-offcanvas__sub-link:last-child {
    border-bottom: none;
}

.lp-opo-offcanvas__sub-link:hover,
.lp-opo-offcanvas__sub-link:focus {
    color: var(--opo-primary);
    padding-left: 2.25rem;
}

.lp-opo-offcanvas__sub-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background-color: var(--opo-white);
    font-size: 0.875rem;
    color: var(--opo-primary);
}

/* --- Mobile offcanvas: nivel 2 (familia toggle) y nivel 3 (cursos) --- */
.lp-opo-offcanvas__sub-item {
    border-bottom: 1px solid var(--opo-gray-200);
}

.lp-opo-offcanvas__sub-item:last-child {
    border-bottom: none;
}

.lp-opo-offcanvas__sub-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem 0.75rem 2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--opo-dark);
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--opo-transition), color var(--opo-transition);
    min-height: 44px;
}

.lp-opo-offcanvas__sub-group:hover {
    background-color: var(--opo-white);
    color: var(--opo-primary);
}

.lp-opo-offcanvas__sub-group-chevron {
    font-size: 0.75rem;
    color: var(--opo-gray-500);
    transition: transform var(--opo-transition);
    flex-shrink: 0;
}

.lp-opo-offcanvas__sub-item--open .lp-opo-offcanvas__sub-group-chevron {
    transform: rotate(180deg);
    color: var(--opo-primary);
}

.lp-opo-offcanvas__sub-item--open .lp-opo-offcanvas__sub-group {
    color: var(--opo-primary);
    background-color: var(--opo-white);
}

.lp-opo-offcanvas__sub2 {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background-color: var(--opo-white);
}

.lp-opo-offcanvas__sub-item--open .lp-opo-offcanvas__sub2 {
    max-height: 1200px;
}

.lp-opo-offcanvas__sub2-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem 0.625rem 3rem;
    font-size: 0.875rem;
    color: var(--opo-gray-700);
    text-decoration: none;
    transition: color var(--opo-transition), background-color var(--opo-transition);
    border-top: 1px solid var(--opo-gray-100);
    min-height: 40px;
}

.lp-opo-offcanvas__sub2-link:hover {
    color: var(--opo-primary);
    background-color: var(--opo-primary-light);
}

.lp-opo-offcanvas__sub2-link--all {
    font-weight: 600;
    color: var(--opo-primary);
}

.lp-opo-offcanvas__sub2-link--all:hover {
    color: var(--opo-primary-hover);
}

.lp-opo-offcanvas__flag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    display: inline-block;
}

/* Icono de producto en el submenu offcanvas (mobile) — mismo chip que desktop */
.lp-opo-offcanvas__sub2-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 18px;
    border-radius: 3px;
    background: var(--color-primary-light, rgba(var(--color-primary-rgb), 0.1));
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--color-primary);
    font-size: 0.82rem;
    margin-right: 0.55rem;
    flex-shrink: 0;
}

/* --- Mobile offcanvas footer --- */
.lp-opo-offcanvas__footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--opo-gray-200);
    background-color: var(--opo-white);
}

.lp-opo-offcanvas__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background-color: var(--opo-primary);
    color: var(--opo-white);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    transition: background-color var(--opo-transition);
    cursor: pointer;
    min-height: 48px;
}

.lp-opo-offcanvas__cta:hover,
.lp-opo-offcanvas__cta:focus {
    background-color: var(--opo-primary-hover);
    color: var(--opo-white);
}

.lp-opo-offcanvas__phone-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--opo-gray-500);
    text-decoration: none;
}

.lp-opo-offcanvas__phone-mobile:hover {
    color: var(--opo-primary);
}

/* --- Overlay --- */
.lp-opo-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--opo-transition), visibility var(--opo-transition);
}

.lp-opo-overlay--visible {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   RESPONSIVE: Desktop (>=992px)
   ============================================ */
@media (min-width: 992px) {
    .lp-opo-nav__menu {
        display: flex;
    }

    .lp-opo-nav__actions {
        display: flex;
    }

    .lp-opo-hamburger {
        display: none;
    }

    .lp-opo-offcanvas,
    .lp-opo-overlay {
        display: none !important;
    }
}

/* ============================================
   RESPONSIVE: Large desktop (>=1200px)
   ============================================ */
@media (min-width: 1200px) {
    .lp-opo-nav__link {
        padding: 0.5rem 1.25rem;
    }

    .lp-opo-mega {
        width: 780px;
    }
}

/* ============================================
   RESPONSIVE: Mobile header center logo
   ============================================ */
@media (max-width: 991.98px) {
    .lp-opo-nav__logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .lp-opo-nav__logo-img {
        height: 28px;
    }
}

/* ============================================
   UTILITY: prevent body scroll when offcanvas open
   ============================================ */
body.lp-opo-nav-open {
    overflow: hidden;
}

/* ============================================
   lp-opo-FOOTER: Site footer
   ZBrain Oposiciones
   BEM namespace: lp-opo-footer
   ============================================ */

/* --- Block wrapper --- */
.lp-opo-footer {
    background-color: var(--opo-dark);
    color: rgba(255, 255, 255, 0.75);
    padding-top: 0;
    position: relative;
    overflow: hidden;
}

/* --- Accent stripe at the very top --- */
.lp-opo-footer__accent {
    height: 4px;
    background: linear-gradient(90deg, var(--opo-primary) 0%, var(--color-secondary) 50%, var(--opo-primary) 100%);
    width: 100%;
}

/* --- Background decorative glow (pure CSS, no SVG) --- */
.lp-opo-footer::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(235, 86, 89, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* --- Main content area padding --- */
.lp-opo-footer > .container {
    padding-top: 3rem;
    padding-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

/* ---- Col 1: Logo ---- */
.lp-opo-footer__logo {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    margin-bottom: 1rem;
    text-decoration: none;
    transition: background-color var(--opo-transition);
}

.lp-opo-footer__logo:hover,
.lp-opo-footer__logo:focus {
    background: rgba(255, 255, 255, 0.11);
}

.lp-opo-footer__logo-img {
    height: 36px;
    width: auto;
    /* SVG ya con colores correctos — sin filter de inversión. */
    filter: none;
    transition: opacity var(--opo-transition);
}

.lp-opo-footer__logo:hover .lp-opo-footer__logo-img,
.lp-opo-footer__logo:focus .lp-opo-footer__logo-img {
    opacity: 0.85;
}

/* ---- Col 1: Description ---- */
.lp-opo-footer__desc {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 1.25rem 0;
    max-width: 300px;
}

/* ---- Col 1: Social icons ---- */
.lp-opo-footer__social {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.625rem;
}

.lp-opo-footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    text-decoration: none;
    transition: background-color var(--opo-transition), color var(--opo-transition), border-color var(--opo-transition), transform 0.2s ease;
}

.lp-opo-footer__social-link:hover,
.lp-opo-footer__social-link:focus {
    background-color: var(--opo-primary);
    color: var(--opo-white);
    transform: translateY(-2px);
}

/* ---- Col 2: Heading ---- */
.lp-opo-footer__heading {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--opo-white);
    margin: 0 0 1.25rem 0;
    letter-spacing: 0.02em;
    position: relative;
    padding-bottom: 0.75rem;
}

.lp-opo-footer__heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 3px;
    background-color: var(--opo-primary);
    border-radius: 2px;
}

/* ---- Col 2: Navigation links ---- */
.lp-opo-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lp-opo-footer__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: color var(--opo-transition), padding-left var(--opo-transition);
}

.lp-opo-footer__link:hover,
.lp-opo-footer__link:focus {
    color: var(--opo-white);
    padding-left: 0.25rem;
}

.lp-opo-footer__link-icon {
    font-size: 0.625rem;
    color: var(--opo-primary);
    transition: transform var(--opo-transition);
    flex-shrink: 0;
}

.lp-opo-footer__link:hover .lp-opo-footer__link-icon {
    transform: translateX(3px);
}

.lp-opo-footer__links-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* ---- Col 3: Phone ---- */
.lp-opo-footer__phone {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--opo-white);
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color var(--opo-transition);
}

.lp-opo-footer__phone:hover,
.lp-opo-footer__phone:focus {
    color: var(--opo-primary);
}

.lp-opo-footer__phone-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(235, 86, 89, 0.22);
    border: 1px solid rgba(235, 86, 89, 0.3);
    color: var(--opo-primary);
    font-size: 1rem;
    flex-shrink: 0;
}

/* ---- Col 3: Contact text ---- */
.lp-opo-footer__contact-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 1.25rem 0;
    max-width: 300px;
}

/* ---- Col 3: CTA button ---- */
.lp-opo-footer__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background-color: var(--opo-primary);
    color: var(--opo-white);
    font-size: 0.9375rem;
    font-weight: 600;
    border: 2px solid var(--opo-primary);
    border-radius: 50px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--opo-transition), transform 0.2s ease, box-shadow var(--opo-transition);
}

.lp-opo-footer__cta:hover,
.lp-opo-footer__cta:focus {
    background-color: var(--opo-primary-hover);
    border-color: var(--opo-primary-hover);
    color: var(--opo-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(235, 86, 89, 0.35);
}

/* ---- Territorio (enlaces por comunidad — SEO internal linking) ---- */
.lp-opo-footer__territorio {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}
.lp-opo-footer__heading--territorio {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
}
.lp-opo-footer__heading--territorio .bi {
    color: var(--opo-primary);
    font-size: 0.95rem;
}
.lp-opo-footer__territorio-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
}
.lp-opo-footer__territorio-link {
    display: inline-block;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    line-height: 1.25;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    white-space: nowrap;
}
.lp-opo-footer__territorio-link:hover,
.lp-opo-footer__territorio-link:focus {
    color: #fff;
    border-color: rgba(var(--color-primary-rgb), 0.6);
    background: rgba(var(--color-primary-rgb), 0.15);
    text-decoration: none;
}

/* ---- Bottom bar ---- */
.lp-opo-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 0;
    position: relative;
    z-index: 1;
}

.lp-opo-footer__copyright {
    margin: 0;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

/* ============================================
   lp-opo-FOOTER: Responsive (md >= 768px)
   ============================================ */
@media (min-width: 768px) {
    .lp-opo-footer__desc {
        max-width: 280px;
    }
}

/* ============================================
   lp-opo-FOOTER: Responsive (lg >= 992px)
   ============================================ */
@media (min-width: 992px) {
    .lp-opo-footer > .container {
        padding-top: 3.5rem;
        padding-bottom: 3rem;
    }

    .lp-opo-footer__desc {
        max-width: 320px;
    }

    .lp-opo-footer__contact-text {
        max-width: 320px;
    }
}

/* =============================================================================
 * Dropdown "Por Comunidad" — específico de sanidad
 * Reutiliza .lp-opo-mega como contenedor pero con grid de cards de comunidades.
 * ============================================================================= */

.lp-opo-mega--comunidades {
    min-width: 720px;
    max-width: 860px;
}

.lp-opo-mega--comunidades .lp-opo-mega__body {
    padding: 1.25rem;
}

.lp-opo-mega__comunidades-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.lp-opo-mega__comunidad-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.55rem;
    row-gap: 0.1rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--color-secondary-dark);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.18s ease;
    min-height: 56px;
}

.lp-opo-mega__comunidad-card:hover,
.lp-opo-mega__comunidad-card:focus-visible {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    transform: translateY(-1px);
    outline: none;
}

.lp-opo-mega__comunidad-flag {
    grid-row: 1 / span 2;
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    background: #fff;
    display: block;
}

.lp-opo-mega__comunidad-card:hover .lp-opo-mega__comunidad-flag,
.lp-opo-mega__comunidad-card:focus-visible .lp-opo-mega__comunidad-flag {
    border-color: rgba(255, 255, 255, 0.4);
}

.lp-opo-mega__comunidad-acro {
    font-weight: 800;
    font-size: 0.85rem;
    line-height: 1;
    letter-spacing: 0.01em;
}

.lp-opo-mega__comunidad-name {
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0.85;
}

/* ============================================
 * Menú Cursos — tarjetas con el MISMO estilo que las de comunidad.
 * Reemplaza la antigua lista `.lp-opo-mega__panel-list` / `.lp-opo-mega__panel-link`.
 * Chip cuadrado con el icono del producto (crm_productos.icono).
 * ============================================ */
.lp-opo-mega__cursos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.lp-opo-mega__curso-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--color-secondary-dark);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.18s ease;
    min-height: 52px;
}

.lp-opo-mega__curso-card:hover,
.lp-opo-mega__curso-card:focus-visible {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    transform: translateY(-1px);
    outline: none;
}

.lp-opo-mega__curso-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 24px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    color: var(--color-primary);
    flex-shrink: 0;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.lp-opo-mega__curso-icon .bi {
    font-size: 0.95rem;
    line-height: 1;
}

.lp-opo-mega__curso-card:hover .lp-opo-mega__curso-icon,
.lp-opo-mega__curso-card:focus-visible .lp-opo-mega__curso-icon {
    border-color: rgba(255, 255, 255, 0.45);
    background: #fff;
    color: var(--color-primary);
}

.lp-opo-mega__curso-name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
}

/* Responsive: 1 columna en menu móvil/tablet */
@media (max-width: 991.98px) {
    .lp-opo-mega__cursos-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .lp-opo-mega--comunidades {
        min-width: 100%;
        max-width: 100%;
    }
    .lp-opo-mega__comunidades-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 575.98px) {
    .lp-opo-mega__comunidades-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
