#mve {
    --mve-white: #FFFEFF;
    --mve-sand-3: #D8CFC7;
    --mve-sand-7: #3A3735;
    --mve-forest: #00402A;
    --mve-forest-1: #DCEBE1;
    --mve-green-1: #007F33;
    --mve-green: #00A443;
    --mve-green-4: #5BD38C;

    --mve-font-title: "IberPangea", Arial, sans-serif;
    --mve-font-body: "IberPangea Text", Arial, sans-serif;

    container-type: inline-size;
    position: relative;
    width: 100%;
    max-width: 1156px;
    margin: 20px auto;
    box-sizing: border-box;
    text-align: left;
    background-color: var(--mve-white);
    border: 1px solid var(--mve-sand-3);
    border-radius: 15px;
    overflow: hidden;
}

#mve * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-style: normal;
}

#mve ul {
    list-style: none;
}

/* ===== Base: cabecera + escena ===== */
#mve .mve__base {
    padding: 32px;
    display: flex;
    flex-direction: column;
}

#mve .mve__title {
    color: var(--mve-green-1);
    font-family: var(--mve-font-title);
    font-weight: 400;
    font-size: 32px;
    line-height: 36px;
}

#mve .mve__title strong {
    font-weight: 700;
}

#mve .mve__subtitle {
    margin-top: 8px;
    color: var(--mve-forest);
    font-family: var(--mve-font-title);
    font-weight: 400;
    font-size: 24px;
    line-height: 28px;
}

/* La proporción la marca la escena: así el plano nunca sube hasta las
   píldoras aunque el titular ocupe más líneas al estrecharse el bloque */
#mve .mve__scene {
    position: relative;
    flex: 0 0 auto;
    margin-top: 32px;
    aspect-ratio: 1092 / 587.63;
}

/* Mapa: 1092x477.15 anclado abajo del área de escena (Figma: top 110.48) */
#mve .mve__mapwrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    aspect-ratio: 1092 / 477.15;
}

#mve .mve__map {
    display: block;
    width: 100%;
    height: 100%;
}

#mve .mve__zones {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* El trazado se repinta encima en Green 1, no hace falta mezclar */
}

#mve .mve__zone {
    fill: var(--mve-green-4);
    fill-opacity: 0;
    transition: fill-opacity 0.25s ease;
    pointer-events: none;
}

#mve .mve__scene.is-hover-talleres .mve__zone[data-zone="talleres"],
#mve .mve__scene.is-hover-museo .mve__zone[data-zone="museo"],
#mve .mve__scene.is-hover-bobina .mve__zone[data-zone="bobina"],
#mve .mve__scene.is-hover-hall .mve__zone[data-zone="hall"],
#mve .mve__scene.is-hover-experiencia .mve__zone[data-zone="experiencia"],
#mve .mve__scene.is-hover-auditorio .mve__zone[data-zone="auditorio"] {
    fill-opacity: 1;
}

/* Conectores */
#mve .mve__lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--mve-forest);
    stroke-width: 1;
    pointer-events: none;
}

#mve .mve__lines path {
    vector-effect: non-scaling-stroke;
}

/* Remate del conector sobre el plano (Ø 5,33 en Figma) */
#mve .mve__dot {
    fill: var(--mve-forest);
    stroke: none;
}

/* ===== Píldoras ===== */
#mve .mve__pin {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Medidas proporcionales al bloque (referencia: frame de 1156 de Figma),
       para que las píldoras no se junten cuando el bloque es más estrecho */
    gap: 1.3841cqw;
    padding: 1.3841cqw;
    background-color: var(--mve-white);
    border: 1px solid var(--mve-sand-3);
    border-radius: 30px;
    cursor: pointer;
    font: inherit;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

#mve .mve__pin-label {
    font-family: var(--mve-font-body);
    font-weight: 600;
    font-size: 1.3841cqw;
    line-height: 1.7301cqw;
    color: var(--mve-sand-7);
    white-space: nowrap;
    text-align: left;
    transition: color 0.2s ease;
}

