/* ============================================
   CART PAGE - Premium Redesign
   Modern, Mobile-First Approach
   ============================================ */

/* === PAGE LAYOUT === */
.cart-page {
    padding: 2rem 0 4rem;
    min-height: 70vh;
    background: linear-gradient(180deg, rgba(142, 42, 140, 0.03) 0%, transparent 40%);
}

.cart-page__title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    color: var(--color-secondary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-page__title i {
    color: var(--color-primary);
    font-size: 0.9em;
}

/* === EMPTY CART STATE === */
.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #fff 0%, #fdf2f8 100%);
    border-radius: 24px;
    border: 1px solid rgba(230, 0, 126, 0.1);
}

.cart-empty i {
    font-size: 4.5rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    display: block;
}

.cart-empty h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--color-secondary);
}

.cart-empty p {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* === MAIN CART LAYOUT === */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 992px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

/* === CART ITEMS CONTAINER === */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* === CART ITEM CARD - DESKTOP === */
.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto 40px;
    gap: 1.25rem;
    align-items: center;
    background: #fff;
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.cart-item:hover {
    box-shadow: 0 8px 30px rgba(230, 0, 126, 0.08);
    border-color: rgba(230, 0, 126, 0.1);
    transform: translateY(-2px);
}

/* Product Image */
.cart-item__image {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #fdf2f8 0%, #f3e8ff 100%);
    flex-shrink: 0;
}

.cart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cart-item:hover .cart-item__image img {
    transform: scale(1.05);
}

.cart-item__noimage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--color-primary);
    opacity: 0.3;
}

.cart-item__badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: linear-gradient(135deg, var(--color-primary), #ff4d94);
    color: #fff;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(230, 0, 126, 0.3);
}

/* Product Details */
.cart-item__details {
    min-width: 0;
}

.cart-item__details h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--color-text);
    line-height: 1.3;
}

.cart-item__sku {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.cart-item__offer {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    padding: 3px 10px;
    border-radius: 20px;
    margin-top: 0.5rem;
}

.cart-item__offer i {
    font-size: 0.65rem;
}

/* Unit Price */
.cart-item__price {
    text-align: right;
    min-width: 90px;
}

.cart-item__price .price-old {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.cart-item__price .price-current {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-secondary);
}

/* Quantity Controls */
.cart-item__quantity {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f8f8f8;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
}

.cart-item__quantity button {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.cart-item__quantity button:hover {
    background: var(--color-primary);
    color: #fff;
}

.cart-item__quantity button:active {
    transform: scale(0.95);
}

.cart-item__quantity span {
    min-width: 40px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text);
}

/* Line Total */
.cart-item__total {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-primary);
    min-width: 100px;
    text-align: right;
}

/* Remove Button */
.cart-item__remove {
    width: 40px;
    height: 40px;
    background: #fef2f2;
    border: none;
    color: #ef4444;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.cart-item__remove:hover {
    background: #fee2e2;
    transform: scale(1.1);
}

/* === CART ITEM - MOBILE LAYOUT === */
@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 85px 1fr;
        grid-template-rows: auto auto;
        gap: 0.75rem 1rem;
        padding: 1rem;
        position: relative;
    }

    /* Image */
    .cart-item__image {
        grid-row: 1 / 3;
        width: 85px;
        height: 85px;
        border-radius: 12px;
    }

    /* Details */
    .cart-item__details {
        grid-column: 2;
        padding-right: 2.5rem;
        /* Space for remove button */
    }

    .cart-item__details h3 {
        font-size: 0.95rem;
        margin-bottom: 0.2rem;
    }

    .cart-item__sku {
        margin-bottom: 0;
    }

    .cart-item__offer {
        display: none;
        /* Hide offer tag on mobile to save space */
    }

    /* Hide unit price on mobile - show only total */
    .cart-item__price {
        display: none;
    }

    /* Quantity - Bottom Left */
    .cart-item__quantity {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 10px;
    }

    .cart-item__quantity button {
        width: 32px;
        height: 32px;
    }

    .cart-item__quantity span {
        min-width: 32px;
        font-size: 0.95rem;
    }

    /* Total - Bottom Right */
    .cart-item__total {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        align-self: center;
        font-size: 1.15rem;
        min-width: auto;
    }

    /* Remove Button - Top Right Corner */
    .cart-item__remove {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        width: 28px;
        height: 28px;
        padding: 0;
        background: rgba(239, 68, 68, 0.1);
        font-size: 0.75rem;
    }
}

