/**
 * Tickets TPV – WordPress plugin styles
 */

/* ── Container ── */
.tickets-tpv-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

.tickets-tpv-container iframe {
    display: block;
    width: 100%;
    border: none;
    transition: height 0.2s ease;
}

/* ── Status messages (shown after Redsys return) ── */
.tickets-tpv-status {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.5;
}

.tickets-tpv-status--ok {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
}

.tickets-tpv-status--ko {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .tickets-tpv-container {
        margin: 0 -15px;
        width: calc(100% + 30px);
    }
}

/* ════════════════════════════════════════════════════════════════
 *  Banner de reserva de la home ("Visita estándar")
 *  Los popovers se mueven a <body>, así que las variables de marca
 *  se declaran también sobre ellos.
 * ════════════════════════════════════════════════════════════════ */
.tickets-tpv-banner-wrap,
.tickets-tpv-banner-popover {
    --tpv-b-primary: #2c3088;
    --tpv-b-text: #1f2937;
    --tpv-b-muted: #6b7280;
    --tpv-b-line: #ececf3;
    --tpv-b-soft: #f6f6fb;
    --tpv-b-radius: 14px;
}

.tickets-tpv-banner-wrap {
    position: relative;
    width: 100%;
    font-size: 15px;
    line-height: 1.45;
    color: var(--tpv-b-text);
}

.tickets-tpv-banner-wrap *,
.tickets-tpv-banner-popover * {
    box-sizing: border-box;
}

.tickets-tpv-banner-bar {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: var(--tpv-b-radius);
    box-shadow: 0 18px 40px rgba(17, 17, 40, .14);
}

/* ── Pestaña superior: colgada por encima de la barra, sin ocupar sitio
      dentro de ella (si no, se solaparía con la primera etiqueta). ── */
.tickets-tpv-banner-tabs {
    position: absolute;
    bottom: 100%;
    left: 18px;
    line-height: 0;
}

.tickets-tpv-banner-tab {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 10px 10px 0 0;
    background: #fff;
    color: var(--tpv-b-text);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.3;
    box-shadow: 0 -8px 20px rgba(17, 17, 40, .07);
}

/* ── Fila de campos ── */
.tickets-tpv-banner-fields {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 8px;
}

.tickets-tpv-banner-field {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 14px 20px;
    border-right: 1px solid var(--tpv-b-line);
    border-radius: 10px;
    transition: background .15s ease;
}

.tickets-tpv-banner-field:last-of-type {
    border-right: none;
}

/* El nombre del monumento es lo más largo: le damos algo más de ancho */
.tickets-tpv-banner-field--select { flex-grow: 1.4; }

.tickets-tpv-banner-field--clickable {
    cursor: pointer;
}

.tickets-tpv-banner-field--clickable:hover,
.tickets-tpv-banner-field--open {
    background: var(--tpv-b-soft);
}

.tickets-tpv-banner-field--disabled {
    cursor: not-allowed;
    opacity: .5;
}

.tickets-tpv-banner-field--disabled:hover {
    background: transparent;
}

.tickets-tpv-banner-field:focus-visible {
    outline: 2px solid var(--tpv-b-primary);
    outline-offset: -2px;
}

.tickets-tpv-banner-field label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tpv-b-muted);
    margin: 0;
    line-height: 1;
}

.tickets-tpv-banner-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.tickets-tpv-banner-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.tickets-tpv-banner-chevron {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--tpv-b-muted);
    transition: transform .18s ease;
}

.tickets-tpv-banner-field--open .tickets-tpv-banner-chevron {
    transform: rotate(180deg);
}

.tickets-tpv-banner-value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 400;
    color: var(--tpv-b-text);
}

.tickets-tpv-banner-value--placeholder {
    color: #9ca3af;
}

/* El <select> nativo, sin apariencia de control de formulario */
.tickets-tpv-banner-field select {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--tpv-b-text);
    padding: 0;
    height: auto;
    cursor: pointer;
    text-transform: uppercase;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.tickets-tpv-banner-field select.tickets-tpv-banner-select--placeholder {
    color: #9ca3af;
}

.tickets-tpv-banner-field select.tickets-tpv-banner-select--placeholder option {
    color: var(--tpv-b-text);
}

.tickets-tpv-banner-field select:focus {
    outline: none;
    box-shadow: none;
}

/* ── Botón "Buscar entradas" ── */
.tickets-tpv-banner-search-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 0 32px;
    border: none;
    border-radius: 10px;
    background: var(--tpv-b-primary);
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.2;
    cursor: pointer;
    transition: filter .15s ease, opacity .15s ease;
}

.tickets-tpv-banner-search-btn:hover:not(:disabled) {
    filter: brightness(1.1);
    color: #fff;
}

.tickets-tpv-banner-search-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.tickets-tpv-banner-search-btn .tickets-tpv-banner-icon {
    width: 18px;
    height: 18px;
}

/* ════════ Popovers ════════
 * Sin alto fijo y sin overflow: el contenido decide la altura, de modo
 * que nunca aparecen barras de scroll dentro del desplegable.
 */