/* Los rótulos van a 2 líneas solo en el corte 375 */
#mve .mve__br { display: none; }

#mve .mve__pin-plus {
    position: relative;
    flex: 0 0 auto;
    width: 2.5087cqw;
    height: 2.5087cqw;
    background-color: var(--mve-green-1);
    border-radius: 20px;
    transition: background-color 0.2s ease;
}

#mve .mve__pin-plus::before,
#mve .mve__pin-plus::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background-color: var(--mve-white);
    transform: translate(-50%, -50%);
}

#mve .mve__pin-plus::before { width: 0.9516cqw; height: 0.1297cqw; }
#mve .mve__pin-plus::after { width: 0.1297cqw; height: 0.9516cqw; }

/* Hover / activo de la píldora (Figma: fondo Green 1, texto blanco, plus forest) */
#mve .mve__pin:hover,
#mve .mve__pin:focus-visible,
#mve .mve__pin.is-active {
    background-color: var(--mve-green-1);
    border-color: var(--mve-green-1);
}

#mve .mve__pin:hover .mve__pin-label,
#mve .mve__pin:focus-visible .mve__pin-label,
#mve .mve__pin.is-active .mve__pin-label {
    color: var(--mve-white);
}

#mve .mve__pin:hover .mve__pin-plus,
#mve .mve__pin:focus-visible .mve__pin-plus,
#mve .mve__pin.is-active .mve__pin-plus {
    background-color: var(--mve-forest);
}

/* Posiciones 1156 (Group 458: left 66.82 / top 14.98 sobre la escena) */
#mve .mve__pin--talleres    { left: 6.232%;  top: 2.549%; }
#mve .mve__pin--museo       { left: 39.577%; top: 2.549%; }
#mve .mve__pin--bobina      { left: 65.797%; top: 2.549%; }
#mve .mve__pin--auditorio   { left: 83.796%; top: 2.583%; }
#mve .mve__pin--hall        { left: 46.678%; top: 57.454%; }
#mve .mve__pin--experiencia { left: 40.772%; top: 85.588%; }

/* ===== Modales (ocupan todo el frame) ===== */
/* Velo sobre el bloque mientras hay una ficha abierta */
#mve .mve__velo {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: rgba(255, 254, 255, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#mve.is-open .mve__velo {
    opacity: 1;
    visibility: visible;
}

#mve .mve__modal {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tarjeta centrada sobre el plano (Figma: 718x470 sobre 1156x756) */
#mve .mve__card {
    width: 62.11%;
    /* En 1156 el contenido cabe en el alto del diseño; al estrechar el bloque la
       ventana crece para que la ilustración no se corte, hasta el tope en que
       empieza a haber scroll (el Museo, que lo lleva de serie) */
    height: auto;
    min-height: 62.17%;
    max-height: 92%;
    background-color: var(--mve-white);
    border: 1px solid var(--mve-sand-3);
    border-radius: 15px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#mve .mve__modal[hidden] { display: none; }

/* Solo el título y el cierre quedan fijos; la entradilla baja con el scroll */
#mve .mve__modal-head {
    flex: 0 0 auto;
}

#mve .mve__modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

#mve .mve__modal-title {
    color: var(--mve-green-1);
    font-family: var(--mve-font-title);
    font-weight: 700;
    font-size: 32px;
    line-height: 36px;
}

#mve .mve__close {
    position: relative;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    background-color: var(--mve-green-1);
    border: 0;
    border-radius: 20px;
    cursor: pointer;
}

#mve .mve__close::before,
#mve .mve__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 15px;
    height: 1.5px;
    background-color: var(--mve-white);
}

#mve .mve__close:hover,
#mve .mve__close:focus-visible {
    background-color: var(--mve-forest);
}

#mve .mve__close::before { transform: translate(-50%, -50%) rotate(45deg); }
#mve .mve__close::after { transform: translate(-50%, -50%) rotate(-45deg); }

#mve .mve__modal-intro {
    color: var(--mve-forest);
    font-family: var(--mve-font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
}

