/* WDK Tickets 2.1 — okno zakupu biletu. Paleta zgodna z wdk-tickets.css (1.9); kontrasty wg WCAG 2.2 AA. */

.wdk-modal {
    --wdk-primary: #0056b3;       /* 7.0:1 z bielą — #007bff z 1.9 ma tylko 3.98:1 (1.4.3) */
    --wdk-primary-dark: #003f85;
    --wdk-primary-soft: #eef3ff;
    --wdk-text: #111;
    --wdk-muted: #555;
    --wdk-border: #ddd;
    --wdk-free: #ffffff;
    --wdk-free-stroke: #1b5e20;   /* 7.5:1 do tła #fafafa — 1.4.11 */
    --wdk-taken: #6b6b6b;         /* 5.1:1 do #fafafa + znak × */
    --wdk-selected: #0056b3;      /* 6.8:1 + znak ✓ */
    --wdk-attempted: #8a4b00;     /* 6.5:1 + znak ⇢ */
    --wdk-error-bg: #fdecea;
    --wdk-error: #a12622;
    --wdk-info-bg: #eef3ff;

    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-size: 16px;
    line-height: 1.4;
    color: var(--wdk-text);
}

.wdk-modal[hidden] {
    display: none;
}

html.wdk-modal-open,
html.wdk-modal-open body {
    overflow: hidden;
}

.wdk-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.wdk-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 960px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    outline: none;
}

.wdk-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 20px;
    cursor: pointer;
}

.wdk-modal-close:hover,
.wdk-modal-close:focus-visible {
    background: var(--wdk-primary-soft);
    color: var(--wdk-primary-dark);
}

.wdk-modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.wdk-modal-body.is-busy {
    cursor: progress;
}

/* Nagłówek */
.wdk-m-head {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px 64px 12px 16px;
    border-bottom: 1px solid var(--wdk-border);
}

.wdk-m-poster {
    width: 64px;
    height: 92px;
    object-fit: cover;
    border-radius: 4px;
    flex: 0 0 auto;
    background: #f2f2f2;
}

.wdk-m-title {
    margin: 0 0 4px;
    font-size: 1.25em;
    line-height: 1.2;
}

.wdk-m-when,
.wdk-m-loc {
    margin: 4px 0 0;
    color: #333;
}

.wdk-m-loc {
    color: var(--wdk-muted);
    font-size: 0.9em;
}

/* Kroki — klikalne (powrót do wcześniejszych) */
.wdk-m-steps {
    border-bottom: 1px solid var(--wdk-border);
    padding: 6px 12px;
}

.wdk-m-steps ol {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wdk-m-steps li {
    flex: 1 1 0;
    min-width: 0;
}

.wdk-m-step {
    width: 100%;
    min-height: 44px;
    padding: 6px 4px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--wdk-muted);
    font: inherit;
    font-size: 0.85em;
    text-align: center;
    cursor: pointer;
}

.wdk-m-step:disabled {
    cursor: default;
    color: #767676;            /* 4.5:1 — nieaktywny, ale czytelny */
}

.wdk-m-step.is-done {
    color: var(--wdk-primary-dark);
    text-decoration: underline;
}

.wdk-m-step.is-current {
    color: var(--wdk-primary-dark);
    font-weight: 700;
    border-bottom-color: var(--wdk-primary-dark);
    text-decoration: none;
}

.wdk-m-step:focus-visible {
    outline: 3px solid var(--wdk-primary-dark);
    outline-offset: -3px;
}

.wdk-m-stepnum {
    display: inline-block;
    min-width: 1.5em;
    border-radius: 50%;
    border: 2px solid currentColor;
    line-height: 1.3;
}

/* Komunikaty */
.wdk-m-alert {
    margin: 12px 16px 0;
    padding: 10px 12px;
    border-radius: 6px;
}

.wdk-m-alert.is-error {
    background: var(--wdk-error-bg);
    color: var(--wdk-error);
}