.tickets-tpv-banner-popover {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 99999;
    background: #fff;
    border-radius: var(--tpv-b-radius);
    box-shadow: 0 18px 44px rgba(17, 17, 40, .17);
    padding: 22px 24px;
    cursor: default;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    color: var(--tpv-b-text);
    text-align: left;
}

.tickets-tpv-banner-popover.open {
    display: block;
    animation: tpvBannerPopIn .16s ease-out;
}

@keyframes tpvBannerPopIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tickets-tpv-banner-popover--fecha {
    width: 620px;
    max-width: calc(100vw - 24px);
}

.tickets-tpv-banner-popover--personas {
    width: 380px;
    max-width: calc(100vw - 24px);
}

/* ── Pasos (solo combinados de varios monumentos) ── */
.tpv-banner-cal-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.tpv-banner-cal-step {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--tpv-b-line);
    background: #fff;
    color: var(--tpv-b-muted);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
}

.tpv-banner-cal-step:hover {
    border-color: var(--tpv-b-primary);
}

.tpv-banner-cal-step--active {
    background: var(--tpv-b-primary);
    border-color: var(--tpv-b-primary);
    color: #fff;
}

.tpv-banner-cal-step--done::before {
    content: "✓";
    font-weight: 700;
    color: var(--tpv-b-primary);
}

.tpv-banner-cal-step--active.tpv-banner-cal-step--done::before {
    color: #fff;
}

/* ── Panel: calendario + horarios en dos columnas ── */
.tpv-banner-cal-panel {
    display: flex;
    align-items: flex-start;
    gap: 26px;
}

.tpv-banner-cal-panel[hidden] {
    display: none;
}

.tpv-banner-cal-left {
    flex: 0 0 288px;
    max-width: 288px;
}

.tpv-banner-cal-right {
    flex: 1 1 auto;
    min-width: 0;
}

.tpv-banner-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.tpv-banner-cal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--tpv-b-text);
}

.tpv-banner-cal-prev,
.tpv-banner-cal-next {
    border: none;
    background: transparent;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: var(--tpv-b-muted);
    padding: 0;
    transition: background .15s ease, color .15s ease;
}

.tpv-banner-cal-prev:hover:not(:disabled),
.tpv-banner-cal-next:hover:not(:disabled) {
    background: var(--tpv-b-soft);
    color: var(--tpv-b-primary);
}

.tpv-banner-cal-prev:disabled,
.tpv-banner-cal-next:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.tpv-banner-cal-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    font-size: 14px;
    background: transparent;
}

.tpv-banner-cal-table td,
.tpv-banner-cal-table th {
    border: none;
    padding: 0;
    background: transparent;
}

.tpv-banner-cal-dow {
    text-align: center;
    font-weight: 500;
    color: var(--tpv-b-muted);
    font-size: 12px;
    padding-bottom: 8px;
}

.tpv-banner-cal-day {
    position: relative;
    text-align: center;
    height: 38px;
    vertical-align: middle;
    color: #d1d5db;
    border-radius: 50%;
    font-variant-numeric: tabular-nums;
}

.tpv-banner-cal-day--available {
    color: var(--tpv-b-text);
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}

/* Punto indicador de disponibilidad, como en la referencia */
.tpv-banner-cal-day--available::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #d9a441;
}

.tpv-banner-cal-day--available:hover {
    background: var(--tpv-b-soft);
}

.tpv-banner-cal-day--selected,
.tpv-banner-cal-day--selected:hover {
    background: var(--tpv-b-primary);
    color: #fff;
    font-weight: 600;
}

.tpv-banner-cal-day--selected::after {
    background: #fff;
}

.tpv-banner-cal-day--disabled {
    color: #dcdce4;
    cursor: default;
}

.tpv-banner-cal-loading .tpv-banner-cal-day {
    opacity: .45;
}

/* ── Columna de horarios ── */
.tpv-banner-cal-right-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--tpv-b-muted);
    margin-bottom: 12px;
}

.tpv-banner-sesiones .list-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: none;
}

.tpv-banner-sesiones .sesionclicable {
    flex: 0 1 calc(50% - 5px);
    min-width: 128px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--tpv-b-line) !important;
    border-radius: 10px !important;
    background: #fff;
    font-size: 14px;
    line-height: 1.35;
    color: var(--tpv-b-text);
    cursor: pointer;
    transition: all .15s ease;
}

.tpv-banner-sesiones .sesionclicable:hover {
    border-color: var(--tpv-b-primary) !important;
}

.tpv-banner-sesiones .sesionclicable .badge {
    display: none;
}

.tpv-banner-sesiones .sesionclicable .session-comment {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--tpv-b-muted);
}

.tpv-banner-sesiones .tpv-banner-sesion--last {
    border-color: #e8c07a !important;
}

.tpv-banner-sesiones .tpv-banner-sesion--last::after {
    content: "Últimas plazas";
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #b4791f;
}

.tpv-banner-sesiones .tpv-banner-sesion--selected,
.tpv-banner-sesiones .tpv-banner-sesion--selected:hover {
    background: var(--tpv-b-primary);
    border-color: var(--tpv-b-primary) !important;
    color: #fff;
}

