/* ============================================================
   Modal checkoutu — dane kontaktowe / adres / dostawa / płatność / zgody
   + podsumowanie koszyka. Te same tokeny co reszta strony (cart.css,
   toast.css): biel/czerń, zaokrąglone piguły, sygnaturowy cień.
   ============================================================ */

.checkout-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4500;
    padding: 20px;
}

.checkout-overlay.hidden {
    display: none;
}

.checkout-card {
    background: #ffffff;
    color: #000000;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    border-radius: 20px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Barlow Semi Condensed', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}

.checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 14px 20px;
    border-bottom: 1px solid #eeeeee;
    flex-shrink: 0;
}

.checkout-header h2 {
    margin: 0;
    font-size: 19px;
}

.checkout-body {
    overflow-y: auto;
    padding: 18px 20px 20px 20px;
    scrollbar-width: thin;
    scrollbar-color: #000000 transparent;
}

.checkout-body::-webkit-scrollbar {
    width: 4px;
}

.checkout-body::-webkit-scrollbar-thumb {
    background: #0000009f;
    border-radius: 10px;
}

.checkout-test-banner {
    background: #fff3cd;
    color: #7a5b00;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.checkout-test-banner.hidden {
    display: none;
}

/* ---------- Podsumowanie zamówienia (jak panele w koszyku) ---------- */
.checkout-summary {
    margin-bottom: 20px;
}

.checkout-summary-item {
    margin-bottom: 10px;
}

.checkout-summary-item img {
    width: 56px;
    height: 56px;
}

.checkout-summary-total {
    margin-bottom: 0;
    padding-top: 10px;
    border-top: 1px solid #eeeeee;
}

.checkout-summary-discount {
    padding-top: 0;
    border-top: none;
    color: #a08000;
}

.checkout-summary-discount span,
.checkout-summary-discount strong {
    color: #a08000;
}

.checkout-summary-grand strong {
    color: #a80808;
}

/* ---------- Kod rabatowy ---------- */
.checkout-discount {
    margin-bottom: 20px;
}

.checkout-discount-row {
    display: flex;
    gap: 8px;
}

.checkout-discount-row input {
    flex: 1;
    text-transform: uppercase;
    font-size: 15px;
    font-weight: 400;
    padding: 10px 12px;
    border: 1px solid #d6d6d9;
    border-radius: 10px;
    font-family: inherit;
    background: #fff;
    color: #000;
}

.checkout-discount-row input:focus {
    outline: none;
    border-color: #000;
}

#co-discount-apply {
    flex-shrink: 0;
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 30px;
    padding: 0 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

#co-discount-apply:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (hover: hover) and (pointer: fine) {
    #co-discount-apply:not(:disabled):hover {
        background: #000000;
        color: #ffffff;
    }
}

.checkout-discount-message {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: #777777;
}

.checkout-discount-message.checkout-discount-error {
    color: #a80808;
}

/* ---------- Sekcje formularza ---------- */
.checkout-section {
    margin-bottom: 20px;
}

.checkout-section h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #777;
    margin: 0 0 10px 0;
}

.checkout-section label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.checkout-row {
    display: flex;
    gap: 10px;
}

.checkout-row label {
    flex: 1;
}

.checkout-section input[type="text"],
.checkout-section input[type="email"],
.checkout-section input[type="tel"] {
    font-size: 15px;
    font-weight: 400;
    padding: 10px 12px;
    border: 1px solid #d6d6d9;
    border-radius: 10px;
    font-family: inherit;
    background: #fff;
    color: #000;
}

.checkout-section input:focus {
    outline: none;
    border-color: #000;
}

/* Sekcja opcjonalna w trybie testowym — lekko przygaszona, żeby było
   jasne, że nie trzeba nic wybierać. */
.checkout-section-optional {
    opacity: 0.55;
}

.checkout-section-optional h3::after {
    content: " (pominięte w trybie testowym)";
    text-transform: none;
    letter-spacing: normal;
}

.checkout-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkout-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #eeeeee;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.checkout-option:has(input:checked) {
    border-color: #000;
    background: #fafafa;
}

.checkout-option input {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #000;
}

.checkout-option-label {
    flex: 1;
}