/* Cuerpo con scroll vertical solo si el contenido desborda */
#mve .mve__modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-right: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--mve-green) transparent;
}

#mve .mve__modal-body::-webkit-scrollbar { width: 5px; }
#mve .mve__modal-body::-webkit-scrollbar-track {
    background-color: transparent;
}
#mve .mve__modal-body::-webkit-scrollbar-thumb {
    background-color: var(--mve-green);
    border-radius: 3px;
}

/* Proporción de la foto en Figma (1092x513 en 1156; 704x331 en 768) */
#mve .mve__modal-photo {
    flex: 0 0 auto;
    aspect-ratio: 1092 / 513;
    border-radius: 15px;
    overflow: hidden;
}

#mve .mve__modal-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ===== Listas de contenido ===== */
#mve .mve__items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 816px;
}

#mve .mve__item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* =========================================================================
   CORTE 768 (Figma: 768x546.84)
   ========================================================================= */
@container (max-width: 1000px) {
    #mve .mve__scene {
        aspect-ratio: 704 / 378.84;
    }

    /* Mapa 704x307.61 (Group 454: top 71.23 sobre la escena) */
    #mve .mve__mapwrap {
        aspect-ratio: 704 / 307.61;
    }

    /* Group 455: left 15 / top 0 */
    /* Medidas proporcionales al bloque (referencia: frame de 768 de Figma):
       12px -> 1.5625cqw, 16px -> 2.0833cqw ... Evita que las píldoras se
       solapen cuando el bloque es más estrecho que el frame. */
    #mve .mve__pin {
        padding: 1.5625cqw 2.0833cqw;
        gap: 1.5625cqw;
    }

    #mve .mve__pin-label {
        font-size: 2.0833cqw;
        line-height: 2.6042cqw;
    }

    #mve .mve__pin-plus {
        width: 3.776cqw;
        height: 3.776cqw;
    }

    #mve .mve__pin-plus::before { width: 1.4323cqw; height: 0.1953cqw; }
    #mve .mve__pin-plus::after { width: 0.1953cqw; height: 1.4323cqw; }
    /* Disposicion del frame 768 (Group 456): arriba Museo, Bobina y
       Auditorio; abajo Talleres, Hall y Experiencia */
    #mve .mve__pin--museo       { left: 13.920%; top: 1.848%; }
    #mve .mve__pin--bobina      { left: 41.761%; top: 2.112%; }
    #mve .mve__pin--auditorio   { left: 75.994%; top: 2.112%; }
    #mve .mve__pin--talleres    { left: 1.136%;  top: 54.377%; }
    #mve .mve__pin--hall        { left: 41.335%; top: 56.489%; }
    #mve .mve__pin--experiencia { left: 40.341%; top: 81.037%; width: 21.875cqw; }

    #mve .mve__pin--experiencia .mve__pin-label { white-space: normal; }
}

/* =========================================================================
   CORTE 375 (Figma: 375x454 base / 868 con modal)
   ========================================================================= */
