/* =====================================================================
   PUBLIC - GET TICKETS DRAWER + the event cards' ticket states (event ticketing, docs-internal/ticketing.md)
   The drawer shell is css/public/drawer.css (+ .atl-drawer--sheet for the phone bottom sheet); the form fields and buttons are the
   booking drawer's own (.bk-field / .bk-input / .btn-bk-nav, css/public/redesign.css). This file adds only what is ticket-specific,
   with the page's EXISTING tokens (css/public/redesign.css :root) - no new ones. Every selector is scoped (.tk-* / #ticketDrawer).
   Contrast: small text uses --text-secondary (the drawer surface makes --text-muted too faint for body copy).
   ===================================================================== */

/* event cards and the details pop-up: the price line + View Event / Get Tickets are css/public/redesign.css (Events) */

/* ── drawer content ── */
#ticketDrawer { font-family: var(--f-body); }
#ticketDrawer .tk-event { margin-bottom: 18px; }
/* the show's poster on top: a fixed-height banner, cropped from the top so a poster's headline stays visible */
#ticketDrawer .tk-event__poster { margin: 0 0 16px; height: 180px; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-elevated); border: 1px solid var(--border-low); }
#ticketDrawer .tk-event__poster img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
@media (max-width: 420px) { #ticketDrawer .tk-event__poster { height: 150px; } }
#ticketDrawer .tk-event__title { margin: 0; font-family: var(--f-display); font-size: 1.6rem; line-height: 1.2; color: var(--text-primary); }
#ticketDrawer .tk-event__meta { margin: 4px 0 0; color: var(--text-secondary); font-size: var(--fs-sm); }
#ticketDrawer .tk-share { margin-top: 10px; }
#ticketDrawer .tk-bot { margin: 4px 0 12px; }
#ticketDrawer .tk-bot__widget { min-height: 65px; }
#ticketDrawer .tk-price { font-family: var(--f-mono); color: var(--y-base); font-variant-numeric: tabular-nums; white-space: nowrap; }
#ticketDrawer .tk-fine { margin: 10px 0 0; color: var(--text-secondary); font-size: .78rem; line-height: 1.5; }
#ticketDrawer .tk-muted { color: var(--text-secondary); font-weight: 400; }
#ticketDrawer .tk-loading { padding: 28px 0; color: var(--text-secondary); font-size: var(--fs-sm); }
#ticketDrawer .tk-loading i { color: var(--y-base); margin-right: 8px; }

#ticketDrawer .tk-msg { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r-md); font-size: var(--fs-sm); line-height: 1.5; color: var(--text-primary); border: 1px solid var(--border-default); background: var(--bg-elevated); }
#ticketDrawer .tk-msg--ok { border-color: rgba(var(--status-available-rgb), .5); background: rgba(var(--status-available-rgb), .08); }
#ticketDrawer .tk-msg--ok i { color: rgb(var(--status-available-rgb)); margin-right: 6px; }
#ticketDrawer .tk-msg--warn { border-color: rgba(var(--status-reserved-rgb), .5); background: rgba(var(--status-reserved-rgb), .08); }
#ticketDrawer .tk-msg--error { border-color: rgba(var(--status-blocked-rgb), .55); background: rgba(var(--status-blocked-rgb), .08); }

/* tiers + steppers */
#ticketDrawer .tk-tiers { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-low); }
#ticketDrawer .tk-tier { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border-low); }
#ticketDrawer .tk-tier--off { opacity: .6; }
#ticketDrawer .tk-tier--gone { border-left: 3px solid rgb(var(--status-blocked-rgb)); padding-left: 10px; }
#ticketDrawer .tk-tier__info { min-width: 0; }
#ticketDrawer .tk-tier__name { margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--text-primary); }
#ticketDrawer .tk-tier__desc { margin: 2px 0 0; font-size: .82rem; color: var(--text-secondary); }
#ticketDrawer .tk-tier__left { margin: 4px 0 0; font-size: .78rem; color: var(--text-secondary); }
#ticketDrawer .tk-tier__buy { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
#ticketDrawer .tk-tier__buy .tk-price { margin: 0; font-size: 1rem; }
#ticketDrawer .tk-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-default); border-radius: var(--r-pill); }
#ticketDrawer .tk-step {
    width: 44px; height: 44px; border: 0; background: transparent; color: var(--y-base); font-size: 1.25rem; line-height: 1; cursor: pointer;
    border-radius: var(--r-pill); transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
#ticketDrawer .tk-step:hover:not(:disabled), #ticketDrawer .tk-step:focus-visible { background: var(--y-muted); }
#ticketDrawer .tk-step:focus-visible { outline: 2px solid var(--y-base); outline-offset: 1px; }
#ticketDrawer .tk-step:disabled { color: var(--text-muted); cursor: not-allowed; }
#ticketDrawer .tk-qty { min-width: 2ch; text-align: center; font-family: var(--f-mono); font-size: 1rem; color: var(--text-primary); }

/* the action row stays reachable while the content scrolls (same idea as the booking drawer's .bk-nav-row) */
#ticketDrawer .tk-actions {
    position: sticky; bottom: calc(-1 * var(--atl-pad-b)); z-index: 5; background: var(--bg-surface);
    margin: 20px calc(-1 * var(--atl-pad-r)) calc(-1 * var(--atl-pad-b)) calc(-1 * var(--atl-pad-l));
    padding: 16px var(--atl-pad-r) calc(var(--atl-pad-b) + env(safe-area-inset-bottom)) var(--atl-pad-l);
    border-top: 1px solid var(--border-low); display: flex; flex-direction: column; gap: 10px;
}
#ticketDrawer .tk-actions .btn-bk-nav { width: 100%; justify-content: center; min-height: 48px; text-align: center; }
#ticketDrawer .btn-bk-nav:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
#ticketDrawer .tk-actions a.btn-bk-nav { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
#ticketDrawer .tk-actions .tk-fine { margin: 0; text-align: center; }
#ticketDrawer .tk-total { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font-size: var(--fs-sm); color: var(--text-secondary); }
#ticketDrawer .tk-total strong { font-size: 1.25rem; }

