/* Cart Modernization - Clean & Minimalist Style */

: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 */
#main .cart-grid.row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-top: 30px;
    align-items: flex-start !important; /* Critical for sticky to work on columns */
    overflow: visible !important;
}

/* Ensure no parent containers break sticky */
body#cart, 
body#cart #wrapper, 
body#cart #content-wrapper,
body#cart .tv-main-div {
    overflow: visible !important;
}

/* Left Column Body */
.cart-grid-body {
    background: #fff;
    padding: 30px !important;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: none !important;
}

/* Remove default PrestaShop card styles that might cause double borders */
.cart-container.card {
    border: none !important;
    box-shadow: none !important;
}

.cart-container .card-block {
    padding: 0 0 20px 0;
}

.cart-container h1.h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #222;
    border: none;
    margin-bottom: 10px;
}

.cart-container hr.separator {
    display: none;
}

/* Cart Items */
.cart-items {
    padding: 0;
    margin: 0;
}

.cart-item {
    padding: 25px 0;
    border-bottom: 1px solid var(--border-light);
}

.cart-item:last-child {
    border-bottom: none;
}

.product-line-grid {
    display: flex;
    align-items: center;
    border: none !important;
}

/* Image */
.product-line-grid-left {
    padding-left: 0;
}

.product-line-grid-left img {
    border: none !important;
    border-radius: 8px;
    background: #f9f9f9;
}

/* Body Info */
.product-line-grid-body .product-title h6 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.product-line-grid-body .product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.product-line-grid-body .product-title a:hover {
    color: var(--cta-bg);
}

.product-line-info .label {
    color: var(--text-muted);
    font-weight: 400;
}

.product-line-info .value {
    color: #444;
}

body#cart .product-price-and-shipping .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cta-bg);
}

/* Actions */
.tvcart-incr-decr-price {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}

.js-cart-line-product-quantity {
    border: 1px solid #f0f0f0 !important;
    padding: 0 !important;
    width: 50px !important;
    height: 40px !important;
    text-align: center;
    font-weight: 600;
    margin: 0 40px !important;
    float: none !important;
    background: #fff !important;
}

/* Horizontal Touchspin Layout - ABSOLUTE FIX */
.tvcart-incr-decr-price .bootstrap-touchspin {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 130px !important;
    float: right;
    border: none !important;
}

.tvcart-incr-decr-price .input-group-btn-vertical {
    position: static !important;
    width: 0 !important;
    height: 0 !important;
    display: block !important;
}

.tvcart-incr-decr-price .btn-touchspin {
    position: absolute !important;
    top: 0 !important;
    width: 40px !important;
    height: 40px !important;
    background-color: #f0f0f0 !important;
    color: #222 !important;
    border: none !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2;
}

.tvcart-incr-decr-price .bootstrap-touchspin-down {
    left: 0 !important;
    border-radius: 3px 0 0 3px !important;
}

.tvcart-incr-decr-price .bootstrap-touchspin-up {
    right: 0 !important;
    border-radius: 0 3px 3px 0 !important;
}

.tvcart-incr-decr-price .btn-touchspin:hover {
    background-color: var(--cta-bg) !important;
    color: #fff !important;
}

.tvcart-incr-decr-price .btn-touchspin i {
    font-family: 'Material Icons' !important;
    font-size: 18px !important;
    font-style: normal !important;
}

/* Force Icons Content & Hide original theme arrows */
.tvcart-incr-decr-price .bootstrap-touchspin-up i::before {
    content: "add" !important;
}

.tvcart-incr-decr-price .bootstrap-touchspin-down i::before {
    content: "remove" !important;
}

.tvcart-incr-decr-price .bootstrap-touchspin-up i::after,
.tvcart-incr-decr-price .bootstrap-touchspin-down i::after {
    content: none !important;
    display: none !important;
}

.tv-cart-delete-icon-wrapper .remove-from-cart i {
    font-size: 20px;
    color: #bbb;
    transition: color 0.3s;
}

.tv-cart-delete-icon-wrapper .remove-from-cart:hover i {
    color: var(--cta-bg);
}