/* === CART SUMMARY === */
.cart-summary {
    background: #fff;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--color-secondary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f5f5f5;
}

/* === COUPON INPUT === */
.cart-coupon {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.cart-coupon__form {
    display: flex;
    gap: 0.5rem;
}

.cart-coupon__form input {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.cart-coupon__form input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.cart-coupon__form .btn {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.cart-coupon__applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: #059669;
    font-weight: 600;
}

.cart-coupon__applied i {
    margin-right: 0.5rem;
}

.cart-coupon__remove {
    background: transparent;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cart-coupon__remove:hover {
    background: rgba(220, 38, 38, 0.1);
}

.cart-coupon__error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cart-coupon__info {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* === TAX BREAKDOWN === */
.cart-summary__tax {
    background: #f9fafb;
    margin: 0.75rem -1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px dashed #e5e7eb;
}

.cart-summary__tax .cart-summary__row {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.cart-summary__tax .cart-summary__row:last-child {
    margin-bottom: 0;
}

/* === SAVINGS DISPLAY === */
.cart-summary__savings {
    background: linear-gradient(135deg, rgba(230, 0, 126, 0.1) 0%, rgba(142, 42, 140, 0.1) 100%);
    color: var(--color-primary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cart-summary__savings i {
    font-size: 1.1rem;
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
    font-size: 0.95rem;
}

.cart-summary__row span:first-child {
    color: var(--color-text-muted);
}

.cart-summary__row span:last-child {
    font-weight: 500;
}

.cart-summary__discount {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    margin: 0.5rem -1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
}

.cart-summary__discount span {
    color: #059669 !important;
    font-weight: 600 !important;
}

.cart-summary__total {
    font-size: 1.35rem !important;
    font-weight: 800;
    padding-top: 1.25rem;
    margin-top: 1rem;
    border-top: 2px dashed #eee;
}

.cart-summary__total span:first-child {
    color: var(--color-text) !important;
}

.cart-summary__total span:last-child {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Checkout Buttons */
.cart-checkout {
    margin-top: 1.75rem;
}

.cart-checkout__label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.cart-checkout .btn {
    margin-bottom: 0.65rem;
    border-radius: 12px;
    padding: 0.9rem 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cart-checkout .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn--whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    border: none !important;
}

.btn--whatsapp:hover {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
}

.cart-summary__continue {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    padding: 0.75rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.cart-summary__continue:hover {
    color: var(--color-primary);
    background: rgba(230, 0, 126, 0.05);
}

/* === MOBILE SUMMARY === */
@media (max-width: 992px) {
    .cart-summary {
        position: relative;
        top: 0;
        margin-top: 1.5rem;
    }
}

/* === MODAL STYLES === */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal__content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border: none;
    font-size: 1rem;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__close:hover {
    background: #fee2e2;
    color: #ef4444;
}

.modal__content h2 {
    font-family: var(--font-display);
    margin-bottom: 1.5rem;
    color: var(--color-secondary);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(230, 0, 126, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #bbb;
}

/* === ANIMATIONS === */
.cart-item {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.cart-item:nth-child(1) {
    animation-delay: 0.1s;
}

.cart-item:nth-child(2) {
    animation-delay: 0.2s;
}

.cart-item:nth-child(3) {
    animation-delay: 0.3s;
}

.cart-item:nth-child(4) {
    animation-delay: 0.4s;
}

.cart-item:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-summary {
    animation: fadeInUp 0.4s ease 0.3s forwards;
    opacity: 0;
}

/* Channel Selector */
.channel-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.channel-option input {
    display: none;
}

.channel-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.channel-card i {
    font-size: 1.5rem;
    color: var(--color-text-muted);
}

.channel-option input:checked+.channel-card {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.05);
    color: var(--color-primary);
}

.channel-option input:checked+.channel-card i {
    color: var(--color-primary);
}

.channel-option input[value="whatsapp"]:checked+.channel-card {
    border-color: #25D366;
    color: #25D366;
    background: rgba(37, 211, 102, 0.05);
}

.channel-option input[value="whatsapp"]:checked+.channel-card i {
    color: #25D366;
}