/* static/css/cart.css - MOBILE-FIRST Cart styles */

/* ========================================
   BASE STYLES - MOBILE (320px+)
   ======================================== */

/* Cart Button and Icon */
.cart-emblem-container {
    position: relative;
    z-index: 1000;
}

.cart-button {
    position: relative;
    background: #0d3b66;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(13, 59, 102, 0.3);
    transition: all 0.3s ease;
}

.cart-button:hover {
    background: #1e5f8b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 59, 102, 0.4);
}

.cart-icon {
    width: 18px;
    height: 18px;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    transition: all 0.2s ease;
    animation: bounce 0.3s ease;
}

.cart-count.hidden {
    display: none;
}

.cart-count.updating {
    transform: scale(1.2);
    background: #f59e0b;
}

/* Cart Dropdown - Mobile Full Width */
.cart-dropdown {
    position: fixed;
    top: 65px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    display: none;
    flex-direction: column;
    z-index: 1001;
    animation: slideDown 0.3s ease;
}

.cart-dropdown.active {
    display: flex;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
}

.cart-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.cart-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-close:hover {
    color: #374151;
}

/* Cart Items Container */
.cart-items {
    flex: 1;
    overflow-y: auto;
    max-height: 50vh;
}

.cart-empty {
    padding: 32px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.cart-item {
    display: flex;
    padding: 12px 15px;
    border-bottom: 1px solid #f3f4f6;
    align-items: center;
    gap: 10px;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-weight: 500;
    color: #374151;
    margin: 0 0 4px 0;
    font-size: 13px;
    line-height: 1.3;
}

.cart-item-variant {
    font-size: 11px;
    color: #9ca3af;
    margin: 0 0 4px 0;
}

.cart-item-price {
    font-weight: 600;
    color: #2563eb;
    font-size: 13px;
    margin: 0;
}

/* Cart Item Controls */
.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.quantity-mini-controls {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.qty-mini-btn {
    background: #f9fafb;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: #374151;
}

.qty-mini-btn:hover {
    background: #f3f4f6;
}

.qty-mini-input {
    border: none;
    width: 28px;
    text-align: center;
    height: 24px;
    font-size: 12px;
    background: white;
}

.qty-mini-input:focus {
    outline: none;
}

.remove-item {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 4px;
}

.remove-item:hover {
    background: #fef2f2;
}

/* Cart Footer */
.cart-footer {
    border-top: 1px solid #e5e7eb;
    padding: 12px 15px;
    display: none;
}

.cart-total {
    margin-bottom: 10px;
    text-align: center;
    font-size: 15px;
    color: #374151;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-clear-cart,
.btn-checkout {
    width: 100%;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.2s ease;
}

.btn-clear-cart {
    background: white;
    color: #6b7280;
    border-color: #d1d5db;
}

.btn-clear-cart:hover {
    background: #f9fafb;
    color: #374151;
}

.btn-checkout {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.btn-checkout:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.cart-overlay.active {
    display: block;
}

/* Loading States */
.cart-loading .cart-button {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0) scale(1);
    }
    40% {
        transform: translateY(-3px) scale(1.1);
    }
    80% {
        transform: translateY(-1px) scale(1.05);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   SMALL PHONES (480px+)
   ======================================== */
@media (min-width: 480px) {
    .cart-button {
        width: 48px;
        height: 48px;
    }
    
    .cart-icon {
        width: 19px;
        height: 19px;
    }
    
    .cart-count {
        width: 19px;
        height: 19px;
        font-size: 11px;
    }
    
    .cart-dropdown {
        right: 10px;
        left: auto;
        width: 320px;
    }
    
    .cart-header h3 {
        font-size: 17px;
    }
    
    .cart-item {
        padding: 13px 16px;
    }
    
    .cart-item-title {
        font-size: 14px;
    }
    
    .cart-item-variant {
        font-size: 12px;
    }
    
    .cart-item-price {
        font-size: 14px;
    }
}

/* ========================================
   TABLETS (768px+)
   ======================================== */
@media (min-width: 768px) {
    .cart-button {
        width: 50px;
        height: 50px;
    }
    
    .cart-icon {
        width: 20px;
        height: 20px;
    }
    
    .cart-count {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    .cart-dropdown {
        top: 70px;
        right: 0;
        left: auto;
        width: 350px;
        max-height: 500px;
    }
    
    .cart-header {
        padding: 15px 20px;
    }
    
    .cart-header h3 {
        font-size: 18px;
    }
    
    .cart-close {
        font-size: 24px;
    }
    
    .cart-items {
        max-height: 300px;
    }
    
    .cart-empty {
        padding: 40px 20px;
        font-size: 15px;
    }
    
    .cart-item {
        padding: 15px 20px;
        gap: 12px;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
        border-radius: 8px;
    }
    
    .cart-item-title {
        font-size: 14px;
    }
    
    .cart-item-variant {
        font-size: 12px;
    }
    
    .cart-item-price {
        font-size: 14px;
    }
    
    .cart-item-controls {
        gap: 8px;
    }
    
    .qty-mini-input {
        width: 30px;
    }
    
    .remove-item {
        font-size: 12px;
    }
    
    .cart-footer {
        padding: 15px 20px;
    }
    
    .cart-total {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .cart-actions {
        flex-direction: row;
        gap: 8px;
    }
    
    .btn-clear-cart,
    .btn-checkout {
        flex: 1;
        padding: 8px 16px;
    }
    
    .loading-spinner {
        width: 16px;
        height: 16px;
    }
}

/* ========================================
   DESKTOP (1024px+)
   ======================================== */
@media (min-width: 1024px) {
    .cart-dropdown {
        width: 380px;
    }
}

/* ========================================
   ACCESSIBILITY & PERFORMANCE
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .cart-button,
    .cart-dropdown,
    .cart-count,
    .loading-spinner {
        transition: none !important;
        animation: none !important;
    }
    
    .cart-button:hover {
        transform: none !important;
    }
}