/* Right Column Summary - STICKY FIXED */
.cart-grid-right {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 20px !important;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.cart-grid-right .cart-summary {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: none !important;
}

.cart-summary-line {
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.cart-summary-line .label {
    color: var(--text-muted);
}

.cart-summary-line .value {
    font-weight: 600;
    color: #333;
}

.cart-summary-line.cart-total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f8f8f8;
}

.cart-summary-line.cart-total .label {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
}

.cart-summary-line.cart-total .value {
    font-size: 1.4rem;
    color: var(--cta-bg);
    font-weight: 800;
}

/* CTA Buttons */
.tvprocess-to-checkout,
.btn-primary {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 15px 30px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--cta-radius) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
    border: none !important;
    background-color: var(--cta-bg) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(207, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.tvprocess-to-checkout i,
.btn-primary i {
    color: #fff !important;
}

.tvprocess-to-checkout:hover,
.btn-primary:hover {
    background-color: var(--cta-hover-bg) !important;
    box-shadow: 0 6px 20px rgba(159, 0, 0, 0.3);
    transform: translateY(-2px);
    text-decoration: none !important;
}

/* Continue Shopping Link Fix - STOP THEME ANIMATIONS */
#main .tv-continue-shopping-btn,
#main a.tv-continue-shopping-btn,
#main .cart-grid-body a.tv-continue-shopping-btn {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--cta-bg) !important;
    border: none !important;
    margin-top: 25px;
    width: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 1.05rem !important;
    position: relative;
    z-index: 1;
}

/* KILL THEME PSEUDO-ELEMENTS (Black background animation) */
#main .tv-continue-shopping-btn::before,
#main .tv-continue-shopping-btn::after,
#main a.tv-continue-shopping-btn::before,
#main a.tv-continue-shopping-btn::after {
    display: none !important;
    content: none !important;
    background: transparent !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

#main .tv-continue-shopping-btn span,
#main a.tv-continue-shopping-btn span {
    color: inherit !important;
    background: transparent !important;
    position: relative;
    z-index: 2;
}

#main .tv-continue-shopping-btn i,
#main a.tv-continue-shopping-btn i {
    color: inherit !important;
    margin-right: 8px;
    font-size: 1.2rem !important;
    position: relative;
    z-index: 2;
}

/* Hover state - turns black */
#main .tv-continue-shopping-btn:hover,
#main a.tv-continue-shopping-btn:hover {
    background: transparent !important;
    background-color: transparent !important;
    color: #000 !important;
    text-decoration: none !important;
    transform: translateX(-3px);
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    .cart-grid-body, .cart-grid-right .cart-summary {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .product-line-grid {
        flex-wrap: wrap;
    }
    
    .product-line-grid-left {
        width: 30%;
    }
    
    .product-line-grid-body {
        width: 70%;
        padding-left: 15px;
    }
    
    .product-line-grid-right {
        width: 100%;
        margin-top: 15px;
        border-top: 1px dashed var(--border-light);
        padding-top: 15px;
    }
    
    .tvcart-incr-decr-price {
        justify-content: space-between;
    }

    .cart-grid-right {
        position: relative !important;
        top: 0 !important;
    }
}

/* ==========================================================================
   Checkout Modernization - Appended for Better Compatibility
   ========================================================================== */

/* 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;
}

/* 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-title .step-edit {
    margin-left: 30px !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;
}

/* Specific Button Adjustment - Personal Info */
body#checkout #checkout-personal-information-step .continue,
body#checkout #checkout-personal-information-step .tvall-inner-btn {
    width: auto !important;
    min-width: 200px;
    margin-left: 0 !important;
    margin-right: auto !important;
    padding: 12px 40px !important;
}

/* Buttons (CTAs) in Checkout */
body#checkout .btn-primary,
body#checkout .continue,
body#checkout button[name="confirm-addresses"],
body#checkout button[name="confirmDeliveryOption"],
body#checkout #payment-confirmation button,
body#checkout #payment-confirmation .tvall-inner-btn {
    display: flex !important;
    width: 50% !important;
    margin-left: auto !important;
    margin-right: 0 !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 on Checkout */
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;
}

/* Form Fields Modernization - Vertical Layout for better compatibility */
body#checkout .checkout-step .content {
    padding: 0;
}