/* step 2 */
#ticketDrawer .tk-hold { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--r-md); background: var(--bg-elevated); border: 1px solid var(--border-default); color: var(--text-secondary); font-size: var(--fs-sm); }
#ticketDrawer .tk-hold i { color: var(--y-base); margin-right: 6px; }
#ticketDrawer .tk-hold__time { font-family: var(--f-mono); color: var(--text-primary); font-size: 1rem; }
#ticketDrawer .tk-hold--low { border-color: rgba(var(--status-reserved-rgb), .6); }
#ticketDrawer .tk-hold--low .tk-hold__time, #ticketDrawer .tk-hold--low i { color: rgb(var(--status-reserved-rgb)); }
#ticketDrawer .tk-summary { list-style: none; margin: 0 0 18px; padding: 0; font-size: var(--fs-sm); color: var(--text-secondary); }
#ticketDrawer .tk-summary li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
#ticketDrawer .tk-summary__total { border-top: 1px solid var(--border-low); margin-top: 4px; padding-top: 10px !important; color: var(--text-primary); font-weight: 600; }
#ticketDrawer .tk-field { margin-bottom: 14px; }
/* text starts after the field icon (the booking / tracking drawers carry the same rule under their own ids) */
#ticketDrawer .bk-ico-input.form-control { padding-left: 38px !important; }
/* the browser's autofill paints fields light blue with dark text - keep them on the drawer's dark field colour (as #contactForm does) */
#ticketDrawer .form-control:-webkit-autofill,
#ticketDrawer .form-control:-webkit-autofill:hover,
#ticketDrawer .form-control:-webkit-autofill:focus,
#ticketDrawer .form-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-page) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary);
    transition: background-color 5000s ease-in-out 0s;
}
#ticketDrawer .tk-label { display: block; margin: 0 0 6px; font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--text-secondary); }
#ticketDrawer .tk-label span { color: var(--y-base); }
#ticketDrawer .tk-link { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--y-base); font: inherit; font-size: var(--fs-sm); cursor: pointer; text-align: left; }
#ticketDrawer .tk-link:focus-visible { outline: 2px solid var(--y-base); outline-offset: 2px; }
#ticketDrawer .tk-link.tk-change { display: inline-flex; align-items: center; gap: 6px; margin: -10px 0 14px; color: var(--text-secondary); }
#ticketDrawer .tk-link.tk-change:hover { color: var(--y-base); }
#ticketDrawer .tk-terms { margin: 8px 0 10px; padding: 12px 14px; border: 1px solid var(--border-default); border-radius: var(--r-md); background: var(--bg-elevated); font-size: .82rem; color: var(--text-secondary); }
#ticketDrawer .tk-terms__title { margin: 0 0 6px; font-weight: 600; color: var(--text-primary); }
#ticketDrawer .tk-terms ul, #ticketDrawer .tk-terms ol { margin: 0; padding-left: 18px; line-height: 1.5; }
#ticketDrawer .tk-terms li + li { margin-top: 4px; }
#ticketDrawer .tk-terms__all { margin-top: 8px; }
/* links inside the consent line are underlined - gold on grey alone is not enough to tell them apart (WCAG link-in-text-block) */
#ticketDrawer .bk-checkbox-text a { text-decoration: underline; text-underline-offset: 2px; }
#ticketDrawer .tk-terms__all summary { cursor: pointer; color: var(--y-base); min-height: 32px; display: flex; align-items: center; }
#ticketDrawer .tk-terms__all ol { margin-top: 6px; }
#ticketDrawer .tk-names { margin: 4px 0 12px; padding: 12px 14px 2px; border-left: 2px solid var(--y-muted); }
#ticketDrawer .bk-checkbox-label.tk-consent { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: var(--fs-sm); color: var(--text-secondary); font-weight: 400; margin: 6px 0 0; line-height: 1.5; }
#ticketDrawer .tk-consent .bk-checkbox { margin-top: 3px; }
#ticketDrawer .tk-consent a { color: var(--y-base); }

