/* =========================================================
   TICKET SHOP — หน้าซื้อบัตรของลูกค้า
   RASISALAI UNITED

   ใช้กับ: pages/tickets.php, pages/ticket-payment.php
========================================================= */

.ts-page {
    --ts-red: #d91f26;
    --ts-red-dark: #b5161c;
    --ts-red-soft: #fdeced;
    --ts-navy: #071528;
    --ts-navy-2: #0b1f3a;
    --ts-gold: #f4c542;
    --ts-text: #1b2435;
    --ts-muted: #667085;
    --ts-line: #e6e9ef;
    --ts-bg: #f4f6fa;
    --ts-green: #12a150;

    padding: 28px 0 64px;
    color: var(--ts-text);
    background: var(--ts-bg);
    font-family: "Kanit", "Sarabun", sans-serif;
}

.ts-page .container {
    max-width: 1140px;
}


/* ---------- steps ---------- */

.ts-steps {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 0 auto 22px;
    padding: 0;
    list-style: none;
}

.ts-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ts-muted);
}

.ts-steps li + li::before {
    content: "";
    width: 28px;
    height: 2px;
    margin-right: 2px;
    background: var(--ts-line);
    border-radius: 2px;
}

.ts-steps b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ts-muted);
    background: #fff;
    border: 2px solid var(--ts-line);
    border-radius: 50%;
}

.ts-steps .is-done b {
    color: #fff;
    background: var(--ts-green);
    border-color: var(--ts-green);
}

.ts-steps .is-active {
    color: var(--ts-text);
}

.ts-steps .is-active b {
    color: #fff;
    background: var(--ts-red);
    border-color: var(--ts-red);
    box-shadow: 0 0 0 4px rgba(217, 31, 38, .15);
}


/* ---------- cards ---------- */

.ts-card {
    background: #fff;
    border: 1px solid var(--ts-line);
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(7, 21, 40, .04);
}

.ts-card-body {
    padding: 22px;
}

.ts-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 600;
}

.ts-section-title .ts-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    font-size: 14px;
    color: #fff;
    background: var(--ts-navy);
    border-radius: 8px;
}


/* ---------- match hero ---------- */

.ts-match {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    padding: 22px 24px;
    color: #fff;
    background:
        radial-gradient(90% 140% at 100% 0%, rgba(217, 31, 38, .5) 0%, transparent 60%),
        linear-gradient(120deg, var(--ts-navy) 0%, #13295a 100%);
    border-radius: 20px;
    box-shadow: 0 14px 34px rgba(7, 21, 40, .2);
}

.ts-match-league {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    letter-spacing: .08em;
    color: var(--ts-gold);
}

.ts-match-league img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.ts-match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.ts-team img {
    display: block;
    margin: 0 auto;
    width: 76px;
    height: 76px;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .35));
}

.ts-team strong {
    display: block;
    margin-top: 8px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
}

.ts-team small {
    font-size: 11px;
    letter-spacing: .2em;
    color: rgba(255, 255, 255, .55);
}

.ts-vs {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, .55);
}

.ts-vs .ts-kick {
    display: block;
    margin-top: 4px;
    padding: 2px 12px;
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    border: 1px solid rgba(244, 197, 66, .6);
    border-radius: 10px;
}

.ts-match-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 22px;
    margin-top: 16px;
    padding-top: 14px;
    font-size: 14px;
    color: rgba(255, 255, 255, .8);
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.ts-match-meta i {
    margin-right: 4px;
    color: var(--ts-gold);
}

/* fixture chips */

