/* --- Variables reused & extended from main style --- */
:root {
    --cart-bg: #f9f9f9;
    --cart-border: #eaeaea;
    --cart-text: #333333;
    --cart-light-text: #777777;
    --cart-primary: #005093; /* Matches dark-blue */
    --cart-secondary: #108575; /* Matches primary-teal */
    --cart-danger: #d32f2f;
    --cart-radius: 8px;
    --cart-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* --- Global Utilities for Cart/Checkout --- */
.cart-page-container, .checkout-page-container {
    padding-top: 40px;
    padding-bottom: 80px;
    /* font-family: 'Poppins', sans-serif; */
    color: var(--cart-text);
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--cart-primary);
    margin-bottom: 30px;
}

.block-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 15px;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 15px;
    cursor: pointer;
    border: none;
    transition: background 0.3s ease;
}

.btn-primary {
    background-color: var(--cart-primary);
    color: #fff;
}
.btn-primary:hover {
    background-color: #111a2f;
}

.btn-secondary {
    background-color: #fff;
    color: var(--cart-primary);
    border: 1px solid var(--cart-primary);
}
.btn-secondary:hover {
    background-color: var(--cart-bg);
}

.text-green { color: var(--cart-secondary); font-weight: 600; }
.summary-divider { border: 0; height: 1px; background: var(--cart-border); margin: 20px 0; }

/* --- Empty Cart State --- */
.empty-cart-container {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: var(--cart-radius);
    box-shadow: var(--cart-shadow);
    border: 1px solid var(--cart-border);
}
.empty-cart-icon {
    font-size: 60px;
    color: #ccc;
    margin-bottom: 20px;
}
.empty-cart-container h2 { font-size: 24px; color: var(--cart-primary); margin-bottom: 10px; }
.empty-cart-container p { color: var(--cart-light-text); margin-bottom: 30px; }
.browse-btn { display: inline-block; padding: 12px 30px; border-radius: 30px; }

/* --- Filled Cart Layout --- */
.cart-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.cart-items-section {
    flex: 1;
    background: #fff;
    border-radius: var(--cart-radius);
    box-shadow: var(--cart-shadow);
    border: 1px solid var(--cart-border);
    overflow: hidden;
}

/* Cart Table Header */
.cart-table-header {
    display: flex;
    padding: 20px;
    background: var(--cart-bg);
    border-bottom: 1px solid var(--cart-border);
    font-weight: 600;
    font-size: 14px;
    color: var(--cart-light-text);
    text-transform: uppercase;
}

/* Cart Item Rows */
.cart-item {
    display: flex;
    align-items: center;
    padding: 25px 20px;
    border-bottom: 1px solid var(--cart-border);
    transition: background 0.2s ease;
}
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: #fafafa; }

/* Columns setup */
.col-product { flex: 2; display: flex; align-items: center; gap: 20px; }
.col-price { flex: 1; text-align: center; font-weight: 500; }
.col-qty { flex: 1; display: flex; justify-content: center; }
.col-subtotal { flex: 1; text-align: center; font-weight: 600; color: var(--cart-primary); }
.col-remove { width: 50px; text-align: right; }

.item-info img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--cart-border);
}
.item-info h3 { font-size: 15px; font-weight: 600; color: var(--cart-primary); margin-bottom: 5px; line-height: 1.3; }
.item-variant { font-size: 12px; color: var(--cart-light-text); }

/* Quantity Selector */
.qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--cart-border);
    border-radius: 4px;
    height: 36px;
    background: #fff;
    overflow: hidden;
}
.qty-btn {
    background: none;
    border: none;
    width: 30px;
    height: 100%;
    cursor: pointer;
    color: var(--cart-primary);
    transition: background 0.2s;
}
.qty-btn:hover { background: var(--cart-bg); }
.qty-input {
    width: 40px;
    height: 100%;
    border: none;
    border-left: 1px solid var(--cart-border);
    border-right: 1px solid var(--cart-border);
    text-align: center;
    font-family: inherit;
    font-weight: 600;
    color: var(--cart-primary);
    -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Remove Button */
.remove-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}
.remove-btn:hover { color: var(--cart-danger); }

/* --- Summary Sidebar (Used in Cart & Checkout) --- */
.cart-summary-sidebar, .checkout-summary-section {
    width: 380px;
    flex-shrink: 0;
}
.summary-card {
    background: #fff;
    padding: 30px;
    border-radius: var(--cart-radius);
    box-shadow: var(--cart-shadow);
    border: 1px solid var(--cart-border);
}
.sticky-sidebar { position: sticky; top: 20px; }