.wdk-m-alert.is-info {
    background: var(--wdk-info-bg);
    color: var(--wdk-primary-dark);
}

.wdk-m-content {
    padding: 12px 16px;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.wdk-m-loading,
.wdk-m-hint,
.wdk-m-muted {
    color: var(--wdk-muted);
}

.wdk-m-hint {
    margin: 0 0 8px;
    font-size: 0.9em;
}

.wdk-m-error {
    padding: 24px 0;
    text-align: center;
}

/* Mapa sali */
.wdk-m-maptools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.wdk-m-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9em;
}

.wdk-m-legend li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wdk-m-key {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 2px solid var(--wdk-free-stroke);
    background: var(--wdk-free);
}

.wdk-m-key.is-taken {
    border-color: var(--wdk-taken);
    background: repeating-linear-gradient(45deg, var(--wdk-taken), var(--wdk-taken) 3px, #fff 3px, #fff 6px);
}

.wdk-m-key.is-selected {
    border-color: var(--wdk-selected);
    background: var(--wdk-selected);
}

.wdk-m-key.is-attempted {
    border-color: var(--wdk-attempted);
    background: repeating-linear-gradient(-45deg, var(--wdk-attempted), var(--wdk-attempted) 2px, #fff 2px, #fff 5px);
}

.wdk-m-zoom {
    display: flex;
    gap: 4px;
}

.wdk-m-zoom {
    margin-bottom: 8px;
}

.wdk-m-zoom button {
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    font-size: 0.9em !important;
    font-weight: 700;
    border: 2px solid var(--wdk-primary);
    border-radius: 8px;
    background: #fff;
    color: var(--wdk-primary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.wdk-m-zoom button:disabled {
    opacity: 0.4;
    cursor: default;
}

.wdk-m-mapwrap {
    scroll-padding: 24px;
    overflow: auto;
    border: 1px solid var(--wdk-border);
    border-radius: 6px;
    background: #fafafa;
    max-height: 60vh;
    -webkit-overflow-scrolling: touch;
}

.wdk-m-map {
    display: block;
    width: 100%;
    height: auto;
    min-width: 100%;
}

.wdk-m-seat path {
    stroke-width: 2;
    transition: fill 0.15s ease;
}

.wdk-m-seat.is-free path {
    fill: var(--wdk-free);
    stroke: var(--wdk-free-stroke);
}

.wdk-m-seat.is-free {
    cursor: pointer;
}

.wdk-m-seat.is-free:hover path,
.wdk-m-seat.is-free:focus path {
    fill: #e3f2e5;
}

.wdk-m-seat.is-selected path,
.wdk-m-seat.is-selected:hover path,
.wdk-m-seat.is-selected:focus path {
    fill: var(--wdk-selected);
    stroke: var(--wdk-primary-dark);
}

.wdk-m-seat.is-taken path {
    fill: #fff;
    stroke: var(--wdk-taken);
    stroke-dasharray: 3 2;
}

.wdk-m-seat.is-attempted path {
    fill: #fff3e0;
    stroke: var(--wdk-attempted);
    stroke-width: 3;
}

.wdk-m-seat.is-attempted {
    cursor: pointer;
}

.wdk-m-seat:focus {
    outline: none;
}

.wdk-m-seat:focus-visible path,
.wdk-m-seat:focus path {
    stroke: #000;
    stroke-width: 4;
}

.wdk-m-num,
.wdk-m-mark {
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: central;
    font-family: inherit;
}

.wdk-m-num {
    fill: var(--wdk-free-stroke);
}

.wdk-m-mark {
    font-weight: 700;
}

.wdk-m-seat.is-selected .wdk-m-mark {
    fill: #fff;
}

.wdk-m-seat.is-taken .wdk-m-mark {
    fill: var(--wdk-taken);
}

.wdk-m-seat.is-attempted .wdk-m-mark {
    fill: var(--wdk-attempted);
}

.wdk-m-label {
    text-anchor: middle;
    dominant-baseline: central;
    font-size: 22px;
    font-weight: 700;
    fill: #555;
}

.wdk-m-deco {
    opacity: 0.6;
}

/* Stopka */
.wdk-m-foot {
    padding: 12px 16px;
    border-top: 1px solid var(--wdk-border);
    background: #fff;
}

.wdk-m-foot:empty {
    display: none;
}

.wdk-m-picked {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    max-height: 88px;
    overflow: auto;
}

.wdk-m-chip {
    border: 1px solid var(--wdk-primary);
    border-radius: 16px;
    background: var(--wdk-primary-soft);
    color: var(--wdk-primary-dark);
    padding: 4px 10px;
    font-size: 0.85em;
    cursor: pointer;
}

.wdk-m-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.wdk-m-total {
    margin-right: auto;
    font-weight: 700;
}

.wdk-m-btn {
    display: inline-block;
    min-height: 44px;
    padding: 10px 20px;
    border: 2px solid var(--wdk-primary);
    border-radius: 8px;
    background: #fff;
    color: var(--wdk-primary);
    font-weight: 700;
    font-size: 1em;
    text-decoration: none;
    cursor: pointer;
}

.wdk-m-btn.is-primary {
    background: var(--wdk-primary);
    color: #fff;
}

.wdk-m-btn:hover,
.wdk-m-btn:focus-visible {
    background: var(--wdk-primary-dark);
    border-color: var(--wdk-primary-dark);
    color: #fff;
}

.wdk-m-btn:disabled {
    opacity: 0.5;
    cursor: default;
    background: #fff;
    color: var(--wdk-primary);
    border-color: var(--wdk-primary);
}

.wdk-m-btn.is-primary:disabled {
    background: var(--wdk-primary);
    color: #fff;
}

.wdk-m-fallback {
    margin: 0;
    padding: 6px 16px 10px;
    text-align: center;
    font-size: 0.85em;
}

.wdk-m-fallback a {
    display: inline-block;
    min-height: 24px;          /* 2.5.8 */
    padding: 4px 2px;
    color: var(--wdk-muted);
}

/* Rodzaj biletu */
.wdk-m-typerow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.wdk-m-typerow label {
    font-weight: 700;
}

.wdk-m-typerow select {
    min-height: 44px;
    min-width: 240px;
    max-width: 100%;
    padding: 6px 8px;
    border: 2px solid var(--wdk-border);
    border-radius: 8px;
    font-size: 1em;
}

/* Podsumowanie */
.wdk-m-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}

.wdk-m-table th,
.wdk-m-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.wdk-m-table tfoot th,
.wdk-m-table tfoot td {
    font-weight: 700;
    border-bottom: 0;
}

.wdk-m-num-col {
    text-align: right !important;
    white-space: nowrap;
}

.wdk-m-done {
    text-align: center;
    padding: 16px 0;
}

.wdk-m-paylinks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* Mały ekran (wąski lub niski): przewija się całe okno, stopka z przyciskami zawsze widoczna */
@media (max-width: 600px), (max-height: 600px) {
    .wdk-modal-body {
        scroll-padding-bottom: 140px; /* 2.4.11: fokus nie pod przyklejoną stopką */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wdk-m-content {
        flex: 0 0 auto;
        overflow: visible;
    }

    .wdk-m-mapwrap {
        max-height: none;
        overflow-y: hidden;
    }

    .wdk-m-foot {
        position: sticky;
        bottom: 0;
        z-index: 1;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    }
}

/* Telefon: pełny ekran */
@media (max-width: 600px) {
    .wdk-m-poster {
        display: none;
    }

    .wdk-m-title {
        font-size: 1.1em;
    }

    .wdk-modal {
        padding: 0;
    }

    .wdk-modal-dialog {
        max-width: none;
        max-height: none;
        height: 100%;
        border-radius: 0;
    }

    .wdk-m-head {
        padding: 12px 56px 10px 12px;
        gap: 12px;
    }

    .wdk-m-steps {
        padding: 4px 8px;
        font-size: 0.75em;
    }

    .wdk-m-content {
        padding: 10px 12px;
    }

    .wdk-m-foot {
        padding: 10px 12px;
    }

    .wdk-m-actions .wdk-m-btn {
        flex: 1 1 auto;
    }

    .wdk-m-typerow select {
        min-width: 0;
        width: 100%;
    }
}

/* Paski odzyskania linku do płatności (WDK-020, WDK-021: jeden na zakup) */
.wdk-pay-banners {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 100001;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wdk-pay-banner {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 48px 12px 16px;
    border-radius: 8px;
    background: #0056b3;
    color: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.wdk-pay-banner a {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
}

.wdk-pay-banner-close {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* Tekst tylko dla czytników ekranu */
.wdk-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.wdk-m-h {
    margin: 0 0 8px;
    font-size: 1.05em;
}

.wdk-m-note {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-left: 4px solid var(--wdk-attempted);
    background: #fff8ef;
    color: #3d2400;
}

.wdk-m-note a,
.wdk-m-content a:not(.wdk-m-btn) {
    color: var(--wdk-primary-dark);
}

/* Zakładki: plan sali / lista miejsc */
.wdk-m-viewtabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.wdk-m-tab {
    min-height: 44px;
    padding: 8px 14px;
    border: 2px solid var(--wdk-primary-dark);
    border-radius: 8px;
    background: #fff;
    color: var(--wdk-primary-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.wdk-m-tab[aria-pressed="true"] {
    background: var(--wdk-primary-dark);
    color: #fff;
}

.wdk-m-legend {
    margin-bottom: 8px;
}

/* Lista miejsc (równoważna kontrolka dla 2.5.8) */
.wdk-m-listpick {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.wdk-m-listpick label {
    font-weight: 700;
}

.wdk-m-listpick select {
    min-height: 44px;
    padding: 6px 8px;
    border: 2px solid #767676;
    border-radius: 8px;
    font-size: 1em;
}

.wdk-m-seatlist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 6px;
}

.wdk-m-seatbtn {
    position: relative;
    min-width: 44px;
    min-height: 44px;
    border: 2px solid var(--wdk-free-stroke);
    border-radius: 8px;
    background: #fff;
    color: var(--wdk-free-stroke);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.wdk-m-seatbtn.is-selected {
    background: var(--wdk-selected);
    border-color: var(--wdk-selected);
    color: #fff;
}

.wdk-m-seatbtn.is-taken {
    border-style: dashed;
    border-color: var(--wdk-taken);
    color: var(--wdk-taken);
    cursor: not-allowed;
}

.wdk-m-seatbtn.is-attempted {
    border-color: var(--wdk-attempted);
    color: var(--wdk-attempted);
    background: #fff3e0;
}

.wdk-m-seatbtn:focus-visible,
.wdk-m-chip:focus-visible,
.wdk-m-tab:focus-visible,
.wdk-m-zoom button:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

.wdk-m-seatst {
    margin-left: 2px;
}

.wdk-m-chip {
    min-height: 32px;
}

/* Krok 4 */
.wdk-m-twostep {
    padding-left: 0;
    list-style: none;
}

.wdk-m-twostep li {
    margin-bottom: 10px;
}

.wdk-m-attempted ul {
    margin: 0 0 10px;
    padding-left: 20px;
}

.wdk-m-retry {
    display: inline-block;
    min-height: 24px;          /* 2.5.8 */
    padding: 2px 4px;
    font-weight: 700;
}

.wdk-m-payactions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

/* Nakładka skryptu pierwszego kliknięcia (LiteSpeed) */
.wdk-early-loading {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 100002;
    transform: translate(-50%, -50%);
    padding: 16px 24px;
    border-radius: 8px;
    background: #fff;
    color: #111;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
    .wdk-m-seat path {
        transition: none;
    }
}
