/* Cart Page Styles */
.cart-main {
    padding: 2rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.cart-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.cart-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.cart-header p {
    opacity: 0.9;
    font-size: clamp(1rem, 2vw, 1.1rem);
}

.cart-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Cart Items Section */
.cart-items-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
    color: #333;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

.clear-cart-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 0.45rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.clear-cart-btn:hover {
    background: #ff3742;
    transform: translateY(-2px);
}

/* Professional Cart Items Container */
.cart-items {
    background: white;
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-top: 2rem;
    overflow: hidden;
}

/* Professional cart items list */
.cart-items-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Cart Items Header - Like a table header */
.cart-items-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    padding: 1.2rem 1.5rem;
    background: #f8fafc;
    border-bottom: 2px solid #eef2f7;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cart Item Row - Professional layout */
.cart-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    gap: 1rem;
}

.cart-item-row:hover {
    background: #f8fafc;
}

/* Item Info - First column */
.item-info {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.item-info-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f9f9f9;
    border: 1px solid #eef2f7;
}

.item-info-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

.item-details-text {
    flex: 1;
}

.item-details-text h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.item-details-text .category {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.4rem;
}

.item-details-text .sku {
    font-size: 0.75rem;
    color: #94a3b8;
    font-family: monospace;
}

/* Unit Price - Second column */
.unit-price {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.unit-price .original-price {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 400;
}

/* Quantity Control - Third column */
.quantity-control-pro {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
}

.quantity-control-pro .quantity-btn {
    background: white;
    border: 2px solid #e2e8f0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #475569;
}

.quantity-control-pro .quantity-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.quantity-control-pro .quantity-input {
    width: 50px;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: white;
}

.quantity-control-pro .quantity-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Item Total - Fourth column */
.item-total-pro {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

/* Remove Button - Fifth column */
.remove-btn-pro {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn-pro:hover {
    background: #fef2f2;
    color: #ef4444;
}

/* Stock Indicator */
.stock-indicator {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-indicator.in-stock {
    color: #10b981;
}

.stock-indicator.low-stock {
    color: #f59e0b;
}

.stock-indicator.out-of-stock {
    color: #ef4444;
}

/* Cart Items Footer */
.cart-items-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background: #f8fafc;
    border-top: 2px solid #eef2f7;
    margin-top: auto;
}

.back-to-shop {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.back-to-shop:hover {
    background: white;
    color: #667eea;
}

.update-cart-btn {
    background: #e2e8f0;
    color: #475569;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.update-cart-btn:hover {
    background: #cbd5e1;
}

/* Empty cart */
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    width: 100%;
}

.empty-cart i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.shop-now-btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.shop-now-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* Order Summary Section */
.order-summary-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.summary-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.summary-card h3 {
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(1.1rem, 2vw, 1.3rem);
}

.summary-details {
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: #666;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.summary-row.total {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    font-weight: 700;
    color: #333;
    padding-top: 1rem;
    border-top: 2px solid #f0f0f0;
}

.coupon-section {
    margin-bottom: 1.5rem;
}

.coupon-section label {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.coupon-input {
    display: flex;
    gap: 0.5rem;
}

.coupon-input input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    min-width: 0;
}

.apply-coupon-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.apply-coupon-btn:hover {
    background: #5a6fd8;
}

#coupon-message {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    min-height: 20px;
}

.checkout-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkout-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: clamp(1rem, 1.8vw, 1.1rem);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    width: 100%;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.continue-shopping-btn {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e0e0e0;
    padding: 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.continue-shopping-btn:hover {
    background: #e9ecef;
}

.payment-methods {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
}

.payment-methods p {
    margin-bottom: 0.5rem;
    color: #666;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.payment-icons {
    display: flex;
    gap: 1rem;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    color: #666;
    flex-wrap: wrap;
}

/* Cart Tips */
.cart-tips {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.cart-tips h4 {
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(1rem, 1.8vw, 1.1rem);
}

.cart-tips ul {
    list-style: none;
    padding: 0;
}

.cart-tips li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #666;
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
    line-height: 1.4;
}

.cart-tips li i {
    color: #28a745;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

/* Recently Viewed Slider */
.recently-viewed {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-top: 2rem;
    overflow: hidden;
}

.recently-viewed h3 {
    color: #333;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
}

/* Recent Products Slider */
.recent-products-slider {
    display: flex;
    gap: 1rem;
    padding: 1rem 0.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f0f0f0;
}

.recent-products-slider::-webkit-scrollbar {
    height: 8px;
}

.recent-products-slider::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.recent-products-slider::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.recent-products-slider::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

.recent-product {
    flex: 0 0 calc(50% - 1rem);
    min-width: 200px;
    max-width: 250px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
    box-sizing: border-box;
}

.recent-product:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.recent-product-image {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.recent-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f9f9f9;
}

.recent-product-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #667eea;
}

/* Slider Navigation Buttons */
.slider-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.slider-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.slider-btn:hover {
    background: #5a6fd8;
    transform: scale(1.1);
}

.slider-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .cart-content {
        grid-template-columns: 1fr 300px;
        gap: 1.5rem;
    }
    
    .recent-product {
        min-width: 180px;
        max-width: 220px;
    }
}

@media (max-width: 992px) {
    .cart-content {
        grid-template-columns: 1fr;
    }
    
    .order-summary-section {
        order: -1;
    }
    
    .recent-product {
        min-width: 200px;
        max-width: 240px;
    }
}

@media (max-width: 768px) {
    .cart-main {
        padding: 1rem;
    }
    
    .cart-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .cart-items-section,
    .summary-card,
    .cart-tips,
    .recently-viewed {
        padding: 1.25rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .clear-cart-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cart-items-header {
        display: none;
    }
    
    .cart-item-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.2rem;
        position: relative;
    }
    
    .item-info {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 1rem;
    }
    
    .item-details-text {
        text-align: center;
    }
    
    .quantity-control-pro {
        justify-content: center;
    }
    
    .item-total-pro {
        text-align: center;
        font-size: 1.2rem;
    }
    
    .remove-btn-pro {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .cart-items-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .recent-product {
        min-width: calc(50% - 1rem);
        max-width: calc(50% - 1rem);
        padding: 1rem;
    }
    
    .recent-product-image {
        height: 140px;
    }
}

@media (max-width: 576px) {
    .cart-header {
        padding: 1rem;
    }
    
    .cart-header h1 {
        font-size: 1.6rem;
    }
    
    .cart-items-section,
    .summary-card,
    .cart-tips,
    .recently-viewed {
        padding: 1rem;
        border-radius: 10px;
    }
    
    .cart-item-row {
        padding: 1rem;
    }
    
    .item-info-image {
        width: 70px;
        height: 70px;
    }
    
    .quantity-control-pro .quantity-input {
        width: 45px;
    }
    
    .coupon-input {
        flex-direction: column;
    }
    
    .apply-coupon-btn {
        width: 100%;
    }
    
    .payment-icons {
        justify-content: center;
    }
    
    .recent-product {
        min-width: calc(100% - 1rem);
        max-width: calc(100% - 1rem);
        padding: 1rem;
    }
    
    .recent-product-image {
        height: 150px;
    }
    
    .slider-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .cart-main {
        padding: 0.75rem;
    }
    
    .cart-header {
        padding: 1rem 0.75rem;
    }
    
    .recent-product-name {
        font-size: 0.95rem;
    }
    
    .recent-product-price {
        font-size: 1.1rem;
    }
    
    .quantity-input {
        width: 40px;
    }
    
    .checkout-actions {
        gap: 0.75rem;
    }
    
    .checkout-btn,
    .continue-shopping-btn {
        padding: 0.85rem;
    }
    
    .cart-tips li {
        font-size: 0.85rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .recent-products-slider {
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    
    .recent-product {
        scroll-snap-align: start;
    }
    
    .recent-product:hover {
        transform: none;
        border-color: #f0f0f0;
    }
    
    .recent-product:active {
        border-color: #667eea;
    }
}

/* Snap behavior for better mobile scrolling */
.recent-products-slider {
    scroll-snap-type: x mandatory;
}

.recent-product {
    scroll-snap-align: start;
}