/**
 * checkout.css — MT Checkout System
 * Paleta MT:
 *   --primary: #A52834                    — CTA/akcent
 *   --primary-light: #C94755
 *   --primary-dark: #7F1D28               — hover CTA
 *   --cream: #FFF8F6                      — tło
 *   --cream-dark: #F7ECE9                 — bump bg
 *   --charcoal: #2C2625                   — tekst
 * Fonty: Inter (główny) + Roboto (body)
 */

:root {
    --primary: #A52834;
    --primary-light: #C94755;
    --primary-dark: #7F1D28;
    --cream: #FFF8F6;
    --cream-dark: #F7ECE9;
    --charcoal: #2C2625;
    --charcoal-light: rgba(44, 38, 37, 0.8);
    --charcoal-muted: rgba(44, 38, 37, 0.6);
    --star: #D8A338;
    --success: #22c55e;
}

/* ===== RESET / BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--charcoal);
    background: #fff;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .product-name, .form-heading, .payment-heading, .cta-button {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

a {
    color: var(--primary-dark);
    text-decoration: underline;
}

a:hover {
    text-decoration: none;
    color: var(--charcoal);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== STICKY COUNTDOWN TOP BAR ===== */
.sticky-countdown-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #8b0000, #660000);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.sticky-countdown-bar.expired { display: none; }

.sticky-countdown-cta {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sticky-countdown-timer {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    display: inline-flex;
    gap: 6px;
    font-size: 1.1rem;
    font-weight: 800;
}

.sticky-cd-unit {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
}

.sticky-cd-num {
    font-size: 1.1em;
    line-height: 1;
}

.sticky-cd-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.55em;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.8;
}

/* ===== LAYOUT ===== */
.checkout-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    padding-top: 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.checkout-left {
    position: sticky;
    top: 60px;
}

.checkout-right {
    /* prawy panel scrolluje normalnie */
}

/* ===== PRODUCT HEADER ===== */
.product-header {
    margin-bottom: 16px;
}

.product-image {
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.product-name {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
    color: var(--charcoal);
}

.product-subtitle {
    font-size: 0.95rem;
    color: var(--charcoal-light);
    margin-bottom: 12px;
    line-height: 1.5;
}

.product-description {
    font-size: 0.92rem;
    color: var(--charcoal);
    margin-bottom: 20px;
    line-height: 1.65;
}

.product-included-list {
    list-style: none;
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
}

.product-included-list li {
    position: relative;
    padding-left: 28px;
    font-size: 0.9rem;
    color: var(--charcoal);
    line-height: 1.45;
}

.product-included-list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    top: 1px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

/* ===== CENY ===== */
.product-prices {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 4px 0 6px;
    flex-wrap: wrap;
}

.price-regular {
    font-size: 1.32rem;
    font-weight: 700;
    color: rgba(44, 38, 37, 0.58);
    text-decoration-line: line-through;
    text-decoration-color: var(--primary);
    text-decoration-thickness: 2px;
}

.price-promo {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px 3px;
    border-radius: 8px;
    background: rgba(165, 40, 52, 0.09);
    box-shadow: inset 0 -0.36em rgba(165, 40, 52, 0.12);
    font-size: 2.45rem;
    font-weight: 900;
    line-height: 1;
    color: var(--primary);
}

.price-omnibus {
    font-size: 0.75rem;
    color: var(--charcoal-muted);
    margin-bottom: 20px;
}

/* ===== OPINIE ===== */
.reviews-section {
    background: var(--cream-dark);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.reviews-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.reviews-stars {
    display: flex;
    gap: 2px;
}

.review-star {
    font-size: 1.1rem;
    line-height: 1;
}

.review-star.full,
.review-star.half {
    color: var(--star);
}

.review-star.empty {
    color: #ddd;
}

.reviews-avg {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--charcoal);
}

.reviews-count {
    font-size: 0.85rem;
    color: var(--charcoal-light);
}

/* Karuzela opinii */
.reviews-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.reviews-carousel::-webkit-scrollbar {
    height: 4px;
}

.reviews-carousel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.review-card {
    flex: 0 0 auto;
    min-width: 200px;
    max-width: 260px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    scroll-snap-align: start;
}

.review-card .review-stars {
    display: flex;
    gap: 1px;
    margin-bottom: 6px;
}

.review-card .review-star {
    font-size: 0.85rem;
}

.review-text {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--charcoal-light);
    margin-bottom: 8px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.review-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--charcoal-muted);
}