body#checkout .checkout-step .js-customer-form > div,
body#checkout .checkout-step form > section,
body#checkout .checkout-step .form-fields {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px 15px; /* 10px row gap, 15px column gap */
    width: 100% !important;
}

/* Ensure wrappers inside grid don't break columns */
body#checkout .checkout-step .tab-content,
body#checkout .checkout-step .tab-pane {
    width: 100% !important;
}

/* Exception: Delivery Step - wide tiles and comment below */
body#checkout #checkout-delivery-step .form-fields {
    display: block !important;
}

/* Reset parent containers that were accidentally grid-ified */
body#checkout .checkout-step #delivery-address,
body#checkout .checkout-step #invoice-address,
body#checkout .checkout-step .js-address-form form > div:not(.address-selector) {
    display: block !important;
}

/* Fix delivery options overflow and disorder - REVISED */
body#checkout #checkout-delivery-step .delivery-option.carrier-selectable-row {
    margin-bottom: 10px;
    background: #f9f9f9;
    padding: 0 !important;
    border-radius: 8px;
    display: block !important;
    width: 100%;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
    /* overflow: hidden;  <-- USUNIĘTE, może to psuło layout */
}

body#checkout #checkout-delivery-step .carrier-extra-content {
    margin: 0 !important;
    display: none; /* Pozwalamy JS na zmianę tego na display:block */
}

/* Reset for the general .row margin-top override in checkout */
body#checkout #checkout-delivery-step .row.carrier-extra-content {
    margin-top: 0 !important;
}

/* Jeśli extra-content ma być widoczny i NIE jest pusty */
body#checkout #checkout-delivery-step .carrier-extra-content:not([style*="display:none"]):not([style*="display: none"]):not(:empty) {
    display: block !important;
    margin-bottom: 10px !important;
    background: #fff;
    padding: 15px !important;
    border: 1px solid #eee !important;
    border-radius: 0 0 8px 8px !important;
    margin-top: -10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Ukrycie na siłę jeśli jest pusty (nawet jeśli JS go pokazał) */
body#checkout #checkout-delivery-step .carrier-extra-content:empty {
    display: none !important;
}

/* Wymuszenie ukrycia nadpisujące globalne .row display: flex !important */
body#checkout #checkout-delivery-step .row.carrier-extra-content[style*="display: none"],
body#checkout #checkout-delivery-step .row.carrier-extra-content[style*="display:none"] {
    display: none !important;
}

body#checkout #checkout-delivery-step .delivery-option.carrier-selectable-row:hover {
    background: #f3f3f3;
    border-color: #e0e0e0;
}

body#checkout #checkout-delivery-step .carrier-row-wrapper {
    display: flex !important;
    align-items: center !important;
    width: 100%;
    padding: 15px 25px !important;
    gap: 0; /* Managed by specific flex-basis or margins */
    min-height: 80px;
}

body#checkout #checkout-delivery-step .carrier-logo {
    flex: 0 0 120px !important; /* Fixed width for logo area */
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

body#checkout #checkout-delivery-step .carrier-logo img {
    max-width: 100px !important;
    height: auto !important;
    max-height: 50px !important;
    display: block;
}

body#checkout #checkout-delivery-step .carrier-name-wrapper {
    flex: 0 0 250px !important; /* Fixed width for name to keep things aligned */
    display: flex;
    align-items: center;
}

body#checkout #checkout-delivery-step .carrier-name {
    margin: 0 !important;
    font-weight: 700 !important;
    font-size: 1.15rem !important;
    color: #000;
}

body#checkout #checkout-delivery-step .carrier-delay-wrapper {
    flex: 1 !important; /* Takes remaining space in middle */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
}

body#checkout #checkout-delivery-step .carrier-delay {
    color: var(--text-muted);
    font-size: 0.95rem;
    white-space: nowrap;
}

body#checkout #checkout-delivery-step .carrier-price-wrapper {
    flex: 0 0 150px !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
}

body#checkout #checkout-delivery-step .carrier-price {
    font-weight: 800 !important;
    font-size: 1.1rem !important;
    color: #000 !important;
    white-space: nowrap;
}

