/* Checkout Modernization - Adapted from Cart Modernization */

:root {
    --cta-bg: #CF0000;
    --cta-hover-bg: #9f0000;
    --cta-color: #FFF;
    --cta-radius: 5px;
    --text-muted: #7a7a7a;
    --border-light: #f1f1f1;
    --card-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Fix layout wrapping & enable sticky */
body#checkout #content .row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-top: 30px;
    align-items: flex-start !important;
    overflow: visible !important;
}

/* Ensure no parent containers break sticky */
body#checkout, 
body#checkout #wrapper, 
body#checkout #content-wrapper,
body#checkout .tv-main-div,
body#checkout #content {
    overflow: visible !important;
}

/* Left Column - Steps Wrapper */
.tvcheckout-process-left {
    padding-right: 15px;
}

/* SUPER SPECIFIC OVERRIDE - Targeting exactly what wins in devtools */
body#checkout div.checkout-step,
body#checkout .checkout-step,
#checkout-personal-information-step,
#checkout-addresses-step,
#checkout-delivery-step,
#checkout-payment-step {
    background-color: #fff !important;
    padding: 30px !important;
    border-radius: 12px !important;
    box-shadow: var(--card-shadow) !important;
    border: none !important;
    margin-bottom: 25px !important;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* === Przelewy24 Logo Size Fix === */
#checkout-payment-step .payment-option img.img-fluid {
    max-width: 20% !important;
}

/* Kill all possible theme borders */
body#checkout div.checkout-step.-current,
body#checkout div.checkout-step.-reachable,
body#checkout div.checkout-step.-complete,
body#checkout div.checkout-step.-unreachable {
    border: none !important;
    border-bottom: none !important;
    background-color: #fff !important;
}

.checkout-step .step-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #222 !important;
    border: none !important;
    margin-bottom: 20px !important;
    display: flex !important;
    align-items: center !important;
    text-transform: none !important;
}

.checkout-step .step-number {
    background: #f0f0f0 !important;
    color: #444 !important;
    width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 0.9rem !important;
    margin-right: 15px !important;
    font-weight: 600 !important;
}

.checkout-step.-current .step-number {
    background: var(--cta-bg) !important;
    color: #fff !important;
}

.checkout-step.-complete .step-number {
    background: #4caf50 !important;
    color: #fff !important;
}

/* Right Column Summary - STICKY */
.tvcheckout-process-right {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 20px !important;
    z-index: 10;
}

body#checkout #js-checkout-summary,
body#checkout .card.js-cart#js-checkout-summary {
    background: #fff !important;
    padding: 30px !important;
    border-radius: 12px !important;
    box-shadow: var(--card-shadow) !important;
    border: none !important;
}

#js-checkout-summary hr.separator {
    display: none !important;
}

/* Buttons (CTAs) */
.btn-primary,
.continue,
button[name="confirm-addresses"],
button[name="confirmDeliveryOption"],
#payment-confirmation button,
#payment-confirmation .tvall-inner-btn {
    display: flex !important;
    width: 100% !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 15px 30px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    border-radius: var(--cta-radius) !important;
    background-color: var(--cta-bg) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(207, 0, 0, 0.2) !important;
}

/* General Minimalism & Reset */
body#checkout .card {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

body#checkout .card-block {
    padding: 0 !important;
}

body#checkout hr {
    display: none !important;
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    body#checkout div.checkout-step,
    body#checkout .checkout-step {
        padding: 20px !important;
    }
    
    body#checkout #js-checkout-summary {
        padding: 20px !important;
    }
}

/* === Przelewy24 Order Confirmation & Repayment — all variants === */
[class*="js-przelewy24-order-confirmation"],
.przelewy24-repayment__submit-wrapper,
.alert:has(.przelewy24-order-confirmation__icon):not([class*="js-przelewy24-order-confirmation"] .alert) {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 80% !important; /* Domyślnie poniżej 620px */
}

@media (min-width: 620px) {
    [class*="js-przelewy24-order-confirmation"],
    .przelewy24-repayment__submit-wrapper,
    .alert:has(.przelewy24-order-confirmation__icon):not([class*="js-przelewy24-order-confirmation"] .alert) {
        max-width: 60% !important;
    }
}

@media (min-width: 992px) {
    [class*="js-przelewy24-order-confirmation"],
    .przelewy24-repayment__submit-wrapper,
    .alert:has(.przelewy24-order-confirmation__icon):not([class*="js-przelewy24-order-confirmation"] .alert) {
        max-width: 40% !important;
    }
}

/* === Przelewy24 Logo Size on Confirmation Page === */
img.img-fluid[src*="przelewy24-logo"] {
    max-width: 20% !important;
}
