/* Página de compra: retoques de diseño (marketing, fase 1).
 * Todo va bajo body.dtv2: quitando esa clase de detalles.html la página queda exactamente como antes.
 * - Casillas de condiciones y comunicaciones (discretas) y resumen del pedido más legible
 * - Medios de pago (tarjetas, Google Pay y Apple Pay) encima del botón de pagar
 * - Ventanas (compra, lista, avisos de bootbox) fijas a la pantalla: el CSS de Onsen las dejaba en position:absolute con
 *   la altura de toda la página, así que los avisos salían en mitad de la página y al cerrarlos había que volver a subir
 * - Ordenador (≥ 1024 px): cartel vertical, datos del evento, información, géneros y dress code a la izquierda (fijos
 *   al bajar); entradas y el resto a la derecha
 * - Sin scroll lateral en el móvil (anuncio y contenedores de ancho fijo)
 * Los colores salen de las variables del tema de cada promotor (--cc-1, --cc-2…) con los de siempre por defecto. */

/* ---------- Casillas: condiciones (obligatoria) y comunicaciones (opcional) ---------- */
body.dtv2 .dt-acepta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    transition: border-color .2s, box-shadow .2s;
}

body.dtv2 .dt-acepta.dt-acepta-falta {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

body.dtv2 .dt-check {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin: 0;
    cursor: pointer;
    font-family: 'Rubik', sans-serif;
    font-weight: 400;
    font-size: 12.5px;
    line-height: 1.4;
    color: #a8a8a8;
    text-align: left;
}

body.dtv2 .dt-check input[type="checkbox"] {
    -webkit-appearance: auto;
    appearance: auto;
    flex: 0 0 auto;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    max-width: 16px;
    margin: 1px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 3px !important;
    background: none !important;
    box-shadow: none !important;
    accent-color: var(--cc-2, #20a6ff);
    cursor: pointer;
}

body.dtv2 .dt-check span {
    flex: 1 1 auto;
    min-width: 0;
    color: inherit !important;
}

body.dtv2 .dt-check b {
    color: #c9c9c9;
    font-weight: 600;
}

body.dtv2 .dt-check small {
    display: block;
    margin-top: 1px;
    color: #7d7d7d !important;
    font-size: 11px;
}

body.dtv2 .dt-check a {
    color: var(--cc-1, #1ef8ff) !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

body.dtv2 .dt-acepta-aviso {
    margin: 0 !important;
    color: #ff8a8a !important;
    font-size: 12px;
    font-family: 'Rubik', sans-serif;
}

/* Sin aceptar las condiciones los botones de pago se ven apagados (al pulsarlos se avisa) */
body.dtv2 #stripe.dt-sin-aceptar .pagar {
    opacity: 0.55;
}

/* En la ventana de las listas (#id01) */
body.dtv2 .dt-acepta-lista {
    margin: 4px auto 0;
}

/* ---------- Resumen del pedido y código de descuento: legibles (antes casi apagados) ---------- */
body.dtv2 #id02 #titPago,
body.dtv2 #id02 #cuenta {
    color: #cfcfcf !important;
}

body.dtv2 #id02 #cuenta small {
    color: #a8a8a8 !important;
}

body.dtv2 #id02 #cuenta b {
    color: #ececec;
}

body.dtv2 #id02 #cuenta #totPaga {
    color: #fff;
    font-size: 1.06em;
}

body.dtv2 #tengoCupon {
    font-size: 13px;
}

body.dtv2 #tengoCupon a {
    opacity: 1 !important;
}

/* ---------- Medios de pago encima del botón ---------- */
body.dtv2 .dt-pagos {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 2px;
}

body.dtv2 .dt-pago-tarjetas {
    height: 30px;
    width: auto;
}

body.dtv2 .dt-pago-marca {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    min-width: 46px;
    padding: 0 6px;
    border-radius: 4px;
    background: #fff;
    color: #000;
    line-height: 1;
}

