/* ========================================
   Cart Page Styles - UI/UX Pro Max (Vibrant Atmosphere)
   ======================================== */

body {
    margin: 0;
}

:root {
    /* Brand Colors */
    --primary: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --accent: #f43f5e;
    /* Rose 500 */
    --secondary: #1e293b;
    /* Slate 800 */

    /* Text Colors */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-on-dark: #ffffff;

    /* Backgrounds */
    /* Vibrant Gradient: Blue to Violet */
    --bg-gradient: linear-gradient(135deg, #bfdbfe 0%, #ddd6fe 100%);
    --bg-glass: rgba(255, 255, 255, 0.9);

    /* Shadows & Borders */
    --shadow-sm: 0 4px 6px -1px rgba(79, 70, 229, 0.1);
    --shadow-card: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --shadow-float: 0 25px 50px -12px rgba(30, 41, 59, 0.25);
    --border-glass: 1px solid rgba(255, 255, 255, 0.6);

    --radius-card: 24px;
}

/* Container */
.cart-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Steps Indicator */
.cart-steps {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-bottom: 4rem;
    position: relative;
    padding-top: 1rem;
}

/* Connecting Line */
.cart-steps::before {
    content: '';
    position: absolute;
    top: 42px;
    left: 51%;
    transform: translateX(-50%);
    width: 320px;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    z-index: 0;
    border-radius: 99px;
}

.step-item {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.step-num {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--text-muted);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.step-item span {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--secondary);
    opacity: 0.6;
}

.step-item.active .step-num {
    background: var(--primary);
    border-color: white;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.step-item.active span {
    opacity: 1;
    color: var(--primary);
}

/* Main Section Header (Glassmorphism) */
.section-header {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: var(--border-glass);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-card);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3rem;
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-count-badge {
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 99px;
    font-weight: 700;
}

/* Cart List Header */
.cart-list-header {
    display: grid;
    grid-template-columns: auto 90px 1fr 120px 140px 120px 120px 50px;
    gap: 2rem;
    padding: 0 2rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    align-items: center;
    justify-items: center;
    /* Grid items center */
}

.cart-list-header>div {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Quantity Selector */
.qty-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 99px;
    /* Pill shape */
    border: 1px solid #e2e8f0;
    padding: 2px;
    width: fit-content;
}

.qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-main);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    user-select: none;
}

.qty-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.qty-display {
    width: 36px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    user-select: none;
}

.cart-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-card);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: auto 90px 1fr 120px 140px 120px 120px 50px;
    gap: 2rem;
    align-items: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    /* Stronger shadow */
    transition: all 0.25s;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.cart-item.selected {
    border: 2px solid var(--primary);
    background: #ffffff;
}

.cart-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.1);
}

/* Checkbox */
.custom-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    accent-color: var(--primary);
    transition: all 0.2s;
}

.custom-checkbox:hover {
    border-color: var(--primary);
}

/* Product Image */
.product-image-container {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    padding: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.05));
    transition: transform 0.3s;
}

.cart-item:hover .product-image {
    transform: scale(1.1);
}

/* Product Texts */
.product-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: block;
}

.product-title:hover {
    color: var(--primary);
}

.spec-tag {
    display: inline-block;
    font-size: 0.75rem;
    background: #f1f5f9;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    margin: 0 6px 6px 0;
    font-weight: 600;
}

.edit-config-btn {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: #eef2ff;
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    transition: all 0.2s;
}

.edit-config-btn:hover {
    background: var(--primary);
    color: white;
}

/* Price & Quantity */
.col-price .unit-price {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.product-type-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #0f172a;
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    margin-top: 4px;
    display: inline-block;
}

