/* ==============================
   CART PAGE CSS
   ============================== */

.cart-page {
    padding: 32px 0 80px;
    min-height: 80vh;
    background: var(--gray-1);
}

.nav-step-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
}

.step {
    color: var(--gray-5);
}

.step.active {
    color: var(--red);
}

.step-arrow {
    color: var(--gray-4);
}

/* ---- LAYOUT ---- */
.cart-page-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

/* ---- CART MAIN ---- */
.cart-main {}

.cart-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cart-section-header h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.cart-section-header h1 span {
    color: var(--gray-5);
    font-size: 14px;
    font-weight: 400;
}

.clear-cart-btn {
    font-size: 12px;
    color: var(--gray-5);
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
}

.clear-cart-btn:hover {
    color: var(--red);
}

.freeship-notice {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border: 1px solid #a5d6a7;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 13px;
    color: #2e7d32;
    margin-bottom: 16px;
}

.cart-items-page {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}

.cart-item-page {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid var(--gray-2);
    align-items: flex-start;
    transition: var(--transition);
}

.cart-item-page:last-child {
    border-bottom: none;
}

.cart-item-page:hover {
    background: var(--gray-1);
}

.cart-item-select {
    padding-top: 4px;
    flex-shrink: 0;
}

.cart-item-select input {
    accent-color: var(--red);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.cart-item-img-lg {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-sm);
    background: var(--gray-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-shop {
    font-size: 11px;
    color: var(--red);
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.cart-item-variant {
    font-size: 12px;
    color: var(--gray-5);
    margin-bottom: 10px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cart-action-link {
    font-size: 12px;
    color: var(--gray-5);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
}

.cart-action-link:hover {
    color: var(--red);
}

.cart-item-price-col {
    text-align: right;
    flex-shrink: 0;
}

.cart-item-price-final {
    font-size: 18px;
    font-weight: 800;
    color: var(--red);
    display: block;
}

.cart-item-price-orig {
    font-size: 12px;
    color: var(--gray-5);
    text-decoration: line-through;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-control-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--gray-3);
    background: white;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.qty-control-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

.qty-control-val {
    font-size: 14px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

/* ---- VOUCHER ---- */
.voucher-section {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.voucher-section h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.voucher-input-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.voucher-input-wrap input {
    flex: 1;
    border: 2px solid var(--gray-3);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-size: 13px;
    font-family: var(--font);
    color: var(--text);
    transition: var(--transition);
}

.voucher-input-wrap input:focus {
    border-color: var(--red);
    outline: none;
}

.voucher-apply-btn {
    background: var(--red);
    color: white;
    border: none;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.voucher-apply-btn:hover {
    background: var(--red-dark);
}

.saved-vouchers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.voucher-chip {
    border: 1.5px dashed var(--red);
    color: var(--red);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.voucher-chip:hover {
    background: rgba(227, 6, 19, 0.06);
}

/* ---- SUMMARY CARD ---- */
.cart-summary {
    position: sticky;
    top: 130px;
}

.summary-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.summary-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
}

.summary-card h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.delivery-address {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--gray-1);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 16px;
}

.address-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.address-name {
    font-size: 13px;
    font-weight: 600;
}

.address-detail {
    font-size: 12px;
    color: var(--gray-6);
}

.change-link {
    font-size: 12px;
    color: var(--red);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.shipping-options {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shipping-option {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-1);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.shipping-option:has(input:checked) {
    border-color: var(--red);
    background: rgba(227, 6, 19, 0.04);
}

.ship-info {
    display: flex;
    justify-content: space-between;
    flex: 1;
    align-items: center;
}

.ship-name {
    font-size: 13px;
    font-weight: 500;
}

.ship-price {
    font-size: 13px;
    font-weight: 700;
}

.text-red {
    color: var(--red);
}

.text-green {
    color: #27ae60;
}

.payment-options {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-1);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.payment-option:has(input:checked) {
    border-color: var(--red);
    background: rgba(227, 6, 19, 0.04);
}

.pay-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.pay-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.pay-info span {
    font-size: 13px;
    font-weight: 600;
}

.pay-info small {
    font-size: 11px;
    color: var(--gray-5);
}

.summary-numbers {
    border-top: 1px solid var(--gray-2);
    padding-top: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-6);
}

.discount-row span:last-child {
    color: var(--red);
    font-weight: 700;
}

.cashback-row span:last-child {
    color: #27ae60;
    font-weight: 700;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 18px;
    border-top: 2px solid var(--gray-2);
    padding-top: 12px;
}

#summaryTotal {
    color: var(--red);
    font-size: 24px;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-red);
    margin-bottom: 10px;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 32px rgba(227, 6, 19, 0.45);
}

.checkout-note {
    text-align: center;
    font-size: 11px;
    color: var(--gray-5);
}

/* ---- EMPTY ---- */
.empty-cart-page {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 80px;
    opacity: 0.2;
    margin-bottom: 20px;
}

.empty-cart-page h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

.empty-cart-page p {
    color: var(--gray-5);
}

/* ---- SUCCESS MODAL ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.success-icon {
    font-size: 80px;
    margin-bottom: 16px;
}

.modal-content h2 {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 10px;
    color: var(--text);
}

.modal-content p {
    font-size: 14px;
    color: var(--gray-6);
    margin-bottom: 8px;
}

.success-cashback {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #2e7d32;
    margin: 16px 0 24px;
}

.modal-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

@media (max-width: 768px) {
    .cart-page-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }
}