body#checkout #checkout-delivery-step .carrier-radio-wrapper {
    flex: 0 0 40px !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Force custom radio alignment */
body#checkout #checkout-delivery-step .custom-radio {
    margin: 0 !important;
    display: flex !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
}

body#checkout #checkout-delivery-step .custom-radio input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
}

/* Invisible label overlay for better UX */
.delivery-option-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1; /* Zmniejszony z 10, aby nie blokował wszystkiego */
    margin: 0;
}

/* Specific Button Adjustment - Personal Info & Delivery */
body#checkout #checkout-personal-information-step .continue,
body#checkout #checkout-personal-information-step .tvall-inner-btn,
body#checkout #checkout-delivery-step .continue,
body#checkout #checkout-delivery-step .tvall-inner-btn {
    width: auto !important;
    min-width: 200px;
    margin-left: 0 !important;
    margin-right: auto !important;
    padding: 12px 40px !important;
}

body#checkout #checkout-delivery-step .order-options textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 15px;
}

body#checkout .checkout-step .form-group {
    width: 100% !important;
    margin: 0 0 10px 0 !important;
    display: flex;
    flex-direction: column;
}

/* Make labels appear above inputs */
body#checkout .checkout-step .form-group .form-control-label {
    width: 100% !important;
    text-align: left !important;
    padding: 0 0 8px 0 !important;
    font-weight: 600;
    margin: 0;
}

body#checkout .checkout-step .form-group .js-input-column {
    width: 100% !important;
    padding: 0 !important;
}

/* Handle grid item wrappers (password policy) */
body#checkout .checkout-step .field-password-policy {
    display: contents; /* Makes children participate in the grid directly */
}

/* Handle exceptions: full width fields */
body#checkout .checkout-step .form-group.row:has(input[name="address1"]),
body#checkout .checkout-step .form-group.row:has(input[name="address2"]),
body#checkout .checkout-step .form-group.row:has(input[name="birthday"]),
body#checkout .checkout-step .form-group.row:has(.custom-checkbox),
body#checkout .checkout-step .form-footer,
body#checkout .checkout-step #conditions-to-approve {
    grid-column: 1 / -1 !important;
}

/* Reset row behaviors */
body#checkout .checkout-step .form-group.row::before,
body#checkout .checkout-step .form-group.row::after {
    display: none !important;
}

/* Mobile Adjustments for Checkout */
@media (max-width: 991px) {
    body#checkout div.checkout-step,
    body#checkout .checkout-step {
        padding: 20px !important;
    }
    
    body#checkout #js-checkout-summary {
        padding: 20px !important;
    }

    body#checkout .checkout-step form > div,
    body#checkout .checkout-step form > section {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Delivery Options Responsive Fix (768px-845px overflow fix) */
    body#checkout #checkout-delivery-step .carrier-row-wrapper {
        padding: 15px !important;
        flex-wrap: wrap !important;
        min-height: auto !important;
    }

    body#checkout #checkout-delivery-step .carrier-logo {
        flex: 0 0 80px !important;
        justify-content: flex-start !important;
    }

    body#checkout #checkout-delivery-step .carrier-logo img {
        max-width: 60px !important;
    }

    body#checkout #checkout-delivery-step .carrier-name-wrapper {
        flex: 1 1 auto !important;
        min-width: 100px;
    }

    body#checkout #checkout-delivery-step .carrier-name {
        font-size: 1.05rem !important;
    }

    body#checkout #checkout-delivery-step .carrier-price-wrapper {
        flex: 0 0 auto !important;
        padding-right: 15px !important;
        justify-content: flex-end !important;
    }

    body#checkout #checkout-delivery-step .carrier-price {
        font-size: 1rem !important;
    }

    body#checkout #checkout-delivery-step .carrier-delay-wrapper {
        flex: 0 0 100% !important;
        order: 5 !important;
        justify-content: flex-start !important;
        padding: 8px 0 0 0 !important;
        margin-left: 80px; /* Align with name, after logo */
    }

    body#checkout #checkout-delivery-step .carrier-delay {
        font-size: 0.85rem !important;
    }

    body#checkout #checkout-delivery-step .carrier-radio-wrapper {
        flex: 0 0 30px !important;
    }
}