.col-fee {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.qty-selector {
    display: flex;
    padding: 3px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    border-radius: 9px;
    transition: 0.2s;
}

.qty-btn:hover {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.qty-input {
    width: 44px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 800;
    color: var(--text-main);
    font-size: 1rem;
}

.total-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.btn-delete {
    background: white;
    border: 1px solid #e2e8f0;
    color: #bdc3c7;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.btn-delete:hover {
    border-color: #fee2e2;
    background: #fef2f2;
    color: #ef4444;
}

/* Summary Card - Dark & Vibrant */
.summary-column {
    position: relative;
    z-index: 10;
    margin-top: -5rem;
}

.summary-card {
    background: var(--secondary);
    /* Dark Card */
    color: white;
    border-radius: var(--radius-card);
    padding: 2.5rem;
    box-shadow: var(--shadow-float);
    position: sticky;
    top: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: white;
    letter-spacing: -0.01em;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    color: #94a3b8;
    font-size: 1rem;
}

.summary-value {
    color: white;
    font-weight: 600;
}

.summary-divider {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 1.5rem 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.total-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.total-amount {
    font-size: 2.2rem;
    font-weight: 900;
    color: #818cf8;
    line-height: 1;
}

.btn-checkout {
    width: 100%;
    padding: 1.25rem;
    background: white;
    color: var(--secondary);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-checkout:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    background: #f8fafc;
}

.btn-checkout i {
    color: var(--primary);
}

.secure-badge {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Empty State */
.empty-cart-state {
    grid-column: 1 / -1;
    padding: 6rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.empty-icon-box {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    border: 4px solid #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 3rem;
    margin: 0 auto 2rem;
}

.btn-shop-now {
    margin-top: 1.5rem;
    padding: 1rem 3rem;
    background: var(--primary);
    color: white;
    font-weight: 700;
    border-radius: 99px;
    font-size: 1rem;
    transition: 0.2s;
}

.btn-shop-now:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4);
}

/* Responsive */
@media (max-width: 1024px) {
    .cart-container {
        grid-template-columns: 1fr;
    }

    .summary-column {
        margin-top: 0;
    }

    .summary-card {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .cart-steps {
        display: none;
    }

    .cart-item {
        grid-template-columns: 1fr;
        padding-top: 3.5rem;
        position: relative;
    }

    .cart-item>*:first-child {
        position: absolute;
        top: 1rem;
        left: 1rem;
    }

    .cart-item>div:last-child {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    .col-price,
    .col-qty,
    .col-fee,
    .col-total {
        flex-direction: row;
        justify-content: space-between;
        border-bottom: 1px dashed #e2e8f0;
        padding: 8px 0;
    }

    .text-label-mobile {
        display: block;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: #64748b;
        font-weight: 700;
    }

    .product-image-container {
        margin: 0 auto;
    }

    .product-info-col {
        text-align: center;
        align-items: center;
    }
}

/* ========================================
   Refactored Inline Styles
   ======================================== */

.cart-page-body {
    padding-top: 120px;
    padding-bottom: 80px;
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
    /* High contrast gradient */
}

.cart-error-alert {
    max-width: 1400px;
    background: #fee2e2;
    color: #b91c1c;
    padding: 1rem;
}

.select-all-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.select-all-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.qty-display-text {
    font-weight: 700;
    font-size: 1.1rem;
}

.qty-variation-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.qty-icon-small {
    font-size: 0.7rem;
}

.icon-delete {
    font-size: 1.2rem;
}

.shipping-calc-text {
    color: #22c55e;
    font-size: 0.9rem;
}

.payment-icons-list {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.empty-state-desc {
    color: var(--text-muted);
    max-width: 480px;
    line-height: 1.6;
    margin: 0 auto 1.5rem;
    font-size: 1rem;
}

/* Redesigned Empty State Container (Overrides earlier rules) */
.empty-cart-state {
    grid-column: 1 / -1;
    padding: 6rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 40px 100px -20px rgba(50, 50, 93, 0.1), 0 30px 60px -30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Decorative Background Blobs */
.empty-cart-state::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
    z-index: 0;
}

.empty-cart-state::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(244, 63, 94, 0.05) 0%, transparent 70%);
    z-index: 0;
}

.empty-cart-state>* {
    position: relative;
    z-index: 1;
}

/* Animated Icon Box */
.empty-icon-box {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    /* border: 4px solid #e0e7ff; */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 3rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 20px 40px -10px rgba(79, 70, 229, 0.2);
    animation: floatIcon 6s ease-in-out infinite;
    position: relative;
}

.empty-icon-box::after {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 2px dashed #e0e7ff;
    animation: spinSlow 30s linear infinite;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Shop Now Button */
.btn-shop-now {
    margin-top: 1rem;
    padding: 1.25rem 4rem;
    background: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
    color: white;
    font-weight: 800;
    border-radius: 99px;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    display: inline-block;
}

.btn-shop-now:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 25px 50px -10px rgba(79, 70, 229, 0.5);
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
}

/* Modal Styles */
.cart-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.cart-modal-content {
    background: #fff;
    padding: 2.5rem;
    border-radius: 24px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalPop {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.cart-modal-icon {
    width: 72px;
    height: 72px;
    background: #fff7ed;
    color: #f97316;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.3);
}

.cart-modal-title {
    margin-bottom: 0.75rem;
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.5rem;
}

.cart-modal-message {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.cart-modal-btn {
    width: 100%;
    padding: 1rem;
    background: var(--text-main);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
}

.cart-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.2);
}