/* Tickets page. Builds on root.css + index.css (nav, .btn, .wrap, h2, footer, tokens). */

[hidden] { display: none !important }

:root {
    --field-line: color-mix(in srgb, var(--muted) 55%, transparent);
}

/* ---------- Header ---------- */
.tk-head {
    background: linear-gradient(100deg, var(--red-deep) 0%, var(--red) 100%);
    color: #fff;
    padding-bottom: 2rem
}

.tk-title {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    padding-top: 2rem
}

.tk-title h1 {
    margin: 0;
    font-family: var(--display);
    font-weight: 900;
    text-transform: uppercase;
    font-size: clamp(3.5rem, 11vw, 7rem);
    line-height: .85
}

.steps {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
    font-weight: 700;
    font-size: .95rem
}

.steps li {
    display: flex;
    align-items: center;
    gap: .5rem;
    opacity: .65
}

.steps li::before {
    counter-increment: step;
    content: counter(step);
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: .85rem
}

.steps li.is-done { opacity: .9 }

.steps li.is-done::before {
    content: "✓";
}

.steps li[aria-current="step"] { opacity: 1 }

.steps li[aria-current="step"]::before {
    background: #fff;
    border-color: #fff;
    color: var(--red-deep)
}

h2:focus { outline: none }

.tk-intro {
    max-width: 56ch;
    margin: -1rem 0 2rem;
    color: var(--muted)
}

/* ---------- Matches ---------- */
.tk-matches {
    display: grid;
    gap: 1.5rem
}

.tk-match {
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-top: 5px solid var(--red)
}

.tk-mhead {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem
}

.tk-date {
    display: grid;
    place-items: center;
    width: 4.5rem;
    padding: .5rem 0;
    background: var(--red);
    color: #fff;
    font-family: var(--display);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1
}

.tk-date b { font-size: 2.4rem }
.tk-date span { font-size: 1rem; letter-spacing: .04em }

.tk-mhead h3 {
    margin: 0;
    font-family: var(--display);
    font-weight: 900;
    text-transform: uppercase;
    font-size: clamp(1.5rem, 3.4vw, 2.2rem);
    line-height: 1
}

.tk-mhead h3 i {
    font-style: normal;
    color: var(--red);
    padding-inline: .4rem
}

.tk-mhead p {
    margin: .35rem 0 0;
    color: var(--muted)
}

.tk-tag {
    background: var(--ink);
    color: var(--bg);
    font-weight: 700;
    font-size: .85rem;
    padding: .3rem .7rem;
    border-radius: 2px
}

.tk-cats {
    list-style: none;
    margin: 0;
    padding: 0 1.5rem
}

.tk-cat {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 0;
    border-top: 1px solid var(--line)
}

.tk-cname b { display: block }

.tk-cname small {
    color: var(--muted);
    font-size: .9rem
}

.tk-cname em {
    font-style: normal;
    font-weight: 700;
    color: var(--red)
}

.tk-price {
    font-family: var(--display);
    font-weight: 900;
    font-size: 1.6rem;
    min-width: 5ch;
    text-align: right
}

.tk-sold {
    min-width: 7.5rem;
    text-align: center;
    color: var(--muted);
    font-weight: 700
}

.tk-step {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--field-line);
    border-radius: 2px;
    background: var(--bg)
}

.tk-cat.has .tk-step { border-color: var(--red) }

.tk-step button {
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer
}

.tk-step button:hover:not(:disabled) { background: var(--red); color: #fff }
.tk-step button:disabled { opacity: .3; cursor: not-allowed }

.tk-step output {
    min-width: 2.2rem;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums
}

/* ---------- Basket bar ---------- */
.cartbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    background: var(--red-deep);
    color: #fff;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .25)
}

.cartbar .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: .9rem
}

.cartbar-info {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem 1rem
}

.cartbar-info b { font-family: var(--display); font-size: 1.6rem; font-weight: 900; text-transform: uppercase }
.cartbar-info span { font-weight: 500; opacity: .9 }

body.has-cartbar main { padding-bottom: 5rem }

/* ---------- Checkout ---------- */
.tk-checkout {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start
}

