/* ==========================================================================
   MAPAS DE ASIENTOS · DIBUJO (js/mapa.plano.js)
   El mismo en la compra, la taquilla, el Dashboard y el editor de «Mapas y zonas».
   Claro por defecto; .mp-oscuro (compra) y la taquilla en oscuro cambian las variables.
   ========================================================================== */

.mp-host {
    --mp-fondo: #eef1f6;
    --mp-lienzo: #ffffff;
    --mp-borde: rgba(15, 23, 42, 0.12);
    --mp-tinta: #1f2430;
    --mp-tinta-2: #5a6070;
    --mp-ocupado: #d3d6de;
    --mp-ocupado-2: #b9bdc7;
    --mp-ocupado-tx: #8a8f9c;
    --mp-sel: #2a78d6;
    --mp-sel-tx: #ffffff;
    --mp-foco: #eda100;
    --mp-marca: #eda100;
    position: relative;
    overflow: hidden;
    background: var(--mp-fondo);
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.mp-host.mp-oscuro,
.tq[data-tema="oscuro"] .mp-host {
    --mp-fondo: #15181e;
    --mp-lienzo: #1d2129;
    --mp-borde: rgba(255, 255, 255, 0.10);
    --mp-tinta: #eef1f6;
    --mp-tinta-2: #b6bdc9;
    --mp-ocupado: #3a3f4b;
    --mp-ocupado-2: #4a505d;
    --mp-ocupado-tx: #8a93a3;
    --mp-sel-tx: #ffffff;
}

.mp-svg {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    font-family: "Rubik", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
    outline: none;
}

.mp-svg:active {
    cursor: grabbing;
}

.mp-lienzo-rect {
    fill: var(--mp-lienzo);
    stroke: var(--mp-borde);
    stroke-width: 1;
}

.mp-fondo {
    pointer-events: none;
}

/* ---- Asientos, mesas, sofás y zonas ---- */
.mp-el {
    cursor: pointer;
    outline: none;
}

.mp-el .mp-cuerpo {
    stroke: rgba(0, 0, 0, 0.22);
    stroke-width: 1;
    transition: fill 0.12s ease, stroke 0.12s ease;
}

.mp-el .mp-area {
    fill-opacity: 0.38;
    stroke-width: 2;
    stroke-dasharray: 8 5;
}

.mp-el .mp-rayas {
    fill: none;
    stroke: rgba(0, 0, 0, 0.12);
    stroke-width: 2;
    stroke-dasharray: 2 10;
    pointer-events: none;
}

.mp-el .mp-silla,
.mp-el .mp-brazo {
    stroke: rgba(0, 0, 0, 0.18);
    stroke-width: 1;
    transition: fill 0.12s ease;
}

.mp-el .mp-respaldo {
    fill: rgba(0, 0, 0, 0.16);
    pointer-events: none;
}

.mp-el .mp-aro {
    fill: none;
    stroke: rgba(0, 0, 0, 0.22);
    stroke-width: 1.5;
    pointer-events: none;
}

.mp-el .mp-sombra {
    stroke: rgba(0, 0, 0, 0.2);
    stroke-width: 2;
    fill: none;
    pointer-events: none;
}

.mp-tx {
    font-weight: 700;
    pointer-events: none;
    letter-spacing: 0.01em;
}

.mp-tx-area {
    fill: var(--mp-tinta);
    paint-order: stroke;
    stroke: var(--mp-lienzo);
    stroke-width: 3px;
    stroke-linejoin: round;
}

.mp-el .mp-ok,
.mp-el .mp-x {
    display: none;
    pointer-events: none;
}

.mp-el .mp-ok circle {
    fill: #ffffff;
    stroke: var(--mp-sel);
    stroke-width: 1.5;
}

.mp-el .mp-ok path {
    fill: none;
    stroke: var(--mp-sel);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mp-el .mp-x path {
    fill: none;
    stroke: var(--mp-ocupado-tx);
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.55;
}

.mp-el.libre:hover .mp-cuerpo {
    stroke: var(--mp-tinta);
    stroke-width: 2;
}

.mp-el:focus-visible .mp-cuerpo {
    stroke: var(--mp-foco);
    stroke-width: 3;
}

.mp-el.elegido .mp-cuerpo,
.mp-el.elegido .mp-silla,
.mp-el.elegido .mp-brazo {
    fill: var(--mp-sel) !important;
}

.mp-el.elegido .mp-area {
    fill-opacity: 0.55;
    stroke: var(--mp-sel) !important;
    stroke-dasharray: none;
}

.mp-el.elegido .mp-tx {
    fill: var(--mp-sel-tx) !important;
}

.mp-el.elegido .mp-tx-area {
    fill: var(--mp-tinta) !important;
}

.mp-el.elegido .mp-ok {
    display: inline;
}

.mp-el.ocupado {
    cursor: not-allowed;
}

.mp-el.ocupado.ver {
    cursor: pointer;
}

.mp-el.ocupado .mp-cuerpo,
.mp-el.ocupado .mp-silla,
.mp-el.ocupado .mp-brazo {
    fill: var(--mp-ocupado) !important;
}

.mp-el.ocupado .mp-silla,
.mp-el.ocupado .mp-brazo {
    fill: var(--mp-ocupado-2) !important;
}

.mp-el.ocupado .mp-area {
    stroke: var(--mp-ocupado-2) !important;
}

.mp-el.ocupado .mp-tx {
    fill: var(--mp-ocupado-tx) !important;
    stroke: none;
}

.mp-el.ocupado .mp-x {
    display: inline;
}

.mp-el.ocupado.ver:hover .mp-cuerpo {
    stroke: var(--mp-tinta);
    stroke-width: 2;
}

.mp-el.no {
    cursor: default;
}

.mp-el.atenuado {
    opacity: 0.25;
}

.mp-el.otro {
    opacity: 0.5;
    cursor: pointer;
}

.mp-el.marcado .mp-cuerpo {
    stroke: var(--mp-marca) !important;
    stroke-width: 3 !important;
    stroke-dasharray: 5 3;
}

/* ---- Decoración ---- */
.mp-deco {
    pointer-events: none;
}

.mp-deco-caja {
    stroke: rgba(0, 0, 0, 0.12);
    stroke-width: 1;
}

.mp-d-texto .mp-deco-caja {
    fill: transparent;
    stroke: none;
}

.mp-d-zona .mp-deco-caja {
    stroke-width: 2;
    stroke-dasharray: 10 6;
}

.mp-deco-tx {
    font-weight: 800;
    letter-spacing: 0.06em;
}

.mp-deco-libre {
    fill: var(--mp-tinta);
    letter-spacing: 0;
    font-weight: 700;
}

.mp-deco-fila {
    fill: var(--mp-tinta-2);
    font-weight: 700;
    letter-spacing: 0;
}

/* ---- Juntados (taquilla) ---- */
.mp-grupo {
    pointer-events: none;
}

.mp-grupo-caja {
    fill-opacity: 0.07;
    stroke-width: 2.5;
    stroke-dasharray: 9 5;
}

.mp-grupo-tx {
    fill: #ffffff;
    font-weight: 800;
}

/* ---- Plano del evento: cada producto es una pieza ---- */
.mp-pieza-borde {
    fill: transparent;
    stroke: var(--mp-borde);
    stroke-width: 2;
    stroke-dasharray: 10 8;
}

.mp-pieza.activa .mp-pieza-borde {
    stroke: var(--mp-sel);
    stroke-opacity: 0.55;
}

.mp-pieza-tag rect {
    fill: var(--mp-tinta);
    opacity: 0.85;
}

.mp-pieza-tag text {
    fill: var(--mp-lienzo);
    font-weight: 800;
}

.mp-pieza.activa .mp-pieza-tag rect {
    fill: var(--mp-sel);
    opacity: 1;
}

.mp-pieza.activa .mp-pieza-tag text {
    fill: #ffffff;
}

/* Marco de selección (Mayús + arrastrar) */
.mp-marco {
    position: absolute;
    border: 1.5px dashed var(--mp-sel);
    background: rgba(42, 120, 214, 0.10);
    pointer-events: none;
    border-radius: 4px;
}

/* Botones de zoom sobre el dibujo */
.mp-ctrl {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.mp-ctrl button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #1d2129;
    color: #eef1f6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    padding: 0;
}

.mp-ctrl .material-symbols-outlined,
.mp-ctrl .ms {
    font-size: 22px;
    line-height: 1;
}

/* ==========================================================================
   COMPRA (appself/detalles.html): mapa del producto en la ventana de compra
   perfil.css da a todos los botones width:100%, margen y relleno grandes: aquí cada botón lleva sus medidas
   ========================================================================== */
.mpc {
    --mpc-sel: var(--cc-3, #007bff);
    font-family: 'Rubik', sans-serif;
    color: #e6e6e6;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
}

.mpc :where(button) {
    width: auto;
    margin: 0;
    font-family: inherit;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: normal;
}

.mpc .mp-host {
    --mp-sel: var(--cc-3, #007bff);
}

.mpc [hidden] {
    display: none !important;
}

/* Zonas y precios: todas a la vista y compactas (en rejilla: dos columnas en el móvil, más en pantallas anchas) */
.mpc-cats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    align-items: stretch;
    gap: 6px;
}

.mpc-leyenda {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 0 2px;
}

.mpc-cat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #f1f1f1;
    border-radius: 10px;
    padding: 5px 10px 5px 8px;
    font-size: 12.5px;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.mpc-cat:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.09);
}

.mpc-cat .punto {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.mpc-cat-txt {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* El precio nunca se corta: si no cabe, baja de línea entero */
.mpc-cat-txt b {
    font-weight: 600;
    color: #fff;
    overflow-wrap: anywhere;
}

.mpc-cat-txt b span {
    font-weight: 500;
    color: #d4d6db;
    white-space: nowrap;
}

.mpc-cat-txt small {
    color: #a9adb5;
    font-size: 11.5px;
}

.mpc-cat.activa {
    border-color: var(--mpc-sel);
    background: rgba(255, 255, 255, 0.12);
}

.mpc-cat.otro {
    border-style: dashed;
}

.mpc-cat.agotada {
    opacity: 0.5;
}

.mpc-ley {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 4px;
    font-size: 12px;
    color: #a9adb5;
}

.mpc-ley .punto {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.mpc .punto.ocu {
    background: #3a3f4b;
}

.mpc .punto.sel {
    background: var(--mpc-sel);
}

.mpc-visor {
    position: relative;
    height: min(60vh, 560px);
    min-height: 300px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.mpc-visor > .mp-host {
    position: absolute;
    inset: 0;
}

.mpc-ayuda {
    position: absolute;
    left: 10px;
    bottom: 10px;
    right: 64px;
    font-size: 12px;
    color: #c9c9c9;
    background: rgba(20, 22, 26, 0.72);
    border-radius: 10px;
    padding: 6px 10px;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 2;
}

.mpc-ayuda.oculta {
    opacity: 0;
}

.mpc-info {
    font-size: 13px;
    color: #d6d6d6;
}

.mpc-info:empty {
    display: none;
}

.mpc-info b {
    color: #fff;
}

/* Pantalla completa: el mapa ocupa la ventana, con una cabecera y un pie pequeños */
.mpc.completa {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    margin: 0;
    gap: 10px;
    background: #15181e;
    padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.mpc.completa .mpc-cats {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

.mpc.completa .mpc-cats::-webkit-scrollbar {
    display: none;
}

.mpc.completa .mpc-cat,
.mpc.completa .mpc-leyenda {
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.mpc.completa .mpc-cat-txt b,
.mpc.completa .mpc-cat-txt small {
    white-space: nowrap;
}

.mpc.completa .mpc-visor {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

.mpc-cabecera,
.mpc-pie-completa {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fff;
}

.mpc.completa .mpc-cabecera,
.mpc.completa .mpc-pie-completa {
    display: flex;
}

.mpc-cabecera b {
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mpc-cabecera button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 999px;
    padding: 7px 14px 7px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.mpc-cabecera button .material-symbols-outlined {
    font-size: 18px;
}

.mpc-pie-completa {
    font-size: 14px;
}

.mpc-pie-completa button {
    flex: 0 0 auto;
    min-width: 140px;
    border: 0;
    border-radius: 12px;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 700;
    background: var(--mpc-sel);
    color: #fff;
    cursor: pointer;
}

/* Lista de elegidos y total (los mismos ids de siempre: #selected-seats, #counter, #total, #checkout-button) */
#seats .booking-details.mpc-resumen {
    margin-top: 18px;
}

.mpc-resumen .resumen {
    padding: 10px 14px !important;
    border-radius: 12px !important;
}

.mpc-resumen ul#selected-seats {
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 0;
    margin: 0;
    color: #e6e6e6 !important;
}

.mpc-resumen ul#selected-seats > li {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 5px 10px 5px 6px;
    font-size: 13px;
}

.mpc-resumen ul#selected-seats > li > div {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

/* Siempre un círculo: con nombres largos (dos líneas) la fila no lo puede estrechar */
.mpc-resumen .cancel-cart-item {
    float: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(252, 121, 121, 0.16);
}

.mpc-resumen .cancel-cart-item span {
    display: block;
    width: 16px;
    height: 16px;
    font-size: 16px !important;
    line-height: 16px;
    overflow: hidden;
    color: #ff8a8a;
}

.mpc-resumen ul#selected-seats:empty:after {
    content: "Toca en el mapa lo que quieras reservar";
    color: #a9adb5;
}

/* Ordenador: la ventana de compra más ancha mientras se elige (#id02.mpc-ancha, js/mapa.compra.js) y, con sitio,
   el mapa a la izquierda y lo elegido con «Continuar» a la derecha */
@media (min-width: 768px) {
    body.dtv2 #id02.mpc-ancha .modal-content {
        max-width: min(1180px, calc(100vw - 48px)) !important;
    }

    body.dtv2 #id02.mpc-ancha .contain-form {
        width: calc(100% - 64px) !important;
        padding-bottom: 12px;
    }

    #id02.mpc-ancha .mpc-visor {
        height: min(64vh, 640px);
    }
}

@media (min-width: 992px) {
    body.dtv2 #id02.mpc-ancha #seats {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 300px;
        column-gap: 28px;
        align-items: start;
    }

    body.dtv2 #id02.mpc-ancha #legend {
        display: none !important;
    }

    body.dtv2 #id02.mpc-ancha #mapZon {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

    body.dtv2 #id02.mpc-ancha #seats .booking-details.mpc-resumen {
        grid-column: 2;
        grid-row: 1;
        margin-top: 4px;
        position: sticky;
        top: 52px;
    }

    /* Que el mapa quepa en la ventana sin bajar: lo de encima (título, aviso del plano y zonas) ocupa unos 290 px */
    #id02.mpc-ancha .mpc-visor {
        height: clamp(380px, calc(100vh - 300px), 700px);
    }

    body.dtv2 #id02.mpc-ancha .mpc-cats {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }

    body.dtv2 #id02.mpc-ancha #checkout-button {
        font-size: 17px !important;
        padding: 14px 20px;
    }
}

