/* Modern Cart Styles */

.modern-cart-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Hero Section Enhancement */
.hero-section.modern-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 15px;
    margin-bottom: 3rem;
    text-align: center;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0;
}

/* Empty Cart State */
.empty-cart-modern {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.empty-cart-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.empty-cart-modern h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 700;
}

.empty-cart-modern p {
    color: #6c757d;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.empty-cart-modern .btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.empty-cart-modern .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Cart Items */
.cart-items-modern {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.cart-header-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    margin: 0;
}

.cart-header-modern h4 {
    margin: 0;
    font-weight: 600;
}

.cart-item-modern {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.3s ease;
    gap: 1.5rem;
    background: white;
}

.cart-item-modern:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cart-item-modern:last-child {
    border-bottom: none;
    border-radius: 0 0 15px 15px;
}

.item-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.item-image .product-image {
    width: 90px;
    height: 90px;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-image:hover .product-image {
    transform: scale(1.05);
}

.item-details {
    flex: 1;
    padding-right: 1rem;
}

.item-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.item-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.item-title a:hover {
    color: #667eea;
}

.item-variation {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0 0 0.5rem 0;
}

.item-price {
    font-size: 1rem;
}

.current-price {
    color: #28a745;
    font-weight: 600;
}

.item-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 25px;
    padding: 0.25rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quantity-controls .btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    border: none;
    background: white;
    color: #495057;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quantity-controls .btn:hover {
    transform: scale(1.1);
    background: #667eea;
    color: white;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.quantity-controls .btn:active {
    transform: scale(0.95);
}

.quantity-display {
    min-width: 45px;
    text-align: center;
    font-weight: 700;
    color: #2c3e50;
    font-size: 1rem;
    background: white;
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
}

.item-total-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: #28a745;
}

.remove-item {
    transition: all 0.3s ease;
    background: white;
    color: #dc3545;
    border: 1px solid #dc3545;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.remove-item:hover {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.remove-item:active {
    transform: scale(0.95);
}

/* Cart Summary */
.cart-summary-modern {
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    position: sticky;
    top: 2rem;
    border: 1px solid #e9ecef;
}

.cart-summary-modern h4 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-weight: 700;
    text-align: center;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.summary-row:last-child {
    border-bottom: none;
}

.grand-total {
    background: #ffffff;
    color: #2c3e50;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    border: 2px solid #e9ecef;
    border-left: 4px solid #28a745;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.grand-total:hover {
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
}

.grand-total .total-label {
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
}

.grand-total .total-amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: #28a745;
}

/* Cart Actions */
.cart-actions-modern {
    margin: 2rem 0;
}

.cart-actions-modern .btn {
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cart-actions-modern .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.cart-actions-modern .btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

/* Shipping Info */
.shipping-info {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.shipping-info h6 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.shipping-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shipping-list li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Cart Preview (Dropdown) */
.cart-preview {
    width: 400px;
    z-index: 1050;
    max-height: 80vh;
    overflow-y: auto;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 15px;
}

.cart-preview .card-body {
    padding: 1.5rem;
}

.cart-preview .cart-item-preview {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f1f3f4;
    gap: 0.75rem;
    transition: background-color 0.2s ease;
}

.cart-preview .cart-item-preview:hover {
    background-color: #f8f9fa;
}

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

.cart-preview .item-image-small {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #e9ecef;
}

.cart-preview .item-image-small img {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.cart-preview .item-image-small:hover img {
    transform: scale(1.05);
}

.cart-preview .item-info {
    flex: 1;
}

.cart-preview .item-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: #2c3e50;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cart-preview .item-price {
    font-size: 0.75rem;
    color: #28a745;
    font-weight: 600;
}

.cart-preview .item-variation {
    font-size: 0.7rem;
    color: #6c757d;
    margin: 0.15rem 0;
}

/* Responsive Design */
@media (max-width: 992px) {
    .cart-summary-modern {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .modern-cart-container {
        padding: 0 1rem;
    }
    
    .cart-item-modern {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }
    
    .item-image {
        align-self: center;
        width: 80px;
        height: 80px;
    }
    
    .item-details {
        text-align: center;
        padding-right: 0;
    }
    
    .item-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    
    .quantity-controls {
        order: 1;
        flex: 1;
        justify-content: center;
    }
    
    .item-total-price {
        order: 2;
        flex-shrink: 0;
    }
    
    .remove-item {
        order: 3;
        flex-shrink: 0;
    }
    
    .cart-summary-modern {
        position: static;
        margin-top: 2rem;
        padding: 1.5rem;
    }
    
    .cart-preview {
        width: 90vw;
        left: 5vw !important;
        right: 5vw !important;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .cart-item-modern {
        padding: 0.75rem;
    }
    
    .item-image {
        width: 60px;
        height: 60px;
    }
    
    /* Fixed: Increase touch targets to 44px minimum for mobile accessibility */
    .quantity-controls .btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    .quantity-display {
        min-width: 40px;
        font-size: 1rem;
    }
    
    .remove-item {
        width: 44px;
        height: 44px;
    }
    
    .cart-summary-modern {
        padding: 1rem;
    }
    
    .btn-checkout {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Fixed: Improve mobile item controls layout */
    .item-controls {
        display: grid;
        grid-template-columns: 1fr auto auto;
        gap: 0.5rem;
        width: 100%;
        align-items: center;
    }
    
    .quantity-controls {
        justify-self: start;
    }
    
    .item-total-price {
        font-size: 1.1rem;
        font-weight: bold;
    }
    
    .remove-item {
        justify-self: end;
    }
}

/* Loading States */
.update-qty:disabled,
.remove-item:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animation for cart updates */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cart-item-modern {
    animation: fadeIn 0.3s ease-out;
}

/* Toast notifications positioning */
#toast-container {
    z-index: 1060;
}

/* Cart button in header - only animate on change, not continuously */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Only animate when cart count changes - controlled by JS */
.btn.position-relative .badge.pulse-once {
    animation: pulse 0.5s ease-out;
}

/* Mobile cart summary - fixed to bottom on mobile */
@media (max-width: 768px) {
    .cart-summary-mobile-fixed {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 15px 15px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        z-index: 1000;
        max-height: 40vh;
        overflow-y: auto;
    }
    
    /* Add padding to cart items so they're not hidden behind summary */
    .cart-items-with-fixed-summary {
        padding-bottom: 200px;
    }
    
    /* Fix cart preview width on mobile */
    .cart-preview,
    #cartPreview {
        width: calc(100vw - 20px) !important;
        left: 10px !important;
        right: 10px !important;
        max-width: 400px;
    }
}

/* Consistent z-index scale */
:root {
    --z-header: 1000;
    --z-dropdown: 1010;
    --z-cart-preview: 1020;
    --z-search: 1030;
    --z-modal: 1040;
    --z-toast: 1050;
}
