/* ==========================================================================
   Modern D2C Cart & Checkout Styles (Apple/boAt Aesthetic)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Master Wrapper & Step Progress Bar
   -------------------------------------------------------------------------- */
.d2c-cart-master-wrapper {
    max-width: 1240px;
    margin: 40px auto 80px;
    padding: 0 16px;
}

/* Step Bar */
.cart-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto 35px;
    gap: 12px;
}
.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
}
.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}
.step-item.active {
    color: #0f172a;
}
.step-item.active .step-circle {
    background: var(--primary-color, #2563eb);
    color: #ffffff;
}
.step-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
}

/* Free Shipping Banner */
.cart-free-shipping-banner {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
}
.fs-icon {
    width: 36px;
    height: 36px;
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.fs-text strong {
    display: block;
    font-size: 14px;
    color: #065f46;
}
.fs-text small {
    font-size: 12px;
    color: #047857;
}

/* --------------------------------------------------------------------------
   2. Two-Column Layout Grid
   -------------------------------------------------------------------------- */
.d2c-cart-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 36px;
    align-items: flex-start;
}

/* --------------------------------------------------------------------------
   3. Left Column: Product Cards
   -------------------------------------------------------------------------- */
.cart-cards-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cart-item-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 20px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s;
}
.cart-item-card:hover {
    border-color: #cbd5e1;
}