/* ===== SOCIAL PROOF BAR ===== */
.social-proof-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--charcoal-light);
    padding: 10px 0;
    flex-wrap: wrap;
}

.sp-separator {
    color: #ccc;
}

/* ===== COUNTDOWN BAR ===== */
.countdown-bar {
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    text-align: left;
    padding: 14px 16px;
    border-radius: 8px;
    margin: 14px 0 20px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(165, 40, 52, 0.18);
}

.countdown-text {
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.1;
    text-transform: uppercase;
    opacity: 0.92;
}

.countdown-timer {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 9px;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    white-space: nowrap;
}

.countdown-part {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
}

.countdown-number {
    font-size: 1em;
    line-height: 1;
}

.countdown-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.48em;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    opacity: 0.82;
    text-transform: uppercase;
}

/* ===== FORMULARZ ===== */
.checkout-form {
    margin-bottom: 20px;
}

.form-heading {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--charcoal);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 5px;
}

.required {
    color: var(--primary-dark);
}

.form-input {
    display: block;
    width: 100%;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--charcoal);
    background: #fff;
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(244, 208, 63, 0.2);
}

.form-input::placeholder {
    color: #bbb;
}

.form-error {
    font-size: 0.8rem;
    color: #DC2626;
    margin-top: 4px;
    min-height: 0;
}

.form-error:empty {
    display: none;
}

/* ===== KUPON ===== */
.coupon-row {
    display: flex;
    gap: 8px;
}

.coupon-input {
    flex: 1;
    border-style: dashed;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.coupon-btn {
    flex-shrink: 0;
    background: var(--charcoal);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.coupon-btn:hover {
    background: #4a3f3d;
}

.coupon-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

.coupon-success {
    font-size: 0.82rem;
    color: var(--success);
    margin-top: 4px;
}

.coupon-success:empty {
    display: none;
}

/* ===== BUMPY ===== */
.bump-item {
    background: #f0faf3;
    border-left: 3px solid #28a745;
    border-radius: 8px;
    padding: 14px 14px 14px 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    user-select: none;
}

.bump-item:hover {
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

.bump-item.checked {
    border-left-color: #1e7e34;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
    background: #e6f7eb;
}

.bump-checkbox {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #8bc9a0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: background 0.15s, border-color 0.15s;
    font-size: 13px;
    color: var(--charcoal);
}

.bump-item.checked .bump-checkbox {
    background: #28a745;
    border-color: #1e7e34;
    color: #fff;
}

.bump-content {
    flex: 1;
    min-width: 0;
}

.bump-urgency {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1e7e34;
    margin-bottom: 3px;
}

.bump-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 2px;
}

.bump-subtitle {
    font-size: 0.82rem;
    color: var(--charcoal-light);
    margin-bottom: 4px;
    line-height: 1.4;
}

.bump-prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.bump-price-old {
    font-size: 0.82rem;
    color: var(--charcoal-muted);
    text-decoration: line-through;
}

.bump-price-new {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--charcoal);
}

.bump-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
}

/* ===== METODY PŁATNOŚCI ===== */
.payment-methods {
    margin-bottom: 16px;
}

.payment-heading {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--charcoal);
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.payment-option:hover {
    border-color: #ccc;
}

.payment-option.active {
    border-color: var(--primary-dark);
    background: var(--cream);
}

.payment-option input[type="radio"] {
    display: none;
}

.payment-radio {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s;
}

.payment-option.active .payment-radio {
    border-color: var(--primary-dark);
}

.payment-option.active .payment-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-dark);
}

.payment-label {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--charcoal);
}

.payment-logo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 28px;
    padding: 3px 6px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #eee;
}

