/* Cart Page Premium Styles */
.cart-section {
    padding: 60px 0;
    background: #fdfbf9;
    /* Warmer background */
    min-height: 60vh;
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.cart-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    margin: 0;
}

.btn-continue-shopping {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-continue-shopping:hover {
    gap: 12px;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 30px;
    align-items: start;
}

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

    .summary-card {
        position: static;
        margin-top: 25px;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .cart-item-card {
        grid-template-columns: 100px 1fr;
        padding: 15px;
        gap: 15px;
    }

    .cart-item-total {
        grid-column: 1 / -1;
        text-align: left;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid #f0f0f0;
        padding-top: 15px;
        margin-top: 10px;
    }

    .line-total-value {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .cart-item-card {
        grid-template-columns: 80px 1fr;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item-name {
        font-size: 16px;
    }

    .cart-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        margin-bottom: 20px;
    }

    .cart-items-list {
        width: 100%;
        margin-bottom: 0;
    }

    .btn-clear-cart {
        width: auto;
        text-align: center;
        padding: 8px 15px;
        /* Adjust padding if necessary */
        font-size: 14px;
    }

    .total-value {
        font-size: 18px; /* Reduced from 20px */
    }

    .total-label {
        font-size: 14px; /* Reduced from 15px */
    }

    .summary-card {
        padding: 15px;
        /* Tighter padding */
        border-radius: 16px;
    }

    .summary-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .summary-row,
    .summary-total {
        font-size: 13px;
        gap: 10px;
        /* Ensure space between label and value */
    }

    /* Prevent wrapping for single line requirement */
    .summary-row strong,
    .total-value {
        white-space: nowrap !important;
        text-align: right;
    }

    .cart-container {
        padding: 0 15px; /* Standardized mobile gutter */
        overflow-x: hidden;
    }

    .coupon-input-group {
        flex-direction: row;
        flex-wrap: wrap; /* Allow wrapping */
        gap: 5px;
        padding: 5px;
    }

    .btn-apply-coupon {
        width: auto;
        padding: 8px 15px; /* More compact */
        font-size: 13px; /* Reduced */
    }

    .coupon-input {
        width: auto;
        text-align: left;
        border-bottom: none;
        padding-bottom: 0;
        flex: 1;
        font-size: 13px; /* Reduced */
    }

    .cart-item-card {
        grid-template-columns: 80px 1fr;
        gap: 15px;
        padding: 15px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
        padding: 5px;
    }

    .cart-item-details {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        gap: 5px !important;
        padding: 0 5px !important;
    }

    .cart-item-total {
        grid-column: 1 / -1;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: wrap !important; /* Allow wrapping */
        width: 100%;
        border-top: 1px solid #f0f0f0;
        margin-top: 15px;
        padding-top: 15px;
        text-align: left;
    }

    .cart-item-price {
        font-size: 14px; /* Reduced from 16px */
    }

    .line-total-label,
    .line-total-value {
        margin: 0 !important;
        white-space: nowrap !important;
    }

    .line-total-value {
        font-size: 15px !important; /* Reduced from 18px-20px */
    }
}

/* Cart Items List */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-item-card {
    background: #fff;
    border-radius: 24px;
    padding: 24px;
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 24px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cart-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(194, 24, 91, 0.08);
}

.cart-item-image {
    width: 120px;
    height: 120px;
    border-radius: 18px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
}

.cart-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item-name {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.cart-item-price {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 700;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 4px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #fff;
    color: #222;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.qty-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.qty-input {
    width: 45px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 15px;
    color: #222;
}

.btn-remove {
    background: #fff5f7;
    color: #e91e63;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background: #e91e63;
    color: #fff;
}

.cart-item-total {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 10px 0;
}

.line-total-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.line-total-value {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
}

/* Order Summary Card */
.summary-card {
    background: #fff;
    border-radius: 28px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    position: sticky;
    top: 130px;
}

.summary-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 25px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-title i {
    color: var(--primary-color);
    font-size: 18px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 15px;
    color: #666;
}

.summary-row strong {
    color: #1a1a1a;
}

.summary-row.discount strong {
    color: #2e7d32;
}

.summary-total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.total-label {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.total-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary-color);
}

/* Coupon Section */
.coupon-section {
    margin: 25px 0;
}

.coupon-input-group {
    display: flex;
    gap: 10px;
    background: #f9f9f9;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid #eee;
}

.coupon-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 15px;
    font-weight: 600;
    text-transform: uppercase;
    outline: none;
}

.btn-apply-coupon {
    background: var(--icon-gradient);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(194, 24, 91, 0.2);
}

.btn-apply-coupon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(194, 24, 91, 0.3);
    filter: brightness(1.1);
}

.applied-coupon {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 15px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.coupon-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coupon-info i {
    color: #16a34a;
    font-size: 20px;
}

.coupon-code {
    font-weight: 700;
    color: #166534;
    display: block;
}

.btn-remove-coupon {
    color: #dc2626;
    background: none;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
}

/* Empty Cart */
.empty-cart-state {
    text-align: center;
    padding: 80px 40px;
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
}

.empty-cart-icon {
    font-size: 80px;
    color: #eee;
    margin-bottom: 30px;
}

.empty-cart-state h2 {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.empty-cart-state p {
    color: #666;
    font-size: 18px;
    max-width: 500px;
    margin: 0 auto 30px;
}

/* Clear Cart Button */
.btn-clear-cart {
    background: #fff;
    border: 1px solid #eee;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-clear-cart:hover {
    background: #fff5f5;
    color: #e53935;
    border-color: #ffcdd2;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.cart-item-card {
    animation: fadeIn 0.5s ease backwards;
}

/* Micro-viewport refinements for very small screens (iPhone SE, etc.) */
@media (max-width: 400px) {
    .cart-container {
        padding: 0 10px;
    }

    .cart-item-card {
        padding: 12px;
        grid-template-columns: 70px 1fr;
        gap: 12px;
    }

    .cart-item-image {
        width: 70px;
        height: 70px;
        padding: 3px;
    }

    .cart-item-details {
        padding: 0 5px !important;
    }

    .cart-item-name {
        font-size: 14px;
    }

    .quantity-control {
        scale: 0.9;
        transform-origin: left center;
    }

    .cart-item-actions {
        gap: 8px !important;
    }

    .summary-card {
        padding: 20px 15px;
    }
}

.summary-card {
    animation: fadeIn 0.5s ease 0.2s backwards;
}