body.dtv2 .dt-pago-marca i {
    font-size: 30px;
    line-height: 1;
}

/* ---------- Ventana de las condiciones (bootbox) ---------- */
body.dtv2 .dt-condiciones {
    max-height: 60vh;
    overflow-y: auto;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
    color: #d5d5d5;
}

body.dtv2 .dt-condiciones h6 {
    margin: 4px 0 8px;
    color: #fff;
    font-weight: 700;
    font-family: 'Rubik', sans-serif;
}

body.dtv2 .dt-condiciones p {
    color: #c9c9c9 !important;
    margin-bottom: 12px;
}

body.dtv2 .dt-condiciones .dt-condiciones-cocotea {
    margin-top: 12px;
    font-size: 12px;
    color: #9b9b9b !important;
}

body.dtv2 .dt-condiciones a {
    color: var(--cc-1, #1ef8ff) !important;
}

/* ---------- Ventanas fijas a la pantalla (compra, lista, cartel ampliado y avisos de bootbox) ----------
 * Onsen pone .modal en position:absolute con la altura de toda la página: los avisos se centraban en mitad de la
 * página (el navegador saltaba hasta ellos) y la ventana de compra o de la lista se quedaba atrás al cerrarlos.
 * Mismo arreglo que ya tenían los álbumes (.modal.modalFotos en detalles.css) */
body.dtv2 .modal.bootbox,
body.dtv2 #id01.modal,
body.dtv2 #id02.modal,
body.dtv2 #myModalAmp.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ---------- Avisos y confirmaciones (bootbox): centrados en la pantalla, botones redondeados ---------- */
body.dtv2 .bootbox .modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

body.dtv2 .bootbox .modal-content {
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    margin: auto !important;
    width: 100%;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
}

body.dtv2 .bootbox .modal-header,
body.dtv2 .bootbox .modal-footer {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dtv2 .bootbox .modal-header {
    align-items: center;
}

/* El aspa en su sitio cuando hay título (perfil.css la ponía en position:absolute y quedaba en medio) */
body.dtv2 .bootbox .modal-header .bootbox-close-button {
    position: static !important;
    top: auto !important;
    margin: 0 0 0 auto !important;
    padding: 0 4px !important;
    font-size: 28px !important;
    line-height: 1 !important;
    opacity: .75;
    order: 2;
}

body.dtv2 .bootbox .modal-title {
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    color: #fff;
}

body.dtv2 .bootbox .bootbox-body {
    line-height: 1.5;
}

body.dtv2 .bootbox .modal-footer {
    gap: 8px;
    flex-wrap: wrap;
}

body.dtv2 .bootbox .modal-footer .btn {
    border-radius: 999px !important;
    padding: 10px 20px;
    font-weight: 600;
    margin: 0 !important;
}

body.dtv2 .bootbox .modal-footer .btn-secondary,
body.dtv2 .bootbox .modal-footer .btn-default {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    color: #e6e6e6 !important;
}

@media (min-width: 576px) {
    body.dtv2 .bootbox .modal-dialog {
        max-width: 440px !important;
        min-height: calc(100% - 3.5rem);
    }

    body.dtv2 .dt-modal-condiciones .modal-dialog {
        max-width: 560px !important;
    }
}

@media (max-width: 575px) {
    body.dtv2 .bootbox .modal-dialog {
        margin: 12px !important;
        min-height: calc(100% - 24px);
    }

    /* En el móvil los botones ocupan el ancho, el principal abajo (al alcance del pulgar) */
    body.dtv2 .bootbox .modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    body.dtv2 .bootbox .modal-footer .btn {
        width: 100%;
    }
}

/* Aviso de «copiado» (compartir): centrado de verdad */
body.dtv2 #aviso {
    margin-left: 0 !important;
    transform: translate(-50%, -50%);
    max-width: calc(100vw - 32px);
    text-align: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* ---------- Ventana de compra (#id02) ---------- */
body.dtv2 #id02 .modal-content {
    border-radius: 22px !important;
    max-height: calc(100dvh - 32px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* El aspa de cerrar siempre a mano al bajar */
body.dtv2 #id02 #cer {
    position: sticky;
    top: 0;
    z-index: 6;
}

body.dtv2 #id02 #cer .close {
    background: rgba(27, 27, 27, 0.85);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    line-height: 36px !important;
    text-align: center;
    padding: 0 !important;
}

@media (min-width: 768px) {
    body.dtv2 #id02 .modal-content {
        max-width: 600px !important;
        width: calc(100% - 48px) !important;
        margin: 16px auto !important;
    }

    body.dtv2 #id02 .contain-form {
        width: 86% !important;
    }
}