.payment-logo-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.payment-logo-img-blik {
    max-height: 22px;
}

.payment-logo-img-tpay {
    max-height: 19px;
}

.payment-logo-stripe {
    background: #f2f0ff;
    color: #635bff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
}

/* BLIK input */
.blik-input-wrapper {
    padding: 0 0 8px 42px;
    transition: max-height 0.25s ease, opacity 0.2s;
    max-height: 80px;
    opacity: 1;
    overflow: hidden;
}

.blik-input-wrapper.hidden {
    max-height: 0;
    opacity: 0;
    padding: 0 0 0 42px;
}

.blik-input {
    text-align: center;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 1.25rem;
    letter-spacing: 6px;
    max-width: 200px;
    padding: 10px;
}

/* ===== REGULAMIN ===== */
.terms-row {
    margin-bottom: 16px;
}

.terms-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.terms-label input[type="checkbox"] {
    display: none;
}

.terms-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    font-size: 12px;
    color: var(--charcoal);
}

.terms-label input[type="checkbox"]:checked + .terms-checkbox {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: #fff;
}

.terms-label input[type="checkbox"]:checked + .terms-checkbox::after {
    content: '\2713';
}

.terms-text {
    font-size: 0.82rem;
    color: var(--charcoal-light);
    line-height: 1.45;
}

.terms-text a {
    color: var(--primary-dark);
}

/* ===== PRZYCISK CTA ===== */
.cta-button {
    display: block;
    width: 100%;
    background: #FF6600;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    text-align: center;
    letter-spacing: 0.3px;
    box-shadow: 0 8px 18px rgba(255, 102, 0, 0.3);
}

.cta-button:hover {
    background: #E55A00;
    color: #fff;
    box-shadow: 0 10px 22px rgba(229, 90, 0, 0.38);
}

.cta-button:active {
    transform: scale(0.99);
}

.cta-button.loading {
    background: #FF8533;
    color: #fff;
    cursor: not-allowed;
    pointer-events: none;
    animation: ctaPulse 1.2s ease-in-out infinite;
}

@keyframes ctaPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.cta-summary {
    text-align: center;
    font-size: 0.8rem;
    color: var(--charcoal-muted);
    margin-top: 8px;
    line-height: 1.45;
}

/* ===== TRUST BADGES ===== */
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    padding: 16px 0 6px;
}

.trust-badge {
    font-size: 0.78rem;
    color: var(--charcoal-muted);
    white-space: nowrap;
}

.trust-powered {
    text-align: center;
    font-size: 0.72rem;
    color: #bbb;
    padding-bottom: 8px;
}

/* ===== RESPONSIVE — MOBILE ===== */
@media (max-width: 768px) {
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 16px 12px 32px;
    }

    .checkout-left {
        position: static;
    }

    .product-name {
        font-size: 1.3rem;
    }

    .price-promo {
        font-size: 2rem;
    }

    .price-regular {
        font-size: 1.12rem;
    }

    .review-card {
        min-width: 170px;
        max-width: 220px;
    }

    .blik-input-wrapper {
        padding-left: 0;
    }

    .payment-option {
        padding: 10px 12px;
    }

    .sticky-countdown-bar {
        padding: 8px 12px;
        gap: 8px;
    }

    .sticky-countdown-cta {
        font-size: 0.75rem;
    }

    .sticky-countdown-timer {
        font-size: 0.95rem;
        gap: 4px;
    }

    .sticky-cd-unit {
        padding: 2px 5px;
    }

    .checkout-container {
        padding-top: 52px;
    }

    .checkout-left {
        top: 52px;
    }

    .countdown-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .countdown-timer {
        font-size: 1.3rem;
        justify-content: flex-start;
    }

    .trust-badges {
        gap: 10px;
    }
}

@media (max-width: 400px) {
    .coupon-row {
        flex-direction: column;
    }

    .coupon-btn {
        width: 100%;
    }

    .bump-item {
        flex-direction: column;
    }

    .bump-image {
        width: 100%;
        height: auto;
        max-height: 120px;
    }
}
