/*
 * Checkout (/koszyk, /koszyk/dane, /zamowienie/…): the steps, a card for
 * the current step and the order summary beside it. The details form uses
 * the form pieces from contact.css.
 */

.checkout {
    position: relative;
    isolation: isolate;
    overflow-x: clip;
    padding-bottom: clamp(80px, 9vw, 140px);
    background: var(--c-sand);
}

/* ---------- title and steps ---------- */

.checkout__intro,
.checkout__grid {
    position: relative;
    z-index: 2;
    max-width: calc(1180px + 2 * var(--gutter));
    margin: clamp(18px, 3vw, 40px) auto 0;
    padding: 0 var(--gutter);
}

.checkout__title {
    margin: .25em 0 0;
    font-family: var(--font-script);
    font-weight: 400;
    font-size: clamp(3.1875rem, 5.8vw, 5.4375rem);
    line-height: 1.05;
    color: var(--c-accent);
}

.checkout-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 0;
    margin: clamp(22px, 2.6vw, 34px) 0 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.checkout-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
    color: var(--c-ink-2);
    counter-increment: step;
}

.checkout-steps li::before {
    content: counter(step);
    display: grid;
    flex: none;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--c-accent);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: inset 0 0 0 1.5px rgba(110, 20, 35, .35);
}

.checkout-steps li:not(:last-child)::after {
    content: "";
    width: clamp(18px, 3vw, 48px);
    height: 1px;
    margin: 0 12px;
    background: var(--c-accent);
    opacity: .3;
}

.checkout-steps li.is-done::before { content: "✓"; background: var(--c-accent); color: #fff; box-shadow: none; }
.checkout-steps li[aria-current="step"] { color: var(--c-accent); font-weight: 500; }
.checkout-steps li[aria-current="step"]::before { background: var(--c-accent); color: #fff; box-shadow: 0 6px 14px -6px rgba(110, 20, 35, .6); }

/* ---------- layout ---------- */

.checkout__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    align-items: start;
    gap: clamp(24px, 3.4vw, 52px);
    margin-top: clamp(26px, 3vw, 40px);
}

.checkout-card {
    --frame-shadow: 0 30px 50px -30px rgba(80, 30, 25, .45), 0 2px 8px rgba(80, 30, 25, .05);
    margin: 0 14px 14px 0;
    padding: clamp(22px, 3vw, 40px);
    border-radius: 22px;
    background: var(--c-white);
}

.checkout-card__title {
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(1.875rem, 2.6vw, 2.5rem);
    line-height: 1.05;
    color: var(--c-accent);
}

.checkout-card__sub { margin: .4em 0 0; font-size: 1rem; color: var(--c-ink-2); }

.checkout-banner {
    margin: 0 0 18px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #FFF7EC;
    color: #6B4300;
    font-size: 0.9688rem;
    box-shadow: inset 0 0 0 1px rgba(160, 110, 20, .3);
}

.checkout-banner--success { background: #EEF6F0; color: #2F6B45; box-shadow: inset 0 0 0 1px rgba(47, 107, 69, .3); }

/* ---------- basket lines ---------- */

/* one event's tickets, under its name and date */
.checkout-event { margin-top: clamp(24px, 2.6vw, 34px); }
.checkout-event + .checkout-event { padding-top: clamp(24px, 2.6vw, 34px); border-top: 1px dashed var(--c-line); }

.checkout-event__name {
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(1.375rem, 1.8vw, 1.625rem);
    line-height: 1.15;
    color: var(--c-accent);
}

.checkout-event__when { margin: 4px 0 0; font-size: 0.9375rem; color: var(--c-ink-2); }
.checkout-event .checkout-lines { margin-top: 14px; }

.checkout-lines { margin: clamp(18px, 2vw, 26px) 0 0; padding: 0; list-style: none; }

.checkout-line {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    grid-template-areas: "icon info total" "icon qty remove";
    align-items: center;
    gap: 8px 18px;
    padding: 20px 0;
    border-top: 1px solid var(--c-line);
}

.checkout-line:last-child { border-bottom: 1px solid var(--c-line); }

.checkout-line__icon {
    --notch: 7px;
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 72px;
    height: 56px;
    border-radius: 10px;
    background: var(--c-ivory);
    color: var(--c-accent);
    box-shadow: inset 0 0 0 1px rgba(110, 20, 35, .14);
}

.checkout-line__icon svg { width: 26px; height: 26px; }

.checkout-line__info { grid-area: info; min-width: 0; }

.checkout-line__name {
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(1.4375rem, 1.8vw, 1.6875rem);
    line-height: 1.1;
    color: var(--c-accent);
}

.checkout-line__meta { margin: 3px 0 0; font-size: 0.9375rem; color: var(--c-ink-2); }
.checkout-line__problem { margin: 6px 0 0; font-size: 0.875rem; font-weight: 500; color: #A3122A; }

.checkout-line__total {
    grid-area: total;
    justify-self: end;
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(1.5rem, 1.9vw, 1.75rem);
    font-variant-numeric: lining-nums tabular-nums;
}

.checkout-line.is-off .checkout-line__name,
.checkout-line.is-off .checkout-line__total { color: #8A7F7F; }
.checkout-line.is-off .checkout-line__total { text-decoration: line-through; }

/* − n + */
.stepper {
    grid-area: qty;
    display: inline-flex;
    align-items: center;
    justify-self: start;
    border-radius: 999px;
    background: var(--c-card);
    box-shadow: inset 0 0 0 1.5px rgba(110, 20, 35, .3);
}

.stepper__btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--c-accent);
    cursor: pointer;
}

.stepper__btn:hover:not(:disabled) { background: rgba(110, 20, 35, .08); }
.stepper__btn:disabled { color: #B5A9A9; cursor: not-allowed; }
.stepper__btn svg { width: 18px; height: 18px; }

.stepper__value { min-width: 34px; font-size: 1.0625rem; font-weight: 500; text-align: center; font-variant-numeric: tabular-nums; }

.checkout-line__remove { grid-area: remove; justify-self: end; }

.checkout-line__remove button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: var(--c-ink-2);
    font: inherit;
    font-size: 0.9375rem;
    text-decoration: underline;
    text-decoration-color: rgba(75, 63, 64, .4);
    text-underline-offset: 3px;
    cursor: pointer;
}

.checkout-line__remove button:hover { color: var(--c-accent); }
.checkout-line__remove svg { width: 17px; height: 17px; }

/* ---------- other tickets, hint ---------- */

.checkout-more { margin: clamp(24px, 2.6vw, 32px) 0 0; }

.checkout-more__title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--c-ink-2);
}

