/* Ticket picker — every ticket type with its own quantity. */

.ut-tp {
    --ut-tp-brand: var(--brand-color, #1b1464);
    --ut-tp-brand-light: var(--brand-color-light, #332b86);
    --ut-tp-tint: #f1f0fa;
    --ut-tp-border: #d9d8e3;
    --ut-tp-text: var(--text-color, #404040);
    --ut-tp-muted: #5f5d6e;
    --ut-tp-surface: #fff;
    --ut-tp-amber-bg: #fff4d6;
    --ut-tp-amber-text: #7a4b00;
    --ut-tp-grey-bg: #ececef;
    --ut-tp-grey-text: #4a4a55;
    --ut-tp-error: #b42318;
    container-type: inline-size;
    color: var(--ut-tp-text);
}

/* The theme pins the DMSans variable font to 'wght' 400 on p, li and inputs,
   which overrides font-weight; let font-weight work inside the picker. */
.ut-tp,
.ut-tp * {
    font-variation-settings: normal;
}

.ut-tp [hidden] {
    display: none !important;
}

.ut-tp fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
    background: transparent;
}

.ut-tp .ut-tp__legend {
    display: block;
    width: 100%;
    margin: 0 0 0.75rem;
    padding: 0;
    background: transparent;
    font-family: var(--heading-font, inherit);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ut-tp-brand);
}

.ut-tp .ut-tp__legend--small {
    font-size: 1.1rem;
}

.ut-tp__schedule {
    margin: -0.25rem 0 0.75rem;
    font-size: 0.9rem;
}

.ut-tp__schedule a {
    color: var(--ut-tp-brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Ticket list */

.ut-tp__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--ut-tp-border);
    border-radius: 10px;
    background: var(--ut-tp-surface);
    overflow: hidden;
}

/* Narrowest layout: name on the left, price then stepper on the right. */
.ut-tp__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "details price"
        "details qty";
    align-items: start;
    gap: 0.5rem 1rem;
    margin: 0;
    padding: 1rem 1.125rem;
    border-top: 1px solid var(--ut-tp-border);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.ut-tp__row:first-child {
    border-top: 0;
}

.ut-tp__row.is-selected {
    background: var(--ut-tp-tint);
    box-shadow: inset 4px 0 0 var(--ut-tp-brand);
}

.ut-tp__details {
    grid-area: details;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.ut-tp__name {
    font-family: var(--heading-font, inherit);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ut-tp-brand);
    overflow-wrap: anywhere;
}

.ut-tp__tier,
.ut-tp__desc {
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--ut-tp-muted);
}

.ut-tp__desc p {
    margin: 0;
}

.ut-tp__desc p + p {
    margin-top: 0.35em;
}

.ut-tp__tier .woocommerce-Price-amount {
    font-weight: 700;
    color: var(--ut-tp-text);
}

.ut-tp__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ut-tp__badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
    text-transform: uppercase;
}

.ut-tp__badge--few-left {
    background: var(--ut-tp-amber-bg);
    color: var(--ut-tp-amber-text);
}

.ut-tp__badge--sold-out {
    background: var(--ut-tp-grey-bg);
    color: var(--ut-tp-grey-text);
}

/* White with a border, so it still stands out on a selected (tinted) row. */
.ut-tp__badge--deadline {
    background: var(--ut-tp-surface);
    border: 1px solid var(--ut-tp-brand);
    color: var(--ut-tp-brand);
}

.ut-tp__price {
    grid-area: price;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.ut-tp__amount {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ut-tp-text);
    white-space: nowrap;
}

.ut-tp__fee {
    font-size: 0.8rem;
    color: var(--ut-tp-muted);
}

.ut-tp__row.is-unavailable .ut-tp__name,
.ut-tp__row.is-unavailable .ut-tp__amount {
    color: var(--ut-tp-muted);
}

/* Quantity stepper */