.summary-card h2 { font-size: 20px; color: var(--cart-primary); margin-bottom: 25px; }
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 15px;
}
.total-row {
    font-size: 18px;
    font-weight: 700;
    color: var(--cart-primary);
    margin-bottom: 20px;
}
.discount-row { color: var(--cart-secondary); }
.tax-note { font-size: 12px; color: var(--cart-light-text); text-align: center; margin-bottom: 25px; }

/* --- Checkout Layout --- */
.checkout-layout {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}
.checkout-form-section { flex: 1; }
.checkout-title { margin-bottom: 40px; }

/* Checkout Form Styles */
.form-section-block {
    margin-bottom: 40px;
}
.form-heading {
    font-size: 20px;
    font-weight: 600;
    color: var(--cart-primary);
    margin-bottom: 20px;
}

.form-row { display: flex; gap: 15px; }
.form-group { margin-bottom: 15px; }
.full-width { width: 100%; }
.half-width { width: 50%; }
.third-width { width: 33.333%; }

.form-group input, .form-group select {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--cart-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--cart-primary);
    box-shadow: 0 0 0 2px rgba(28, 43, 74, 0.1);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--cart-text);
}

/* Payment Methods */
.payment-sub { font-size: 13px; color: var(--cart-light-text); margin-bottom: 15px; }
.payment-methods {
    border: 1px solid var(--cart-border);
    border-radius: 4px;
    background: #fff;
}
.payment-option {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--cart-border);
    cursor: pointer;
    transition: background 0.2s;
}
.payment-option:last-child { border-bottom: none; }
.payment-option:hover { background: #fafafa; }
.payment-option input[type="radio"] { display: none; }
.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 15px;
    position: relative;
}
.payment-option input[type="radio"]:checked + .radio-custom {
    border-color: var(--cart-primary);
}
.payment-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 8px; height: 8px;
    background: var(--cart-primary);
    border-radius: 50%;
}
.payment-label { flex: 1; font-weight: 500; font-size: 15px; }
.payment-icon { font-size: 24px; color: #888; }

/* Checkout Mini Cart */
.mini-cart-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px;
}
.mini-cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.mini-item-img {
    position: relative;
    width: 65px; height: 65px;
    border: 1px solid var(--cart-border);
    border-radius: 8px;
    background: #fff;
}
.mini-item-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.mini-item-qty {
    position: absolute;
    top: -8px; right: -8px;
    background: rgba(119, 119, 119, 0.9);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.mini-item-details h4 { font-size: 14px; font-weight: 600; color: var(--cart-primary); line-height: 1.3;}
.mini-item-price { font-weight: 500; font-size: 14px; margin-left: auto; }

/* Coupon Section */
.coupon-section { display: flex; gap: 10px; }
.coupon-section input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--cart-border);
    border-radius: 4px;
    outline: none;
    font-family: inherit;
}
.coupon-section button {
    padding: 0 20px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}
.coupon-msg { font-size: 13px; margin-top: 10px; }
.coupon-success { color: var(--cart-secondary); }
.coupon-error { color: var(--cart-danger); }
.currency-code { font-size: 12px; color: var(--cart-light-text); font-weight: 500; margin-right: 5px;}
.total-price-large { display: flex; align-items: center; }
.total-price-large #chk-total { font-size: 22px; }

.mobile-submit-area { display: none; }

/* --- Responsive Layouts --- */
@media (max-width: 992px) {
    .cart-layout { flex-direction: column; }
    .cart-summary-sidebar { width: 100%; }
    .checkout-layout { flex-direction: column-reverse; }
    .checkout-summary-section { width: 100%; margin-bottom: 30px;}
    .desktop-submit { display: none; }
    .mobile-submit-area { display: block; margin-top: 30px;}
}

@media (max-width: 768px) {
    .cart-table-header { display: none; }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        position: relative;
        padding: 20px 15px;
    }
    .col-product { width: 100%; margin-bottom: 15px; }
    .col-price { display: none; } /* Hide individual price on mobile */
    .col-qty { width: 100%; justify-content: flex-start; margin-bottom: 15px; }
    .col-subtotal { width: 100%; text-align: left; font-size: 16px; }
    .col-remove { position: absolute; top: 20px; right: 15px; width: auto; }
    
    .form-row { flex-direction: column; gap: 0;}
    .form-group.half-width, .form-group.third-width { width: 100%; }
}