/* tickets after payment */
#ticketDrawer .tk-tickets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
#ticketDrawer .tk-ticket { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--border-default); border-radius: var(--r-lg); background: var(--bg-elevated); }
#ticketDrawer .tk-ticket__qr { width: 132px; height: 132px; flex-shrink: 0; background: #fff; border-radius: var(--r-md); padding: 4px; }
#ticketDrawer .tk-ticket__info { min-width: 0; }
#ticketDrawer .tk-ticket__tier { margin: 0; font-weight: 600; color: var(--text-primary); }
#ticketDrawer .tk-ticket__name { margin: 2px 0 8px; color: var(--text-secondary); font-size: var(--fs-sm); }
#ticketDrawer .tk-code { margin: 0; font-family: var(--f-mono); font-size: .8rem; color: var(--y-base); word-break: break-all; letter-spacing: .04em; }
#ticketDrawer .tk-ticket__used { margin: 6px 0 0; font-size: .78rem; color: rgb(var(--status-reserved-rgb)); }

@media (max-width: 420px) {
    #ticketDrawer .tk-ticket { flex-direction: column; align-items: flex-start; }
    #ticketDrawer .tk-ticket__qr { width: 180px; height: 180px; }
    #ticketDrawer .tk-event__title { font-size: 1.35rem; }
}

/* ── Share a show (js/event-share.js): the card's round button on the poster, the pop-up and drawer buttons, the fallback menu ── */
.ev-card__poster { position: relative; }
.ev-card__share {
    position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid rgba(255,255,255,.25); background: rgba(10,10,10,.65); color: #fff; font-size: 1rem; cursor: pointer;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: background var(--t, .2s) ease, color var(--t, .2s) ease;
}
.ev-card__share:hover, .ev-card__share:focus-visible { background: var(--y-base); color: #0a0a0a; }
.ev-card__share:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tk-share, .evt-share-btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: var(--r-md, 8px); cursor: pointer;
    font: inherit; font-size: var(--fs-sm, .875rem); font-weight: 600; color: var(--text-primary); background: transparent; border: 1px solid var(--border-default, rgba(255,255,255,.2));
}
.tk-share:hover, .tk-share:focus-visible, .evt-share-btn:hover, .evt-share-btn:focus-visible { border-color: var(--y-base); color: var(--y-base); }
.evt-share-btn { width: 100%; justify-content: center; margin-top: 10px; }
.tm-share-menu {
    position: fixed; z-index: 3000; min-width: 220px; padding: 8px; border-radius: var(--r-lg, 12px);
    background: var(--bg-elevated, #161616); border: 1px solid var(--border-default, rgba(255,255,255,.15)); box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.tm-share-menu__title { margin: 4px 8px 6px; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.tm-share-menu__item {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: var(--r-md, 8px);
    background: transparent; color: var(--text-primary); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.tm-share-menu__item:hover, .tm-share-menu__item:focus-visible { background: rgba(255,255,255,.07); color: var(--y-base); outline: none; }
.tm-share-menu__item i { width: 18px; text-align: center; }
.tm-share-menu__note { margin: 4px 8px 2px; font-size: .8rem; color: var(--text-secondary); word-break: break-all; }
.tm-share-menu__note:empty { display: none; }