.tpv-banner-sesiones .tpv-banner-sesion--selected .session-comment,
.tpv-banner-sesiones .tpv-banner-sesion--selected::after {
    color: #fff;
}

.tpv-banner-empty,
.tpv-banner-loading {
    padding: 6px 0;
    color: var(--tpv-b-muted);
    font-size: 14px;
}

.tpv-banner-sesiones .alert-tpv-info {
    padding: 0;
    background: none;
    border: none;
    color: var(--tpv-b-muted);
    font-size: 14px;
}

/* ── Popover "Personas": filas de tarifas ── */
.tickets-tpv-banner-popover .list-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    border: none;
}

.tickets-tpv-banner-popover--personas .list-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: none;
    border-bottom: 1px solid var(--tpv-b-line);
    border-radius: 0;
    background: transparent;
    padding: 16px 0;
    margin: 0;
}

.tickets-tpv-banner-popover--personas .list-group-item:first-child {
    padding-top: 0;
}

.tickets-tpv-banner-popover--personas .list-group-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tickets-tpv-banner-popover--personas .font-weight-bold {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: var(--tpv-b-text);
}

.tickets-tpv-banner-popover .d-flex {
    display: flex;
}

.tickets-tpv-banner-popover .justify-content-between {
    justify-content: space-between;
}

.tickets-tpv-banner-popover .align-items-center {
    align-items: center;
}

.tickets-tpv-banner-popover .text-center {
    text-align: center;
}

/* Nombre + precio apilados a la izquierda, como en la referencia */
.tpv-banner-tarifa-nombre {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tpv-banner-tarifa-precio {
    font-size: 14px;
    color: #b4791f;
}

.tickets-tpv-banner-popover--personas .tarifa-info-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tpv-b-muted);
    padding: 0 0 0 5px;
    font-size: 14px;
    line-height: 1;
}

/* Stepper − / + */
.tickets-tpv-banner-popover .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

.tickets-tpv-banner-popover .minusnumberticket,
.tickets-tpv-banner-popover .plusnumberticket {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--tpv-b-line);
    background: #fff;
    color: var(--tpv-b-text);
    font-size: 18px;
    line-height: 1;
    transition: all .15s ease;
}

/* El fragmento de Symphony trae iconos de FontAwesome, que no se carga en
   WordPress: los sustituimos por signos tipográficos. */
.tickets-tpv-banner-popover .minusnumberticket i,
.tickets-tpv-banner-popover .plusnumberticket i {
    display: none;
}

.tickets-tpv-banner-popover .minusnumberticket::before {
    content: "\2212";
}

.tickets-tpv-banner-popover .plusnumberticket::before {
    content: "+";
}

.tickets-tpv-banner-popover .plusnumberticket:hover,
.tickets-tpv-banner-popover .minusnumberticket:hover {
    border-color: var(--tpv-b-primary);
    color: var(--tpv-b-primary);
}

.tickets-tpv-banner-popover .tpv-banner-step-btn--off {
    opacity: .35;
    cursor: not-allowed;
    border-color: var(--tpv-b-line);
    color: var(--tpv-b-text);
}

.tickets-tpv-banner-popover .labelnumbertickets {
    width: 42px !important;
    margin: 0 4px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: var(--tpv-b-text);
    -moz-appearance: textfield;
}

.tickets-tpv-banner-popover .labelnumbertickets::-webkit-outer-spin-button,
.tickets-tpv-banner-popover .labelnumbertickets::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tickets-tpv-banner-popover .labelnumbertickets:focus {
    outline: none;
    box-shadow: none;
}

.tpv-banner-aforo {
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--tpv-b-muted);
}

.tpv-banner-limite-aviso {
    margin-top: 14px;
    padding: 10px 12px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #78350f;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.tickets-tpv-banner-popover--personas .list-group-item.tpv-banner-tarifa-limite-error {
    background: #fdf2f2;
    border-color: #e8b4b4;
}

.tpv-banner-tarifa-info {
    margin: -4px 0 14px;
    padding: 10px 12px;
    background: var(--tpv-b-soft);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--tpv-b-muted);
}

/* ── Responsive ── */
@media (max-width: 980px) {
    .tickets-tpv-banner-fields {
        flex-wrap: wrap;
    }

    .tickets-tpv-banner-field {
        flex: 1 1 220px;
    }

    .tickets-tpv-banner-search-btn {
        flex: 1 1 100%;
        padding: 16px;
    }
}

@media (max-width: 700px) {
    .tickets-tpv-banner-fields {
        flex-direction: column;
        gap: 2px;
    }

    .tickets-tpv-banner-field {
        flex: 1 1 auto;
        border-right: none;
        border-bottom: 1px solid var(--tpv-b-line);
    }

    .tickets-tpv-banner-popover {
        padding: 18px;
    }

    .tpv-banner-cal-panel {
        flex-direction: column;
        gap: 18px;
    }

    .tpv-banner-cal-left {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
    }

    .tpv-banner-sesiones .sesionclicable {
        flex: 1 1 100%;
    }
}