.checkout-option-price {
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- Zgody ---------- */
.checkout-consents {
    margin-bottom: 14px;
}

.checkout-checkbox {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    font-weight: 400;
    color: #555;
    margin-bottom: 10px;
}

.checkout-checkbox input {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: #000;
}

.checkout-checkbox a {
    color: #000;
}

#checkout-error {
    color: #b3261e;
    font-size: 13px;
    margin: 0 0 10px 0;
    min-height: 0;
}

#checkout-submit {
    color: #f2f2f2;
    background-color: #202020;
    border: 2px solid #000000;
    border-radius: 30px;
    width: 100%;
    padding: 12px 15px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.25);
    transition: background-color 0.3s, color 0.3s, opacity 0.2s;
    cursor: pointer;
    text-align: center;
}

@media (hover: hover) and (pointer: fine) {
    #checkout-submit:hover {
        background-color: #ffffff;
        color: #111111;
    }
}

#checkout-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

@media (max-width: 480px) {
    .checkout-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .checkout-card {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
    }

    .checkout-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ---------- Wiersz "wybierz punkt odbioru" pod metodą dostawy ---------- */
.pickup-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.pickup-row.hidden {
    display: none;
}

.pickup-status {
    flex: 1;
    min-width: 0;
    background: #202020;
    color: #f2f2f2;
    border-radius: 30px;
    padding: 12px 16px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pickup-status.pickup-status-filled {
    background: #000000;
}

.pickup-select-btn {
    flex-shrink: 0;
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 30px;
    padding: 11px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .pickup-select-btn:hover {
        background: #000000;
        color: #ffffff;
    }
}

/* ---------- Popup wyboru punktu — mniejszy, czarny, wyśrodkowany ---------- */
.pickup-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4800;
    padding: 20px;
}

.pickup-popup-overlay.hidden {
    display: none;
}

.pickup-popup-card {
    background: #000000;
    color: #ffffff;
    width: 100%;
    max-width: 340px;
    max-height: 60vh;
    border-radius: 18px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: 'Barlow Semi Condensed', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}

.pickup-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pickup-popup-header h3 {
    margin: 0;
    font-size: 15px;
    color: #ffffff;
}

.pickup-popup-close {
    background: #ffffff;
    color: #000000;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.pickup-search-input.hidden {
    display: none;
}

.pickup-popup-card.inpost-mode {
    max-width: 420px;
    max-height: 75vh;
}

.inpost-widget-wrap {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    height: 440px;
}

.inpost-widget-wrap inpost-geowidget {
    display: block;
    width: 100%;
    height: 100%;
}

.pickup-search-input {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #333333;
    background: #111111;
    color: #ffffff;
    font-family: inherit;
}

.pickup-search-input::placeholder {
    color: #888888;
}

.pickup-search-input:focus {
    outline: none;
    border-color: #ffffff;
}

.pickup-results {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: #555555 transparent;
}

.pickup-hint,
.pickup-error {
    margin: 4px 0;
    font-size: 12px;
    color: #aaaaaa;
    font-family: 'Courier New', Courier, monospace;
}

.pickup-error {
    color: #ff8f87;
}

.pickup-result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    background: #111111;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 10px 12px;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pickup-result:hover {
    background: #1a1a1a;
    border-color: #555555;
}

.pickup-result-code {
    font-size: 13px;
    font-weight: 700;
}

.pickup-result-address {
    font-size: 12px;
    color: #bbbbbb;
}

.pickup-manual-confirm {
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 30px;
    padding: 10px 15px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.pickup-manual-confirm:hover {
    background: #dddddd;
}

/* Opis metody dostawy pod jej nazwą (np. adres odbioru osobistego). */
.checkout-option-desc {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 400;
    color: #777777;
}

/* Opcja dostawy/płatności to <label> w .checkout-section, a ta reguła
   (flex-direction: column, margin-bottom) wygrywała specyficznością i
   układała radio, nazwę, opis i cenę w kolumnę — wymuszamy wiersz:
   radio | nazwa + opis | cena. */
.checkout-section .checkout-option {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    font-size: 14px;
}

.checkout-section .checkout-option-label {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    text-align: left;
}

.checkout-section .checkout-option-desc {
    margin-top: 3px;
    line-height: 1.35;
}

.checkout-section .checkout-option-price {
    flex-shrink: 0;
    font-weight: 700;
    white-space: nowrap;
}