@container (max-width: 560px) {
    #mve {
        overflow: visible;
    }

    #mve .mve__base {
        padding: 16px;
    }

    #mve .mve__title { font-size: 30px; line-height: 34px; }
    #mve .mve__subtitle { font-size: 21px; line-height: 24px; }

    #mve .mve__scene {
        margin-top: 32px;
        aspect-ratio: 344 / 292;
        flex: 0 0 auto;
    }

    /* Mapa 344x150.31 anclado arriba (top 121 sobre la escena) */
    #mve .mve__mapwrap {
        aspect-ratio: 344 / 150.31;
        top: 41.438%;
        bottom: auto;
    }

    #mve .mve__br { display: inline; }

    #mve .mve__pin {
        gap: 16px;
        padding: 8px 16px;
    }

    #mve .mve__pin-label {
        font-size: 12px;
        line-height: 14px;
        white-space: pre-line;
    }

    #mve .mve__pin-plus {
        width: 29px;
        height: 29px;
    }

    #mve .mve__pin-plus::before { width: 11px; height: 1.5px; }
    #mve .mve__pin-plus::after { width: 1.5px; height: 11px; }

    /* El botón se ajusta a su texto: si no, el rótulo de dos líneas se
       desbordaba por los lados */
    #mve .mve__pin {
        width: max-content;
        max-width: 100%;
    }

    #mve .mve__pin--talleres    { left: 0.291%;  top: 0; }
    #mve .mve__pin--auditorio   { left: 61.337%; top: 0.690%; }
    #mve .mve__pin--museo       { left: 14.535%; top: 19.310%; }
    #mve .mve__pin--bobina      { left: 50%;     top: 19.310%; }
    #mve .mve__pin--hall        { left: 25.581%; top: 64.828%; }
    #mve .mve__pin--experiencia { left: 19.477%; top: 84.483%; }

    #mve .mve__modal-body { gap: 24px; }

    #mve .mve__item-title { font-size: 16px; line-height: 20px; }
}


/* ===== Ilustración del modal ===== */
/* Las ilustraciones vienen sin trazo: el marco lo pone el CSS y se ciñe a la
   imagen, así no se corta al cambiar de tamaño */
#mve .mve__figure {
    flex: 0 0 auto;
    display: block;
    overflow: hidden;
    border: 1px solid var(--mve-green-4);
    border-radius: 16px;
}

/* La imagen ocupa el alto sobrante sin recortarse (contain) */
#mve .mve__figure img {
    display: block;
    width: 100%;
    height: auto;
}

/* Cuando hay texto debajo, la ilustración deja de estirarse */
/* Los textos del bloque del Museo van 2 pt por debajo de la entradilla */
#mve .mve__body-intro {
    color: var(--mve-forest);
    font-family: var(--mve-font-body);
    font-weight: 400;
    font-size: 14px;
    line-height: 18px;
}

/* ===== Lista con bullet (Figma: Ellipse 5, 10px) ===== */
#mve .mve__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#mve .mve__item {
    position: relative;
    padding-left: 18px;
}

#mve .mve__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--mve-green-4);
}

#mve .mve__item-title {
    color: var(--mve-green-1);
    font-family: var(--mve-font-body);
    font-weight: 600;
    font-size: 16px;
    line-height: 22px;
}

/* Sin título encima, el texto va pegado a su bala (Figma: bala de 10 y 8 de
   separación, que es la sangría del propio item) */
#mve .mve__item-text:only-child {
    margin-top: 0;
    padding-left: 0;
}

#mve .mve__item-text {
    margin-top: 8px;
    padding-left: 23px;
    color: var(--mve-sand-7);
    font-family: var(--mve-font-body);
    font-weight: 400;
    font-size: 14px;
    line-height: 18px;
}

/* ===== Rótulo de la entrada, sobre el plano =====
   Figma: caja de 95x28 en x 886, y 202 de la escena; el plano empieza en
   y 110.48, de ahí el 19.181% vertical sobre el mapa. Se ancla por su centro
   (85.485%) para que al estrecharse no se salga del plano por la derecha */
#mve .mve__entrada {
    position: absolute;
    left: 85.485%;
    top: 19.181%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.3460cqw;
    padding: 0.3460cqw 0.6920cqw;
    background-color: var(--mve-white);
    border-radius: 1.3841cqw;
    color: var(--mve-green-1);
    font-family: var(--mve-font-body);
    font-weight: 600;
    font-size: 1.3841cqw;
    line-height: 1.7301cqw;
    white-space: nowrap;
    /* no capta el puntero: si no, apagaría el hover de la zona que tiene debajo */
    pointer-events: none;
}

/* La flecha se exporta apuntando a la derecha; en el diseño va volteada */
#mve .mve__entrada-icono {
    display: block;
    width: 1.2111cqw;
    height: auto;
    transform: scaleX(-1);
}

/* ===== Hover también sobre el propio plano =====
   'all': la zona capta el puntero aunque su relleno sea transparente */