.ts-fixtures {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.ts-fixture {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 14px;
    color: var(--ts-text);
    background: #fff;
    border: 1px solid var(--ts-line);
    border-radius: 999px;
    text-decoration: none;
}

.ts-fixture.active {
    color: #fff;
    background: var(--ts-navy);
    border-color: var(--ts-navy);
}


/* ---------- zones ---------- */

.ts-zones {
    display: grid;
    gap: 12px;
}

.ts-zone {
    position: relative;
    display: flex;
    overflow: hidden;
    background: #fff;
    border: 2px solid var(--ts-line);
    border-radius: 16px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ts-zone::before {
    content: "";
    flex: 0 0 8px;
    background: var(--zone, #98a2b3);
}

.ts-zone.is-selected {
    border-color: var(--ts-red);
    box-shadow: 0 0 0 4px rgba(217, 31, 38, .1);
}

.ts-zone.is-soldout {
    opacity: .55;
}

.ts-zone-body {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
}

.ts-zone-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.ts-zone-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ts-zone-left {
    font-size: 13px;
    white-space: nowrap;
    color: var(--ts-green);
}

.ts-zone-left.is-low {
    color: #c26a00;
}

.ts-zone-left.is-out {
    color: var(--ts-red);
}

.ts-zone-desc {
    margin: 2px 0 10px;
    font-family: "Sarabun", sans-serif;
    font-size: 14px;
    color: var(--ts-muted);
}

.ts-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 8px;
}

.ts-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    cursor: pointer;
    background: #f8fafc;
    border: 1.5px solid var(--ts-line);
    border-radius: 12px;
    transition: border-color .15s ease, background .15s ease;
}

.ts-option:hover {
    border-color: #c9d0da;
}

.ts-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ts-option-radio {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border: 2px solid #c9d0da;
    border-radius: 50%;
    background: #fff;
}

.ts-option input:checked ~ .ts-option-radio {
    border: 6px solid var(--ts-red);
}

.ts-option input:focus-visible ~ .ts-option-radio {
    outline: 2px solid var(--ts-red);
    outline-offset: 2px;
}

.ts-option:has(input:checked) {
    background: var(--ts-red-soft);
    border-color: var(--ts-red);
}

.ts-option:has(input:disabled) {
    cursor: not-allowed;
    opacity: .5;
}

.ts-option-text {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.ts-option-text strong {
    display: block;
    font-size: 15px;
    font-weight: 500;
}

.ts-option-text small {
    font-family: "Sarabun", sans-serif;
    font-size: 12.5px;
    color: var(--ts-muted);
}

.ts-option-price {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
}

.ts-badge-collector {
    display: inline-block;
    margin-left: 4px;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    color: #6b4a00;
    background: linear-gradient(135deg, #fff2b3, #f4c542);
    border-radius: 999px;
    vertical-align: 1px;
}


/* ---------- checkout ---------- */

.ts-checkout {
    position: sticky;
    top: 96px;
}

.ts-selected {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #f8fafc;
    border: 1px dashed #c9d0da;
    border-radius: 12px;
}

.ts-selected.is-empty {
    color: var(--ts-muted);
    justify-content: center;
    font-size: 14px;
}

.ts-selected-dot {
    flex: 0 0 12px;
    width: 12px;
    height: 40px;
    border-radius: 6px;
    background: var(--zone, #98a2b3);
}

.ts-qty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ts-qty button {
    width: 44px;
    height: 44px;
    font-size: 22px;
    line-height: 1;
    color: var(--ts-text);
    background: #fff;
    border: 1.5px solid var(--ts-line);
    border-radius: 12px;
}

.ts-qty button:disabled {
    opacity: .4;
}

.ts-qty input {
    width: 64px;
    height: 44px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    border: 1.5px solid var(--ts-line);
    border-radius: 12px;
    -moz-appearance: textfield;
}

.ts-qty input::-webkit-outer-spin-button,
.ts-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.ts-field {
    margin-top: 14px;
}

.ts-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
}

.ts-field label small {
    font-weight: 400;
    color: var(--ts-muted);
}

.ts-field .form-control {
    height: 48px;
    font-size: 16px;
    border: 1.5px solid var(--ts-line);
    border-radius: 12px;
}

.ts-field .form-control:focus {
    border-color: var(--ts-red);
    box-shadow: 0 0 0 4px rgba(217, 31, 38, .1);
}

.ts-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 18px 0 14px;
    padding-top: 14px;
    border-top: 1px solid var(--ts-line);
}

.ts-total span {
    color: var(--ts-muted);
}

.ts-total strong {
    font-size: 30px;
    font-weight: 600;
    color: var(--ts-red);
}

.ts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 54px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--ts-red), var(--ts-red-dark));
    border: 0;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(217, 31, 38, .25);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.ts-btn:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(217, 31, 38, .3);
}

.ts-btn:disabled {
    opacity: .5;
    transform: none;
    box-shadow: none;
}

.ts-btn-light {
    color: var(--ts-text);
    background: #fff;
    border: 1.5px solid var(--ts-line);
    box-shadow: none;
}

.ts-btn-light:hover {
    color: var(--ts-text);
    box-shadow: none;
}

.ts-note {
    margin-top: 12px;
    font-family: "Sarabun", sans-serif;
    font-size: 13px;
    text-align: center;
    color: var(--ts-muted);
}

/* mobile bottom bar */

.ts-mobilebar {
    display: none;
}


/* ---------- my orders ---------- */

.ts-myorders {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 16px;
    font-size: 14px;
    background: #fff;
    border: 1px solid var(--ts-line);
    border-radius: 14px;
}