/* Payment Options Modernization - Styling like Delivery Options */
body#checkout .payment-option {
    margin-bottom: 15px;
    background: #f9f9f9;
    padding: 15px 25px !important;
    border-radius: 8px;
    display: flex !important;
    align-items: center !important;
    width: 100%;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

body#checkout .payment-option:hover {
    background: #f3f3f3;
    border-color: #e0e0e0;
}

body#checkout .payment-option label {
    flex: 1;
    display: flex !important;
    align-items: center;
    margin: 0 !important;
    cursor: pointer;
}

body#checkout .payment-option label span {
    font-weight: 700 !important;
    font-size: 1.15rem !important;
    color: #000;
}

body#checkout .payment-option label img {
    max-height: 30px;
    margin-right: 15px;
    width: auto;
    order: -1; /* Force logo to the left of the text */
}

body#checkout .payment-option .custom-radio {
    order: 2; /* Move radio to the right to match delivery */
    margin-right: 0 !important;
    margin-left: auto !important;
    display: flex !important;
}

/* Ensure the red dot and circle are visible like in delivery/addresses */
body#checkout .payment-option .custom-radio input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
}

/* Additional information box styling */
body#checkout .additional-information {
    background: #fff;
    padding: 30px !important;
    border-radius: 0 0 12px 12px !important;
    border: 1px solid #eee !important;
    margin-top: -25px !important; /* Pull up to touch the payment option */
    margin-left: 0 !important; /* Reset theme offset */
    margin-right: 0 !important;
    margin-bottom: 25px !important;
    border-top: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative;
    z-index: 1;
    font-size: 0.95rem; /* Increase font size */
    line-height: 1.6;
}

body#checkout .additional-information p,
body#checkout .additional-information div,
body#checkout .additional-information span {
    font-size: 0.95rem !important; /* Force font size on nested elements */
}

/* Hide empty additional-information divs (e.g. Przelewy24 returns empty TPL with comments) */
body#checkout .additional-information:not(:has(*)) {
    display: none !important;
}

/* Address Selection Modernization */
body#checkout div.checkout-step .address-selector {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 25px !important;
    flex-wrap: nowrap !important;
}

body#checkout div.checkout-step .address-item {
    background: #fff;
    border: 1px solid #eee !important;
    border-radius: 10px !important;
    padding: 20px !important;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0 !important; /* Reset margin since we use gap */
    flex: unset !important;
    width: 100% !important;
    margin-right: 0 !important;
}

.address-item:hover {
    border-color: #ddd !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.address-item.selected {
    outline: 2px solid var(--cta-bg) !important;
    outline-offset: -2px;
    border-color: var(--cta-bg) !important;
    background-color: #fff !important;
    box-shadow: 0 8px 25px rgba(207, 0, 0, 0.08);
}

/* Check icon in selected address card */
.address-item.selected::after {
    content: "\e5ca" !important;
    font-family: 'Material Icons' !important;
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    color: var(--cta-bg) !important;
    font-size: 24px !important;
    font-weight: bold !important;
}

.address-item .radio-block {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0;
    cursor: pointer;
}

.address-item header {
    flex: 1;
}

.address-item .address-alias {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
    display: block;
    color: #222;
}

.address-item .address {
    font-style: normal;
    color: #666;
    line-height: 1.5;
    font-size: 0.95rem;
}

.address-item hr {
    display: block !important;
    border: 0;
    border-top: 1px solid #f0f0f0 !important;
    margin: 15px 0 !important;
}

.address-item footer.address-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
}

/* Reverting Edit/Delete buttons to theme standard for consistency */
.address-item footer.address-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.address-item footer.address-footer a {
    /* Removing my overrides to let theme styles (tvedit-btn, tvremove-btn) take over */
}

/* Hide ANY default radio elements or theme decorations aggressively */
.address-item .custom-radio input[type="radio"],
.address-item .custom-radio input[type="radio"] + span,
.address-item label.radio-block::before,
.address-item label.radio-block::after,
.address-item .radio-block::before,
.address-item .radio-block::after {
    display: none !important;
    content: none !important;
    border: none !important;
    background: none !important;
}