.checkout-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.checkout-view--center .checkout-chips { justify-content: center; margin-top: 22px; }

.checkout-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--c-ivory);
    color: var(--c-ink);
    font: inherit;
    font-size: 0.9375rem;
    box-shadow: inset 0 0 0 1px rgba(110, 20, 35, .25);
    cursor: pointer;
}

.checkout-chip:hover { box-shadow: inset 0 0 0 1.5px var(--c-accent); }
.checkout-chip svg { width: 16px; height: 16px; color: var(--c-accent); }
.checkout-chip b { font-weight: 500; color: var(--c-accent); }

.checkout-hint { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 0; font-size: 0.9375rem; color: var(--c-ink-2); }
.checkout-hint svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--c-accent); }

/* ---------- actions ---------- */

.checkout-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: clamp(24px, 2.6vw, 34px);
}

.checkout-link {
    display: inline-flex;
    align-items: center;
    min-height: 52px;
    padding: 0 4px;
    color: var(--c-accent);
    font-size: 1.0625rem;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(110, 20, 35, .35);
    text-underline-offset: 4px;
}

.checkout-link:hover { text-decoration-color: currentColor; }

.checkout .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- details form ---------- */

.checkout-form { margin-top: clamp(18px, 2vw, 26px); }
.checkout-form textarea.contact-input { min-height: 96px; }
.checkout-form .checkout-actions { margin-top: 6px; }
.checkout-form .contact-check a { color: var(--c-accent); text-underline-offset: 3px; }

/* discount code: input + "Zastosuj", or the applied code + "Usuń kod" */
.checkout-discount__row { display: flex; gap: 10px; }
.checkout-discount__row .contact-input { flex: 1; min-width: 0; text-transform: uppercase; }
.checkout-discount__row .btn { flex: none; }

.checkout-discount__applied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #EEF6F0;
    box-shadow: inset 0 0 0 1px rgba(47, 107, 69, .3);
}

.checkout-discount__applied p { display: flex; align-items: center; gap: 10px; margin: 0; color: #2F6B45; }
.checkout-discount__applied svg { flex: none; width: 20px; height: 20px; }

.checkout-discount__remove {
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--c-ink-2);
    font: inherit;
    font-size: 0.9375rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.checkout-discount__remove:hover { color: var(--c-accent); }

.checkout-form__note {
    margin: 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--c-ivory);
    font-size: 0.9062rem;
    color: var(--c-ink-2);
    box-shadow: inset 0 0 0 1px rgba(110, 20, 35, .1);
}

.checkout-form__note a { color: var(--c-accent); }
.checkout-form__after { margin: 0; font-size: 0.875rem; text-align: right; color: var(--c-ink-2); }
.checkout-pay { flex: 1 1 auto; max-width: 420px; }

/* ---------- empty basket, confirmation ---------- */