@media (max-width: 767px) {
    body.dtv2 #id02 .modal-content {
        width: calc(100% - 16px) !important;
        max-width: none !important;
        margin: 8px auto !important;
        max-height: calc(100dvh - 16px) !important;
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ---------- Flecha de los eventos de varios días, a la altura del texto ---------- */
body.dtv2 #fechaListado .material-symbols-outlined,
body.dtv2 .dt-lat-fecha .material-symbols-outlined {
    font-size: 1.05em !important;
    line-height: 1 !important;
    vertical-align: -0.16em;
    width: auto !important;
    height: auto !important;
}

/* ---------- Sin scroll lateral ---------- */
body.dtv2 ins.adsbygoogle {
    max-width: 100% !important;
}

@media (max-width: 760px) {
    body.dtv2 .container {
        width: auto !important;
        max-width: 100% !important;
    }

    body.dtv2 .entraIframe,
    body.dtv2 #entraIframe {
        max-width: 100% !important;
    }

    body.dtv2 footer .container {
        width: auto !important;
    }
}

body.dtv2 #mapa {
    max-width: 100%;
}

/* El bloque de la izquierda solo existe en ordenador */
body.dtv2 .dt-lateral {
    display: none;
}

/* ---------- Ordenador: dos columnas ---------- */
@media (min-width: 1024px) {

    /* En ordenador la que se desplaza es la página entera: sin el overflow de #contenido el bloque de la izquierda
       puede quedarse fijo (sticky) respecto a la ventana */
    body.dtv2 #contenido {
        display: grid !important;
        grid-template-columns: minmax(300px, 400px) minmax(0, 700px);
        column-gap: 48px;
        justify-content: center;
        align-content: start;
        align-items: start;
        padding: 32px 32px 64px;
        box-sizing: border-box;
        overflow: visible !important;
        height: auto !important;
    }

    body.dtv2 #contenido > * {
        grid-column: 2;
        min-width: 0;
    }

    /* Izquierda: cartel, datos del evento, información, géneros y dress code. Fija al bajar; si es más alta que la
       pantalla, baja con la página hasta que se ve su final y ahí se queda (top negativo que calcula detalles.js) */
    body.dtv2 #contenido > .tabla {
        grid-column: 1;
        grid-row: 1 / span 40;
        position: sticky !important;
        top: var(--dt-lat-top, 32px) !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        align-self: start;
    }

    /* Cartel vertical */
    body.dtv2 .tabla .imgTop {
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        aspect-ratio: 4 / 5;
        border-radius: 22px !important;
        overflow: hidden;
        background-size: cover !important;
        background-position: center !important;
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    }

    body.dtv2 .tabla .pubFot {
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        border-radius: 22px !important;
        background-position: center !important;
    }

    body.dtv2 .tabla .compartir {
        margin-top: 0 !important;
        position: absolute;
        right: 6px;
        bottom: 10px;
        width: auto;
    }

    body.dtv2 .dt-lateral {
        display: block;
        margin-top: 20px;
        padding: 0 4px;
        font-family: 'Rubik', sans-serif;
        color: #fff;
    }

    body.dtv2 .dt-lat-org {
        margin: 0 0 6px;
        color: #8f8f8f;
        font-size: 14px;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    body.dtv2 .dt-lat-tit {
        margin: 0 0 8px;
        font-size: 28px;
        line-height: 1.15;
        font-weight: 700;
        color: #fff;
        word-break: break-word;
    }

    body.dtv2 .dt-lat-fecha {
        margin: 0;
        color: #cfcfcf;
        font-size: 15px;
        line-height: 1.5;
    }

    body.dtv2 .dt-lat-fecha b {
        color: var(--cc-1, #1ef8ff);
    }

    body.dtv2 .dt-lat-volver {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        width: auto !important;
        margin-top: 14px;
        padding: 8px 14px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: transparent;
        color: #e6e6e6;
        font-family: 'Rubik', sans-serif;
        font-size: 13px;
        cursor: pointer;
    }

    body.dtv2 .dt-lat-volver:hover {
        border-color: var(--cc-1, #1ef8ff);
        color: var(--cc-1, #1ef8ff) !important;
    }

    /* Información del evento o del promotor, géneros y dress code: las tarjetas de siempre, movidas aquí por
       detalles.js y con un estilo más sobrio */
    body.dtv2 .dt-lat-info {
        display: flex;
        flex-direction: column;
        gap: 18px;
        margin-top: 22px;
        text-align: left;
    }

    body.dtv2 .dt-lat-info > div {
        margin: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        text-align: left !important;
    }

    /* detalles.css esconde géneros y dress code en pantallas grandes; aquí se ven si detalles.js no los ha ocultado */
    body.dtv2 .dt-lat-info > .cont1:not([style*="display: none"]):not([style*="display:none"]) {
        display: block !important;
    }

    body.dtv2 .dt-lat-info h3,
    body.dtv2 .dt-lat-info h4,
    body.dtv2 .dt-lat-info .infoBL {
        margin: 0 0 6px !important;
        padding: 0 !important;
        background: none !important;
        border: 0 !important;
        width: auto !important;
        text-align: left !important;
        color: #8f8f8f !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        font-family: 'Rubik', sans-serif !important;
    }

    body.dtv2 .dt-lat-info .infoBL h4 {
        margin: 0 !important;
    }

    body.dtv2 .dt-lat-info p {
        margin: 0 !important;
        padding: 0 !important;
        color: #d6d6d6 !important;
        font-size: 14px !important;
        line-height: 1.55 !important;
        text-align: left !important;
        font-weight: 400 !important;
    }

    body.dtv2 .dt-lat-info #info01 {
        margin: 0 !important;
        width: auto !important;
    }

    body.dtv2 .dt-lat-info br {
        display: none;
    }

    body.dtv2 .dt-lat-info #info01 br {
        display: inline;
    }

    /* Derecha: la lista de siempre, sin el hueco que dejaba el cartel encima */
    body.dtv2 #contenido > .tablas {
        position: relative;
        max-width: none;
        width: 100%;
        margin: 0;
    }

    body.dtv2 .tabcontenido {
        margin: 0 !important;
        width: 100% !important;
        border-radius: 22px !important;
        padding-top: 8px;
    }

    /* Sin los saltos de línea de arriba (dejaban un hueco al quitar el título, que ya está a la izquierda) */
    body.dtv2.dt-con-lateral #ENTRADAS > br:first-child,
    body.dtv2.dt-con-lateral #ENTRADAS .sesiones > br {
        display: none;
    }

    /* El organizador, el título y la fecha ya están a la izquierda (en la portada del promotor, solo el organizador) */
    body.dtv2.dt-con-lateral #pubNam,
    body.dtv2.dt-con-evento #titListado,
    body.dtv2.dt-con-evento #fechaListado,
    body.dtv2.dt-con-evento #backEvent {
        display: none !important;
    }
}