/* Fix radio button appearance - Absolute positioning to force only my circle */
.address-item .custom-radio {
    display: none !important;
}

/* Kill theme pseudo-elements on the custom-radio container itself */
.address-item .custom-radio::before,
.address-item .custom-radio::after {
    display: none !important;
    content: none !important;
}

/* This is the ONLY circle we want to see */
.address-item .custom-radio span:last-child {
    width: 22px !important;
    height: 22px !important;
    border: 2px solid #ddd !important;
    border-radius: 50% !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    z-index: 5 !important; /* Higher z-index to stay on top */
}

.address-item.selected .custom-radio span:last-child {
    border-color: var(--cta-bg) !important;
}

/* The red dot inside - ensuring it only applies to our span */
.address-item.selected .custom-radio span:last-child::after {
    content: "" !important;
    width: 10px !important;
    height: 10px !important;
    background: var(--cta-bg) !important;
    border-radius: 50% !important;
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    opacity: 1 !important;
    visibility: visible !important;
    border: none !important;
}

/* Address Form in Checkout - Fix "Continue" button - Reverting to Theme Standard */
body#checkout button[name="confirm-addresses"].tvall-inner-btn {
    width: auto !important;
    min-width: 200px !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    float: right !important; /* Move back to right to match other steps */
}

/* Add New Address Link */
.add-address a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cta-bg);
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.2s;
}

.add-address a:hover {
    color: var(--cta-hover-bg);
    text-decoration: none;
    transform: translateX(3px);
}

@media (max-width: 575px) {
    .address-selector {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   InPost Parcel Locker Integration (Extra Content Styling)
   ========================================================================== */
body#checkout #checkout-delivery-step .js-inpost-shipping-container {
    padding: 10px 0;
}

body#checkout #checkout-delivery-step .inpost-shipping-machine-info {
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

body#checkout #checkout-delivery-step .inpost-shipping-machine-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #222;
    margin: 0;
}

body#checkout #checkout-delivery-step .inpost-shipping-machine-address {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

body#checkout #checkout-delivery-step .inpost-shipping-button,
body#checkout #checkout-delivery-step .js-select-closest-machine {
    background-color: transparent !important;
    color: var(--cta-bg) !important;
    border: 2px solid var(--cta-bg) !important;
    border-radius: var(--cta-radius) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    padding: 10px 25px !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
    display: inline-block;
    cursor: pointer;
    text-align: center;
}

body#checkout #checkout-delivery-step .inpost-shipping-button:hover,
body#checkout #checkout-delivery-step .js-select-closest-machine:hover {
    background-color: var(--cta-bg) !important;
    color: #fff !important;
}

body#checkout #checkout-delivery-step .js-inpost-closest-machine p {
    color: #444;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

body#checkout #checkout-delivery-step .inpost-shipping-machine-customer-info {
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

body#checkout #checkout-delivery-step .inpost-shipping-subheader {
    font-weight: 700;
    font-size: 1rem;
    color: #222;
    margin-bottom: 10px;
}

body#checkout #checkout-delivery-step .inpost-shipping-customer {
    margin-bottom: 5px;
    font-size: 0.95rem;
    color: #444;
}

body#checkout #checkout-delivery-step .inpost-shipping-label {
    font-weight: 600;
    margin-right: 5px;
}

body#checkout #checkout-delivery-step .inpost-shipping-customer-change {
    color: var(--cta-bg);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.3s ease;
    display: inline-block;
    margin-top: 5px;
}

body#checkout #checkout-delivery-step .inpost-shipping-customer-change:hover {
    color: var(--cta-hover-bg);
    text-decoration: underline;
}

body#checkout #checkout-delivery-step .inpost-shipping-customer-change-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px dashed #ccc;
}

body#checkout #checkout-delivery-step .inpost-shipping-customer-change-form .form-control {
    border-radius: 5px;
    border: 1px solid #ddd;
    padding: 10px 15px;
    box-shadow: none;
}

body#checkout #checkout-delivery-step .inpost-shipping-customer-change-form .btn-primary {
    width: auto !important;
    min-width: 150px;
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
}
