/*
 * WA Tickets — selector de entradas (2.9.22, D1).
 * Toma los colores del tema wopytickets (--wt-*); con otro tema, colores claros neutros.
 */

.wtk-compra,
.wtk-fechas,
.wtk-compra-aviso,
.wa-funcion-elegida {
    --wtk-fondo: var(--wt-bg-card, #ffffff);
    --wtk-fondo-2: var(--wt-bg-surface, #f4f5f7);
    --wtk-texto: var(--wt-text, #1d2330);
    --wtk-suave: var(--wt-text-secondary, #5d6677);
    --wtk-titulo: var(--wt-text-heading, #10131a);
    --wtk-borde: var(--wt-border, rgba(16, 19, 26, 0.12));
    --wtk-borde-fuerte: var(--wt-glass-border, rgba(16, 19, 26, 0.22));
    --wtk-primario: var(--wt-primary, #4f46e5);
    --wtk-primario-rgb: var(--wt-primary-rgb, 79, 70, 229);
    --wtk-boton: var(--wt-gradient, var(--wtk-primario));
    --wtk-ok: var(--wt-secondary, #0f9d75);
    --wtk-ok-rgb: var(--wt-secondary-rgb, 15, 157, 117);
    --wtk-alerta: var(--wt-accent, #d93d42);
    --wtk-alerta-rgb: var(--wt-accent-rgb, 217, 61, 66);
    --wtk-aviso: #f5a524;
    --wtk-radio: var(--wt-radius, 12px);
    --wtk-radio-chico: var(--wt-radius-sm, 8px);
    --wtk-fuente-titulo: var(--wt-font-heading, inherit);
    box-sizing: border-box;
}

.wtk-compra *,
.wtk-compra *::before,
.wtk-compra *::after,
.wtk-fechas * {
    box-sizing: border-box;
}

/* El atributo hidden manda aunque un tema le ponga display a la etiqueta. */
.wtk-compra [hidden],
.wtk-fechas[hidden],
.wtk-fechas [hidden],
.wtk-grupo[hidden] {
    display: none !important;
}

.wtk-compra {
    margin: 0 0 28px;
    color: var(--wtk-texto);
}

.wtk-compra-aviso {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px dashed var(--wtk-borde-fuerte);
    border-radius: var(--wtk-radio);
    color: var(--wtk-suave);
    background: transparent;
}

/* ── Fechas (chips) ─────────────────────────────────────────── */

/*
 * width 0 + min-width 100%: ocupa todo el ancho pero no aporta el ancho de su contenido. Si no, la
 * tira de chips (que no se corta) ensancha la grilla del tema y la página entera en el celular.
 */
.wtk-fechas {
    width: 0;
    min-width: 100%;
    margin: 0 0 18px;
}

.wtk-fechas__titulo {
    display: block;
    margin: 0 0 10px;
    font-family: var(--wtk-fuente-titulo);
    font-size: 1rem;
    font-weight: 700;
    color: var(--wtk-titulo);
}

.wtk-fechas__chips {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 2px 2px 8px;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.wtk-fechas__chips::-webkit-scrollbar {
    display: none;
}

.wtk-chip {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-width: 96px;
    min-height: 56px;
    margin: 0;
    padding: 8px 16px;
    border: 1px solid rgba(var(--wtk-primario-rgb), 0.4);
    border-radius: var(--wtk-radio);
    background: var(--wtk-fondo);
    color: var(--wtk-texto);
    font: inherit;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    scroll-snap-align: start;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.wtk-chip:hover {
    border-color: var(--wtk-primario);
}

.wtk-chip:focus-visible,
.wtk-cant__btn:focus-visible,
.wtk-barra__comprar:focus-visible,
.wtk-fechas__select:focus-visible {
    outline: 2px solid var(--wtk-primario);
    outline-offset: 2px;
}

.wtk-chip[aria-pressed="true"] {
    border-color: transparent;
    background: var(--wtk-boton);
    color: #ffffff;
}

.wtk-chip__dia {
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: capitalize;
}

.wtk-chip__hora,
.wtk-chip__nombre {
    font-size: 0.8rem;
    opacity: 0.85;
}

.wtk-chip__nombre {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wtk-chip--paso:not([aria-pressed="true"]) {
    opacity: 0.6;
}

.wtk-chip__cant {
    position: absolute;
    top: -7px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--wtk-ok);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

.wtk-fechas__select {
    width: 100%;
    max-width: 420px;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--wtk-borde-fuerte);
    border-radius: var(--wtk-radio);
    background: var(--wtk-fondo);
    color: var(--wtk-texto);
    font: inherit;
}

/* ── Funciones y localidades ────────────────────────────────── */

.wtk-grupo {
    margin: 0 0 18px;
}

.wtk-grupo__titulo {
    margin: 0 0 10px;
    font-family: var(--wtk-fuente-titulo);
    font-size: 1rem;
    font-weight: 700;
    color: var(--wtk-titulo);
}

.wtk-grupo__titulo::first-letter {
    text-transform: uppercase;
}

/* Con los chips (JavaScript), la fecha elegida ya está a la vista. */
.wtk-con-fechas .wtk-grupo__titulo {
    display: none;
}

.wtk-locs {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wtk-loc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "info info"
        "precio accion";
    align-items: center;
    gap: 12px 16px;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--wtk-borde);
    border-radius: var(--wtk-radio);
    background: var(--wtk-fondo);
    transition: border-color 0.2s ease;
}

.wtk-loc.is-elegida {
    border-color: rgba(var(--wtk-primario-rgb), 0.65);
}

.wtk-loc__info {
    grid-area: info;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.wtk-loc__nombre {
    font-family: var(--wtk-fuente-titulo);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--wtk-titulo);
    overflow-wrap: anywhere;
}

.wtk-loc__desc {
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--wtk-suave);
    overflow-wrap: anywhere;
}

.wtk-loc__carrito {
    font-size: 0.8rem;
    color: var(--wtk-ok);
}

.wtk-loc__precio {
    grid-area: precio;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wtk-precio {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--wtk-titulo);
}

.wtk-precio del {
    margin-right: 6px;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.6;
}

.wtk-precio ins {
    text-decoration: none;
}

.wtk-loc__cargo {
    font-size: 0.78rem;
    color: var(--wtk-suave);
}

.wtk-loc__accion,
.wtk-cant {
    grid-area: accion;
    justify-self: end;
}

.wtk-estado {
    display: inline-block;
    margin-top: 2px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.wtk-estado--agotada {
    background: rgba(var(--wtk-alerta-rgb), 0.14);
    color: var(--wtk-alerta);
}

.wtk-estado--ultimas {
    background: rgba(245, 165, 36, 0.16);
    color: var(--wtk-aviso);
}

.wtk-estado--tope {
    background: rgba(var(--wtk-primario-rgb), 0.14);
    color: var(--wtk-primario);
}

.wtk-loc--agotada .wtk-loc__nombre,
.wtk-loc--agotada .wtk-precio,
.wtk-loc--agotada .wtk-loc__desc {
    opacity: 0.55;
}

/* ── Cantidad ───────────────────────────────────────────────── */

.wtk-cant {
    display: inline-flex;
    align-items: center;
}

/* Sin JavaScript: un campo numérico común. */
.wtk-cant__input {
    width: 76px;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--wtk-borde-fuerte);
    border-radius: var(--wtk-radio-chico);
    background: var(--wtk-fondo-2);
    color: var(--wtk-titulo);
    font: inherit;
    font-weight: 700;
    text-align: center;
}

/* Con JavaScript: − y + de 44 px. */
.wtk-compra--js .wtk-cant {
    border: 1px solid var(--wtk-borde-fuerte);
    border-radius: 999px;
    background: var(--wtk-fondo-2);
}

.wtk-compra--js .wtk-cant__input {
    width: 3.2ch;
    min-width: 34px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
    appearance: textfield;
}

.wtk-compra--js .wtk-cant__input::-webkit-outer-spin-button,
.wtk-compra--js .wtk-cant__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wtk-cant__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--wtk-titulo);
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.wtk-cant__btn:hover:not(:disabled) {
    background: rgba(var(--wtk-primario-rgb), 0.14);
}

.wtk-cant__mas:not(:disabled) {
    color: var(--wtk-primario);
}

.wtk-cant__btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ── Mapas ──────────────────────────────────────────────────── */

.wtk-loc--mapa .wtk-loc__accion {
    max-width: 100%;
}

.wtk-loc--mapa .wa-seating-popup-container {
    display: block;
}

/* ── Barra de compra ────────────────────────────────────────── */

.wtk-compra__vacio {
    margin: 0 0 14px;
    color: var(--wtk-suave);
}

.wtk-barra {
    position: sticky;
    bottom: 8px;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 14px 0 0;
    padding: 12px 12px 12px 18px;
    border: 1px solid var(--wtk-borde-fuerte);
    border-radius: var(--wtk-radio);
    background: var(--wtk-fondo-2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.wtk-barra__resumen {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wtk-barra__total {
    font-weight: 700;
    color: var(--wtk-titulo);
    font-variant-numeric: tabular-nums;
}

.wtk-barra__detalle {
    font-size: 0.78rem;
    color: var(--wtk-suave);
}

.wtk-barra__comprar {
    min-height: 48px;
    margin: 0 0 0 auto;
    padding: 0 30px;
    border: 0;
    border-radius: 999px;
    background: var(--wtk-boton);
    color: #ffffff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(var(--wtk-primario-rgb), 0.35);
    transition: transform 0.15s ease, opacity 0.2s ease;
}

.wtk-barra__comprar:hover:not(:disabled) {
    transform: translateY(-1px);
}

.wtk-barra__comprar:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.wtk-barra__comprar.is-cargando {
    opacity: 0.75;
    cursor: progress;
}

.wtk-barra__error,
.wtk-compra__error {
    flex: 1 0 100%;
    margin: 0;
    padding: 10px 14px;
    border-radius: var(--wtk-radio-chico);
    background: rgba(var(--wtk-alerta-rgb), 0.14);
    color: var(--wtk-alerta);
    font-size: 0.9rem;
    font-weight: 600;
}

.wtk-compra__error {
    margin: 0 0 14px;
}

/* ── «Elegí la fecha» con muchas funciones (M4) ─────────────── */

.wa-funcion-elegida {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    width: 0;
    min-width: 100%;
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid var(--wtk-borde);
    border-radius: var(--wtk-radio);
    background: var(--wtk-fondo);
    color: var(--wtk-texto);
}

.wa-funcion-elegida__etiqueta {
    flex: 1 0 100%;
    font-family: var(--wtk-fuente-titulo);
    font-weight: 700;
    color: var(--wtk-titulo);
}

.wa-funcion-elegida__campos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.wa-funcion-elegida select {
    flex: 1 1 220px;
    min-width: 0;
    max-width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--wtk-borde-fuerte);
    border-radius: var(--wtk-radio-chico);
    background: var(--wtk-fondo-2);
    color: var(--wtk-texto);
    font: inherit;
}

.wa-funcion-elegida .wa-funcion-elegida__ver {
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--wtk-boton);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.wa-funcion-elegida__actual {
    flex: 1 0 100%;
    font-size: 0.875rem;
    color: var(--wtk-suave);
}

.wa-funcion-elegida__aviso,
.wa-funcion-elegida__vacio {
    flex: 1 0 100%;
    margin: 0;
    color: var(--wtk-aviso);
    font-weight: 600;
}

/* ── Pantallas medianas y grandes ───────────────────────────── */

@media (min-width: 640px) {
    .wtk-loc {
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas: "info precio accion";
        gap: 12px 24px;
        padding: 16px 18px;
    }

    .wtk-loc__precio {
        align-items: flex-end;
        text-align: right;
    }

    .wtk-barra {
        padding: 14px 14px 14px 22px;
    }
}

@media (max-width: 380px) {
    .wtk-loc {
        padding: 14px;
    }

    .wtk-barra__comprar {
        padding: 0 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wtk-chip,
    .wtk-loc,
    .wtk-barra__comprar {
        transition: none;
    }
}