.checkout-view--center { padding: clamp(10px, 2vw, 24px) 0; text-align: center; }
.checkout-view--center .checkout-card__title { margin-top: 20px; }
.checkout-view--center > p { max-width: 30em; margin: 10px auto 0; font-size: 1.0625rem; }
.checkout-view--center .checkout-actions { justify-content: center; }

.checkout-view__icon {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--c-ivory);
    color: var(--c-accent);
    box-shadow: inset 0 0 0 1px rgba(110, 20, 35, .15);
}

.checkout-view__icon svg { width: 36px; height: 36px; }
.checkout-view__icon--done { background: var(--c-accent); color: #fff; box-shadow: 0 14px 30px -14px rgba(110, 20, 35, .7); }

.checkout-view__reference { font-size: 0.875rem !important; color: var(--c-ink-2); }

.checkout-next {
    display: grid;
    gap: 14px;
    max-width: 30em;
    margin: 26px auto 0;
    padding: 0;
    list-style: none;
    text-align: left;
    counter-reset: next;
}

.checkout-next li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; font-size: 1rem; counter-increment: next; }

.checkout-next li::before {
    content: counter(next);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--c-ivory);
    color: var(--c-accent);
    font-weight: 500;
    box-shadow: inset 0 0 0 1px rgba(110, 20, 35, .18);
}

/* ---------- summary ---------- */

.checkout-summary {
    position: sticky;
    top: 24px;
    padding: clamp(22px, 2.4vw, 30px);
    border-radius: 22px;
    background: var(--c-ivory);
    box-shadow: inset 0 0 0 1px rgba(110, 20, 35, .12), 0 24px 40px -30px rgba(80, 30, 25, .4);
}

.checkout-summary__title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--c-accent);
}

.checkout-summary__event { margin: 16px 0 0; padding: 0 0 18px; border-bottom: 1px solid var(--c-line); }

.checkout-summary__name {
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 1.625rem;
    line-height: 1.1;
    color: var(--c-accent);
}

.checkout-summary__event ul { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.9375rem; color: var(--c-ink-2); }
.checkout-summary__event li { display: flex; align-items: flex-start; gap: 10px; }
.checkout-summary__event svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--c-accent); }

.checkout-summary__lines { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.checkout-summary__lines li { display: flex; justify-content: space-between; gap: 12px; font-size: 1rem; }
.checkout-summary__lines span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.checkout-summary__lines .is-empty { color: var(--c-ink-2); }

/* an event's tickets, under its date and venue */
.checkout-summary__event .checkout-summary__lines { gap: 8px; margin-top: 14px; font-size: 1rem; color: var(--c-ink); }
.checkout-summary__event .checkout-summary__lines li { justify-content: space-between; gap: 12px; }

.checkout-summary__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--c-line);
}

.checkout-summary__total span { font-size: 1.0625rem; font-weight: 500; }

.checkout-summary__total strong {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 2.5rem;
    line-height: 1;
    color: var(--c-accent);
    font-variant-numeric: lining-nums tabular-nums;
}

.checkout-summary__incl { margin: 6px 0 0; font-size: 0.875rem; text-align: right; color: var(--c-ink-2); }

.checkout-summary__trust {
    display: grid;
    gap: 12px;
    margin: 20px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--c-line);
    font-size: 0.9062rem;
    color: var(--c-ink-2);
}

.checkout-summary__trust p { display: flex; align-items: flex-start; gap: 10px; margin: 0; }
.checkout-summary__trust svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--c-accent); }
.checkout-summary__trust a { color: var(--c-accent); }

.checkout-summary__methods { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

.checkout-summary__methods li {
    padding: 4px 10px;
    border-radius: 6px;
    background: #fff;
    color: var(--c-ink);
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: inset 0 0 0 1px rgba(110, 20, 35, .15);
}

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

@media (max-width: 960px) {
    .checkout__grid { grid-template-columns: minmax(0, 1fr); }
    .checkout-summary { position: static; }
}

@media (max-width: 640px) {
    .checkout-card { --frame-x: 8px; --frame-y: 8px; margin: 0 8px 8px 0; }

    /* only the current step keeps its name */
    .checkout-steps li { gap: 0; font-size: 0; }
    .checkout-steps li[aria-current="step"] { gap: 10px; font-size: 0.9375rem; }
    .checkout-steps li:not(:last-child)::after { width: 16px; margin: 0 6px; }

    .checkout-line { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px 12px; }
    .checkout-line__icon { width: 56px; height: 46px; }

    .checkout-actions { flex-direction: column-reverse; align-items: stretch; }
    .checkout-actions .btn { width: 100%; }
    .checkout-link { justify-content: center; }
    .checkout-pay { max-width: none; }
}