#mve .mve__zone {
    pointer-events: all;
    cursor: pointer;
}


/* ===== Capas del plano =====
   Orden: base -> recuadro Green 4 -> trazado recoloreado -> trazo blanco.
   Así el trazo blanco del plano queda por encima del recuadro de fondo. */
#mve .mve__highlight,
#mve .mve__white {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#mve .mve__hl,
#mve .mve__wh {
    opacity: 0;
    transition: opacity 0.25s ease;
}

#mve .mve__scene.is-hover-talleres .mve__hl[data-zone="talleres"],
#mve .mve__scene.is-hover-museo .mve__hl[data-zone="museo"],
#mve .mve__scene.is-hover-bobina .mve__hl[data-zone="bobina"],
#mve .mve__scene.is-hover-hall .mve__hl[data-zone="hall"],
#mve .mve__scene.is-hover-experiencia .mve__hl[data-zone="experiencia"],
#mve .mve__scene.is-hover-auditorio .mve__hl[data-zone="auditorio"],
#mve .mve__scene.is-hover-talleres .mve__wh[data-zone="talleres"],
#mve .mve__scene.is-hover-museo .mve__wh[data-zone="museo"],
#mve .mve__scene.is-hover-bobina .mve__wh[data-zone="bobina"],
#mve .mve__scene.is-hover-hall .mve__wh[data-zone="hall"],
#mve .mve__scene.is-hover-experiencia .mve__wh[data-zone="experiencia"],
#mve .mve__scene.is-hover-auditorio .mve__wh[data-zone="auditorio"] {
    opacity: 1;
}

/* ===== Modal en el corte 375 ===== */
@container (max-width: 560px) {
    #mve .mve__modal {
        position: static;
        display: block;
        margin: 16px;
    }

    #mve .mve__modal[hidden] {
        display: none;
    }

    #mve .mve__card {
        width: 100%;
        height: 382px;
        padding: 16px;
        gap: 16px;
    }

    #mve .mve__modal-title {
        font-size: 21px;
        line-height: 24px;
    }

    #mve .mve__close {
        width: 33px;
        height: 33px;
    }

    #mve .mve__modal-intro {
        max-width: none !important;
    }

    /* La ilustración ocupa el alto que sobra; solo se fija cuando hay lista
       debajo (Museo), que es el único con scroll */
    #mve .mve__modal-body:has(.mve__list) .mve__figure {
        height: 137px;
    }
}

/* Por debajo del ancho de diseño (375) las píldoras de Museo y Bobina llegan
   a tocarse: se recorta su separación interna sin alterar el corte de Figma */
@container (max-width: 374px) {
    #mve .mve__pin {
        gap: 10px;
        padding: 8px 12px;
    }
}

/* Los rótulos en inglés son más anchos: hasta 400 el de Museum llega a tocar
   el de Tesla coil, así que se les recorta la separación interna */
@container (max-width: 400px) {
    #mve.mve--en .mve__pin {
        gap: 10px;
        padding: 8px 12px;
    }
}

/* El rótulo de la entrada, por cortes: proporcional al plano hasta móvil,
   donde pasa a medidas fijas para que siga siendo legible */
@container (max-width: 1000px) {
    #mve .mve__entrada {
        gap: 0.5208cqw;
        padding: 0.5208cqw 1.0417cqw;
        border-radius: 2.0833cqw;
        font-size: 2.0833cqw;
        line-height: 2.6042cqw;
    }

    #mve .mve__entrada-icono { width: 1.8229cqw; }
}

@container (max-width: 560px) {
    #mve .mve__entrada {
        gap: 3px;
        padding: 3px 6px;
        border-radius: 12px;
        font-size: 12px;
        line-height: 14px;
    }

    #mve .mve__entrada-icono { width: 11px; }
}

/* En móvil la ficha no se superpone al plano, sino que se despliega debajo:
   ahí el velo no tiene sentido */
@container (max-width: 560px) {
    #mve .mve__velo { display: none; }
}
