/**
 * Modern Cart UI Styles
 */

/* Cart Notifications */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
}

.cart-notification--show {
    transform: translateX(0);
}

.cart-notification--success {
    background: rgba(34, 197, 94, 0.95);
    color: white;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.cart-notification--error {
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.cart-notification--info {
    background: rgba(59, 130, 246, 0.95);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.cart-notification--warning {
    background: rgba(245, 158, 11, 0.95);
    color: white;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.cart-notification__content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-notification__content .material-symbols-outlined {
    font-size: 20px;
    flex-shrink: 0;
}

/* Cart Icon Animations */
.cart-icon {
    transition: transform 0.2s ease;
}

.cart-icon.has-items {
    color: #3b82f6;
}

.cart-bounce {
    animation: cartBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes cartBounce {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Cart Count Badge */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    transform: scale(0);
    transition: transform 0.2s ease;
}

.cart-count:not([style*="display: none"]) {
    transform: scale(1);
}

/* Add to Cart Button States */
.add-to-cart-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

.add-to-cart-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.add-to-cart-btn.loading .material-symbols-outlined {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Quantity Controls */
.qty-controls {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.qty-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: #e2e8f0;
    color: #3b82f6;
}

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

.qty-input {
    width: 50px;
    height: 36px;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.qty-input:focus {
    outline: none;
    background: #f1f5f9;
}

/* Cart Summary */
.cart-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 100px;
}

.cart-summary__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.cart-summary__line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-summary__line:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 18px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .cart-notification--show {
        transform: translateY(0);
    }
    
    .cart-count {
        width: 18px;
        height: 18px;
        font-size: 11px;
        top: -6px;
        right: -6px;
    }
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success Animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.add-to-cart-btn.success {
    animation: successPulse 0.3s ease;
    background: #10b981 !important;
}

/* Cart Empty State */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.cart-empty__icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.cart-empty__title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
}

.cart-empty__text {
    font-size: 16px;
    margin-bottom: 24px;
}

.cart-empty__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #3b82f6;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cart-empty__button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}