.ut-tp__qty {
    grid-area: qty;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ut-tp .ut-tp__step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 2px solid var(--ut-tp-brand);
    border-radius: 50%;
    background: var(--ut-tp-surface);
    color: var(--ut-tp-brand);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Hover only where there is a pointer, so a tapped button doesn't stay filled. */
@media (hover: hover) {
    .ut-tp .ut-tp__step:hover:not([aria-disabled="true"]) {
        background: var(--ut-tp-brand);
        color: #fff;
    }

    .ut-tp .ut-tp__input:hover {
        border-color: var(--ut-tp-muted);
    }
}

.ut-tp .ut-tp__step[aria-disabled="true"] {
    border-color: var(--ut-tp-border);
    color: #8a8897;
    cursor: not-allowed;
}

.ut-tp .ut-tp__input {
    width: 4rem;
    height: 44px;
    margin: 0;
    padding: 0 0.25rem;
    border: 1px solid var(--ut-tp-muted);
    border-radius: 6px;
    background: var(--ut-tp-surface);
    box-shadow: none;
    color: var(--ut-tp-text);
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
}

/* With steppers the number box is smaller, but keeps a border so it still
   looks like something you can type into. */
.ut-tp--enhanced .ut-tp__input {
    width: 3rem;
    border-color: var(--ut-tp-border);
    -moz-appearance: textfield;
    appearance: textfield;
}

.ut-tp--enhanced .ut-tp__input::-webkit-inner-spin-button,
.ut-tp--enhanced .ut-tp__input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ut-tp__limit,
.ut-tp__note {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 0.85rem;
    text-align: right;
}

.ut-tp__limit {
    color: var(--ut-tp-muted);
}

.ut-tp__note {
    color: var(--ut-tp-brand);
    font-weight: 600;
}

/* Sold-out rows: the waiting-list button sits where the stepper would be. */
.ut-tp .ut-tp__row > .ut-wl-inline-trigger {
    grid-area: qty;
    justify-self: end;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    margin: 0;
    padding: 0 1rem;
    border: 2px solid var(--ut-tp-brand);
    border-radius: 999px;
    background: var(--ut-tp-surface);
    color: var(--ut-tp-brand);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

@media (hover: hover) {
    .ut-tp .ut-tp__row > .ut-wl-inline-trigger:hover {
        background: var(--ut-tp-brand);
        color: #fff;
        text-decoration: none;
    }
}

.ut-tp .ut-tp__row > .ut-waiting-list-wrapper {
    grid-column: 1 / -1;
    margin: 0.25rem 0 0;
}

/* Focus */

.ut-tp a:focus-visible,
.ut-tp .ut-tp__step:focus-visible,
.ut-tp .ut-tp__input:focus-visible,
.ut-tp .ut-tp__submit:focus-visible,
.ut-tp .ut-wl-inline-trigger:focus-visible,
.ut-tp__payment-option input:focus-visible + .ut-tp__payment-text {
    outline: 3px solid var(--ut-tp-brand);
    outline-offset: 2px;
}

.ut-tp .ut-tp__input:focus {
    background: var(--ut-tp-surface);
    border-color: var(--ut-tp-brand);
}

/* Payment choice (deposits) */

.ut-tp .ut-tp__payment {
    margin-top: 1.25rem;
}

.ut-tp__payment-options {
    display: grid;
    gap: 0.5rem;
}

.ut-tp__payment-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--ut-tp-border);
    border-radius: 10px;
    background: var(--ut-tp-surface);
    cursor: pointer;
}

.ut-tp__payment-option:has(input:checked) {
    border-color: var(--ut-tp-brand);
    box-shadow: inset 0 0 0 1px var(--ut-tp-brand);
    background: var(--ut-tp-tint);
}

.ut-tp__payment-option input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    accent-color: var(--ut-tp-brand);
    flex: none;
}

.ut-tp__payment-text {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    flex: 1;
    border-radius: 4px;
}

.ut-tp__payment-label {
    font-weight: 700;
}

.ut-tp__payment-amount {
    color: var(--ut-tp-muted);
}

.ut-tp__payment-note {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: var(--ut-tp-muted);
}

/* When the choice collapses to one way of paying, the note is the message. */
.ut-tp__payment-options[hidden] + .ut-tp__payment-note {
    margin-top: 0;
    font-size: 0.95rem;
    color: var(--ut-tp-text);
}

.ut-tp__payment-note.is-warning {
    padding: 0.6rem 0.85rem;
    border-left: 4px solid var(--ut-tp-amber-text);
    background: var(--ut-tp-amber-bg);
    color: var(--ut-tp-amber-text);
    font-weight: 600;
}

/* Summary and button */

.ut-tp__footer {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding: 1rem 0 0;
    background: var(--ut-tp-surface);
}

.ut-tp__totals {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.ut-tp__summary {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ut-tp-text);
}

.ut-tp__detail {
    margin: 0;
    font-size: 0.875rem;
    color: var(--ut-tp-muted);
}

.ut-tp__summary--sold-out {
    margin-top: 1.25rem;
    color: var(--ut-tp-muted);
}

.ut-tp__error {
    margin: 0;
    padding: 0.6rem 0.85rem;
    border-left: 4px solid var(--ut-tp-error);
    background: #fdecea;
    color: var(--ut-tp-error);
    font-weight: 600;
}

.single-product div.product form.cart.ut-tp .ut-tp__submit {
    float: none;
    width: 100%;
    min-height: 52px;
    margin: 0;
    font-size: 1.05rem;
    text-transform: uppercase;
}

/* Small phones and up: the stepper sits to the right of the name and price,
   which keeps each row short. */
@container (min-width: 340px) {
    .ut-tp__row {
        grid-template-areas:
            "details qty"
            "price qty";
        align-items: center;
        gap: 0.35rem 1rem;
    }

    .ut-tp__price {
        align-items: flex-start;
        text-align: left;
    }
}

/* Wider containers: name, price and stepper on one line. */
@container (min-width: 520px) {
    .ut-tp__row {
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas: "details price qty";
        gap: 0.5rem 1.25rem;
    }

    .ut-tp__price {
        align-items: flex-end;
        text-align: right;
        min-width: 7.5rem;
    }

    .ut-tp__footer {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .ut-tp__error {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .single-product div.product form.cart.ut-tp .ut-tp__submit {
        width: auto;
        min-width: 14rem;
    }
}

/* Phones: the total and button float above the bottom of the screen while
   tickets are chosen (toggled by ticket-picker.js, above Storefront's
   handheld bar). */
.ut-tp__footer.is-floating {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem 1rem;
    margin: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--ut-tp-border);
    box-shadow: 0 -6px 16px rgba(27, 20, 100, 0.1);
}

.ut-tp__footer.is-floating .ut-tp__error {
    grid-column: 1 / -1;
    grid-row: 1;
}

.single-product div.product form.cart.ut-tp .ut-tp__footer.is-floating .ut-tp__submit {
    width: auto;
    min-width: 9rem;
    min-height: 48px;
}

@media (max-width: 600px) {
    .ut-tp__row {
        padding: 0.9rem 0.875rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ut-tp__row,
    .ut-tp .ut-tp__step {
        transition: none;
    }
}