/* Thumbnail */
.item-card-thumb {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    flex-shrink: 0;
}
.item-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Details */
.item-brand-tag {
    font-size: 10px;
    font-weight: 800;
    color: var(--primary-color, #2563eb);
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}
.item-product-name {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 6px 0;
}
.item-product-name a {
    color: #0f172a;
}
.item-product-name a:hover {
    color: var(--primary-color, #2563eb);
}

.item-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.unit-price {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}
.stock-status-pill {
    font-size: 11px;
    font-weight: 700;
    color: #059669;
    background: #f0fdf4;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Quantity & Remove */
.item-actions-row {
    display: flex;
    align-items: center;
    gap: 18px;
}
.cart-qty-wrapper .quantity {
    display: inline-block;
}
.cart-qty-wrapper input.qty {
    width: 60px;
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    outline: none;
}
.cart-qty-wrapper input.qty:focus {
    border-color: var(--primary-color, #2563eb);
}

.remove-cart-item-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #ef4444;
    font-size: 13px;
    font-weight: 700;
    transition: color 0.2s;
}
.remove-cart-item-btn:hover {
    color: #b91c1c;
}

/* Subtotal */
.item-card-subtotal {
    text-align: right;
    min-width: 90px;
}
.subtotal-label {
    display: block;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
}
.subtotal-figure {
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
}

/* Coupon & Update Actions */
.cart-bottom-actions-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.cart-coupon-box {
    display: flex;
    gap: 8px;
}
.coupon-input {
    border: 1px solid #cbd5e1;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    min-width: 200px;
}
.coupon-input:focus {
    border-color: var(--primary-color, #2563eb);
}
.btn-apply-coupon {
    background: #0f172a;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-apply-coupon:hover {
    background: var(--primary-color, #2563eb);
}
.btn-update-cart {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-update-cart:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* --------------------------------------------------------------------------
   4. Right Column: Sticky Order Summary Card
   -------------------------------------------------------------------------- */
.order-summary-sticky-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 90px;
}
.summary-heading {
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.summary-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #475569;
}
.summary-row strong {
    color: #0f172a;
    font-weight: 800;
}
.free-shipping-text {
    color: #059669 !important;
    font-weight: 900 !important;
}
.coupon-savings-row {
    color: #dc2626;
}
.coupon-savings-row strong {
    color: #dc2626;
}
.summary-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 8px 0;
}

.grand-total-row {
    font-size: 16px;
    color: #0f172a;
    font-weight: 800;
}
.grand-total-amount {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-color, #2563eb);
}
.tax-tag {
    font-size: 11px;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

/* Proceed CTA */
.summary-checkout-action {
    margin-bottom: 22px;
}
.btn-proceed-checkout {
    display: block;
    background: #0f172a;
    color: #ffffff;
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 900;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}
.btn-proceed-checkout:hover {
    background: var(--primary-color, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    color: #ffffff;
}

/* Trust Bullets */
.summary-trust-bullets {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}
.trust-bullet {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}
.tb-icon {
    font-size: 14px;
}

/* Helpline */
.summary-helpline-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}
.summary-helpline-card span {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
}
.summary-helpline-card a {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-color, #2563eb);
}

/* --------------------------------------------------------------------------
   5. Empty Cart Screen
   -------------------------------------------------------------------------- */
.empty-cart-wrapper {
    padding: 70px 16px 100px;
    text-align: center;
}
.empty-cart-card {
    max-width: 580px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 50px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}
.empty-cart-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}
.empty-title {
    font-size: 26px;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 10px;
}
.empty-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 28px;
}
.btn-return-shop {
    display: inline-block;
    background: #0f172a;
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    padding: 13px 32px;
    border-radius: 8px;
    transition: background 0.2s;
}
.btn-return-shop:hover {
    background: var(--primary-color, #2563eb);
    color: #ffffff;
}
.empty-perks-strip {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   6. Mobile Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .d2c-cart-grid {
        grid-template-columns: 1fr;
    }
    .order-summary-sticky-card {
        position: static;
    }
}

@media (max-width: 640px) {
    .cart-progress-steps {
        font-size: 11px;
    }
    .cart-item-card {
        grid-template-columns: 80px 1fr;
        gap: 14px;
    }
    .item-card-thumb {
        width: 80px;
        height: 80px;
    }
    .item-card-subtotal {
        grid-column: span 2;
        text-align: left;
        border-top: 1px solid #f1f5f9;
        padding-top: 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .cart-bottom-actions-strip {
        flex-direction: column;
        align-items: stretch;
    }
    .cart-coupon-box {
        flex-direction: column;
    }
    .coupon-input {
        min-width: unset;
        width: 100%;
    }
    .btn-apply-coupon,
    .btn-update-cart {
        width: 100%;
    }
}

/* ==========================================================================
   Modern D2C Checkout Page Styles (Two-Column Split Funnel)
   ========================================================================== */

/* Step Bar Customization for Checkout */
.checkout-steps {
    margin-top: 20px;
    margin-bottom: 40px;
}
.step-line.active-line {
    background: var(--primary-color, #2563eb);
}

/* Master Checkout Container */
form.woocommerce-checkout {
    display: grid !important;
    grid-template-columns: 1.35fr 1fr !important;
    gap: 40px !important;
    max-width: 1200px;
    margin: 0 auto 80px;
    padding: 0 16px;
    align-items: flex-start;
}

/* --------------------------------------------------------------------------
   1. Left Column: Billing & Shipping Forms
   -------------------------------------------------------------------------- */
#customer_details {
    width: 100% !important;
}
.woocommerce-billing-fields,
.woocommerce-shipping-fields,
.woocommerce-additional-fields {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3,
.woocommerce-additional-fields h3 {
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* Input Fields & Labels */
.woocommerce-billing-fields .form-row,
.woocommerce-shipping-fields .form-row,
.woocommerce-additional-fields .form-row {
    margin-bottom: 18px;
    padding: 0;
}

.woocommerce form .form-row label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row select:focus,
.woocommerce form .form-row textarea:focus {
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Select2 / Dropdown Tweaks */
.select2-container .select2-selection--single {
    height: 46px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 46px !important;
    padding-left: 14px !important;
    color: #0f172a !important;
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   2. Right Column: Sticky Order Review & Payment Card
   -------------------------------------------------------------------------- */
#order_review_heading {
    display: none; /* We keep a clean heading inside the container */
}

#order_review {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 90px;
}

#order_review::before {
    content: "Order Summary & Review";
    display: block;
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* Order Review Products Table */
table.woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

table.woocommerce-checkout-review-order-table th,
table.woocommerce-checkout-review-order-table td {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

table.woocommerce-checkout-review-order-table thead th {
    font-size: 12px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 800;
}

table.woocommerce-checkout-review-order-table tbody td.product-name {
    color: #1e293b;
    font-weight: 600;
}
table.woocommerce-checkout-review-order-table tbody td.product-total {
    text-align: right;
    font-weight: 800;
    color: #0f172a;
}

/* Totals Footer */
table.woocommerce-checkout-review-order-table tfoot th {
    color: #475569;
    font-weight: 700;
    text-align: left;
}
table.woocommerce-checkout-review-order-table tfoot td {
    text-align: right;
    font-weight: 800;
    color: #0f172a;
}
table.woocommerce-checkout-review-order-table tfoot tr.order-total th,
table.woocommerce-checkout-review-order-table tfoot tr.order-total td {
    border-top: 2px solid #e2e8f0;
    border-bottom: none;
    padding-top: 16px;
    font-size: 18px;
    color: #0f172a;
    font-weight: 900;
}
table.woocommerce-checkout-review-order-table tfoot tr.order-total td {
    color: var(--primary-color, #2563eb);
}

/* --------------------------------------------------------------------------
   3. Selectable Payment Methods
   -------------------------------------------------------------------------- */
.woocommerce-checkout-payment {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
}

.woocommerce-checkout-payment ul.wc_payment_methods {
    list-style: none;
    margin: 0 0 16px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.woocommerce-checkout-payment ul.wc_payment_methods li {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 0;
    transition: all 0.2s ease;
}

.woocommerce-checkout-payment ul.wc_payment_methods li:hover {
    border-color: #cbd5e1;
}

.woocommerce-checkout-payment ul.wc_payment_methods li input[type="radio"] {
    margin-right: 8px;
    accent-color: var(--primary-color, #2563eb);
}

.woocommerce-checkout-payment ul.wc_payment_methods li label {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
}

.woocommerce-checkout-payment div.payment_box {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 10px;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   4. Place Order Button & Security Badges
   -------------------------------------------------------------------------- */
#place_order {
    width: 100% !important;
    background: #0f172a !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    padding: 16px !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2) !important;
}

#place_order:hover {
    background: var(--primary-color, #2563eb) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4) !important;
}

/* Security Trust Box */
.checkout-security-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sec-icon {
    font-size: 18px;
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.security-item strong {
    display: block;
    font-size: 12px;
    color: #0f172a;
}

.security-item small {
    font-size: 11px;
    color: #64748b;
}

/* --------------------------------------------------------------------------
   5. Mobile Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    form.woocommerce-checkout {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    #order_review {
        position: static;
    }
}

@media (max-width: 640px) {
    .woocommerce-billing-fields,
    .woocommerce-shipping-fields,
    #order_review {
        padding: 20px 16px;
    }
    .woocommerce form .form-row-first,
    .woocommerce form .form-row-last {
        width: 100% !important;
        float: none !important;
    }
    #place_order {
        font-size: 15px !important;
        padding: 14px !important;
    }
}