.ts-myorders a {
    padding: 4px 12px;
    font-size: 13px;
    color: var(--ts-navy);
    text-decoration: none;
    background: #f1f4f9;
    border-radius: 999px;
}


/* ---------- payment ---------- */

.ts-amount {
    font-size: 40px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--ts-red);
}

.ts-pp {
    display: inline-block;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--ts-line);
    border-radius: 16px;
}

.ts-pp img {
    display: block;
    width: 220px;
    height: 220px;
}

.ts-pp-head {
    margin: -12px -12px 10px;
    padding: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .05em;
    background: #113566;
    border-radius: 15px 15px 0 0;
}

.ts-deadline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-size: 14px;
    color: #8a4b00;
    background: #fff6e5;
    border: 1px solid #ffe0a3;
    border-radius: 12px;
}

.ts-deadline strong {
    font-variant-numeric: tabular-nums;
}

.ts-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 150px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    color: var(--ts-muted);
    background: #f8fafc;
    border: 2px dashed #c9d0da;
    border-radius: 16px;
    transition: border-color .15s ease, background .15s ease;
}

.ts-drop:hover,
.ts-drop.is-over {
    border-color: var(--ts-red);
    background: var(--ts-red-soft);
}

.ts-drop i {
    font-size: 34px;
    color: var(--ts-red);
}

.ts-drop input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.ts-drop img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 10px;
}

.ts-status {
    text-align: center;
}

.ts-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin-bottom: 10px;
    font-size: 36px;
    border-radius: 50%;
}

.ts-status-icon.is-wait {
    color: #c26a00;
    background: #fff3db;
}

.ts-status-icon.is-ok {
    color: #fff;
    background: var(--ts-green);
}

.ts-status-icon.is-off {
    color: var(--ts-muted);
    background: #eef1f5;
}

.ts-timeline {
    display: grid;
    gap: 0;
    margin: 18px auto 0;
    max-width: 360px;
    padding: 0;
    text-align: left;
    list-style: none;
}

.ts-timeline li {
    position: relative;
    padding: 0 0 16px 30px;
    font-size: 14px;
    color: var(--ts-muted);
}

.ts-timeline li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 4px;
    width: 12px;
    height: 12px;
    border: 2px solid #c9d0da;
    border-radius: 50%;
    background: #fff;
}

.ts-timeline li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 11px;
    top: 18px;
    bottom: 0;
    width: 2px;
    background: #e6e9ef;
}

.ts-timeline li.is-done {
    color: var(--ts-text);
}

.ts-timeline li.is-done::before {
    background: var(--ts-green);
    border-color: var(--ts-green);
}

.ts-timeline li.is-now {
    font-weight: 500;
    color: var(--ts-text);
}

.ts-timeline li.is-now::before {
    border-color: #f0a400;
    box-shadow: 0 0 0 4px rgba(240, 164, 0, .18);
}

.ts-kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    font-size: 15px;
    border-bottom: 1px solid #f0f2f6;
}

.ts-kv span {
    color: var(--ts-muted);
}

.ts-kv strong {
    font-weight: 500;
    text-align: right;
}

.ts-copy {
    padding: 2px 8px;
    margin-left: 6px;
    font-size: 12px;
    color: var(--ts-navy);
    background: #eef1f5;
    border: 0;
    border-radius: 8px;
}


/* ---------- responsive ---------- */

@media (max-width: 991.98px) {

    .ts-checkout {
        position: static;
    }

    .ts-mobilebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid var(--ts-line);
        box-shadow: 0 -8px 24px rgba(7, 21, 40, .08);
    }

    .ts-mobilebar > div {
        flex: 1;
        min-width: 0;
        line-height: 1.2;
    }

    .ts-mobilebar small {
        display: block;
        overflow: hidden;
        font-size: 12px;
        color: var(--ts-muted);
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .ts-mobilebar strong {
        font-size: 20px;
        color: var(--ts-red);
    }

    .ts-mobilebar .ts-btn {
        width: auto;
        min-height: 46px;
        font-size: 15px;
    }

    .ts-page.has-mobilebar {
        padding-bottom: 110px;
    }
}

@media (max-width: 575.98px) {

    .ts-page {
        padding-top: 18px;
    }

    .ts-steps li span {
        display: none;
    }

    .ts-steps li.is-active span {
        display: inline;
    }

    .ts-match {
        padding: 18px 14px;
    }

    .ts-team img {
        width: 58px;
        height: 58px;
    }

    .ts-team strong {
        font-size: 15px;
    }

    .ts-vs .ts-kick {
        font-size: 19px;
    }

    .ts-card-body {
        padding: 18px 16px;
    }

    .ts-amount {
        font-size: 34px;
    }
}