/* «¿Cuántas personas?» de las zonas con plazas */
.mpc-personas {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(10, 12, 16, 0.55);
    padding: 12px;
}

.mpc-personas-caja {
    width: min(420px, 100%);
    background: #23262d;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 16px 18px 14px;
    color: #f1f1f1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mpc-personas-tit {
    font-size: 16px;
}

.mpc-personas-caja small {
    color: #b9bcc4;
    font-size: 12.5px;
}

.mpc-personas-preg {
    margin: 8px 0 0;
    font-size: 14px;
    text-align: center;
}

.mpc-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.mpc-stepper button {
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mpc-stepper button:disabled {
    opacity: 0.35;
    cursor: default;
}

.mpc-stepper output {
    font-size: 30px;
    font-weight: 700;
    min-width: 44px;
    text-align: center;
}

.mpc-personas-total {
    margin: 0;
    text-align: center;
    font-size: 14px;
    color: #d6d6d6;
}

.mpc-personas-total b {
    color: #fff;
    font-size: 18px;
}

.mpc-personas-acc {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.mpc-personas-acc button {
    flex: 1;
    border: 0;
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.mpc-personas-acc button.primario {
    background: var(--mpc-sel);
}

.mpc-personas-acc button.quitar {
    color: #ff9c9c;
}

/* Listado de productos de la página del evento: resumen de las zonas de un producto con mapa */
.zonasInfo {
    display: block;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
    margin-top: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .mp-el .mp-cuerpo,
    .mp-el .mp-silla,
    .mpc-ayuda {
        transition: none;
    }
}
