
/* =========================================
   CART PAGE STYLES (Modern & Clean)
   ========================================= */

.cart-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin-top: 40px;
    align-items: start;
}

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

.cart-items-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.cart-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 50px;
    padding: 15px 20px;
    background: #f9f9f9;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
}

.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 50px;
    padding: 20px;
    align-items: center;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item:hover {
    background: #fafafa;
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-product img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #eee;
}

.cart-product-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.cart-product-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cart-price {
    font-weight: 600;
    color: var(--text-primary);
}

.cart-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.qty-input {
    width: 30px;
    text-align: center;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    background: transparent;
}

.cart-total-price {
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

.remove-item-btn {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    margin: 0 auto;
}

.remove-item-btn:hover {
    background: #ff4757;
    color: white;
    transform: rotate(90deg);
}

/* Mobile Cart Layout */
@media (max-width: 768px) {
    .cart-header {
        display: none;
    }

    .cart-item {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 15px;
        position: relative;
    }

    .cart-product {
        width: 100%;
    }
    
    .cart-price {
        display: none; /* Hide unit price on mobile to save space */
    }

    .cart-quantity {
        justify-content: flex-start;
        margin-left: 75px; /* Align with text */
    }

    .cart-total-price {
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 1.1rem;
    }

    .remove-item-btn {
        position: absolute;
        bottom: 20px;
        right: 20px;
        margin: 0;
    }
}

/* Cart Summary Sidebar */
.cart-summary {
    background: #fff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.summary-row.total {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px dashed #eee;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 25px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.checkout-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

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

.empty-cart-icon {
    font-size: 4rem;
    color: #eee;
    margin-bottom: 20px;
}

.empty-cart-state h2 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-cart-state p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Best Sellers Grid in Empty Cart */
#bestSellersGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    text-align: left; /* Reset alignment */
}

#bestSellersGrid .product-card {
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
}

#bestSellersGrid .product-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

#bestSellersGrid .product-img-box {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #f9f9f9;
}

#bestSellersGrid .product-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

#bestSellersGrid .product-card:hover .product-img-box img {
    transform: scale(1.05);
}

#bestSellersGrid .product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

#bestSellersGrid .product-info h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#bestSellersGrid .price-box {
    margin-top: auto;
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}

#bestSellersGrid .current-price {
    font-weight: 700;
    color: var(--primary);
}

#bestSellersGrid .old-price {
    font-size: 0.85rem;
    text-decoration: line-through;
    color: #999;
}

#bestSellersGrid .add-to-cart-btn {
    width: 100%;
    padding: 10px;
    background: #f0f8f4;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#bestSellersGrid .add-to-cart-btn:hover {
    background: var(--primary);
    color: white;
}

/* Slidebar Cart Recommendations */
.cart-recommendations {
    margin-top: 20px;
    border-top: 1px dashed #eee;
    padding-top: 15px;
}

.cart-rec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    background: #f9f9f9;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-rec-item:hover {
    background: #f0f0f0;
}

.cart-rec-item img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.cart-rec-info {
    flex: 1;
}

.cart-rec-info h5 {
    font-size: 0.85rem;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.cart-rec-info .price {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

.cart-rec-add {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-rec-add:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}