fieldset {
    margin: 0 0 2rem;
    padding: 0;
    border: 0
}

legend {
    padding: 0;
    margin-bottom: 1rem;
    font-family: var(--display);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.6rem
}

.tk-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem
}

label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: .95rem
}

label small {
    display: block;
    margin-top: .3rem;
    font-weight: 400;
    color: var(--muted)
}

input:not([type="radio"], [type="checkbox"]) {
    display: block;
    width: 100%;
    margin-top: .35rem;
    padding: .8rem .9rem;
    font: inherit;
    font-weight: 400;
    color: var(--ink);
    background: var(--bg);
    border: 2px solid var(--field-line);
    border-radius: 2px
}

input:not([type="radio"], [type="checkbox"]):focus-visible { outline-offset: 0; border-color: var(--red) }
input[aria-invalid="true"] { border-color: var(--red) }

input[type="radio"], input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    margin: 0;
    accent-color: var(--red);
    flex: none
}

.tk-radio, .tk-check {
    display: flex;
    align-items: center;
    gap: .7rem;
    font-weight: 500
}

.tk-radio {
    padding: .85rem 1rem;
    margin-bottom: .6rem;
    background: var(--bg);
    border: 2px solid var(--field-line);
    border-radius: 2px;
    cursor: pointer
}

.tk-radio:has(input:checked) { border-color: var(--red) }
.tk-check { align-items: flex-start }

.tk-error {
    margin: 0 0 1rem;
    padding: .8rem 1rem;
    border-left: 5px solid var(--red);
    background: var(--bg);
    font-weight: 700
}

.tk-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem
}

.btn { cursor: pointer; border: 0; font: inherit; font-weight: 700 }

.btn-line {
    border: 2px solid var(--field-line);
    color: var(--ink)
}

.btn-line:hover { border-color: var(--ink) }
.btn-red:disabled { opacity: .6; cursor: progress }

/* ---------- Order summary + receipt ---------- */
.tk-summary, .tk-receipt {
    background: var(--bg);
    border: 1px solid var(--line);
    border-top: 5px solid var(--red);
    padding: 1.5rem
}

.tk-summary { position: sticky; top: 1.5rem }

.tk-summary h3, .tk-receipt h3 {
    margin: 0 0 1rem;
    font-family: var(--display);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.8rem;
    line-height: 1
}

.tk-summary ul, .tk-receipt ul { list-style: none; margin: 0; padding: 0 }

.sum-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--line)
}

.sum-line small { display: block; color: var(--muted) }
.sum-line > span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap }

dl { margin: 1rem 0 0 }

dl div {
    display: flex;
    justify-content: space-between;
    padding: .25rem 0;
    font-variant-numeric: tabular-nums
}

dt, dd { margin: 0 }
dl .total { margin-top: .5rem; padding-top: .75rem; border-top: 2px solid var(--ink); font-weight: 900; font-size: 1.25rem }

/* ---------- Confirmation ---------- */
.tk-done { max-width: 40rem; margin-inline: auto }
.tk-done > p { margin: -1rem 0 2rem; font-size: 1.1rem }
.tk-receipt { margin-bottom: 2rem }

/* ---------- Responsive ---------- */
@media (max-width:860px) {
    .tk-checkout { grid-template-columns: 1fr }
    .tk-summary { position: static; order: -1 }
    .tk-mhead { grid-template-columns: auto 1fr }
    .tk-tag { grid-column: 1 / -1; justify-self: start }
}

@media (max-width:560px) {
    .tk-row { grid-template-columns: 1fr }
    .tk-cats { padding-inline: 1rem }
    .tk-mhead { padding-inline: 1rem }

    .tk-cat {
        grid-template-columns: 1fr auto;
        row-gap: .6rem
    }

    .tk-cname { grid-column: 1 / -1 }
    .tk-price { text-align: left }
    .tk-actions .btn { flex: 1; text-align: center }
}

.tk-status {
    margin: 0;
    padding: 1.5rem;
    background: var(--bg-alt);
    border-left: 5px solid var(--red);
    font-weight: 700
}