/**
 * Cart System Styles
 * 
 * Стили для визуальных индикаций loading/updating состояний
 * 
 * @package Ggpick
 * @version 1.0.0
 */

/* ============================================
   Loading States
   ============================================ */

/* Пульсация для loading */
@keyframes cart-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.cart-system-loading,
.updating,
.checkout-new-loading-pulse {
    animation: cart-pulse 1.5s ease-in-out infinite;
}

/* Fade out для удаления */
@keyframes cart-fade-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

.removing {
    animation: cart-fade-out 0.3s ease-out forwards;
}

/* ============================================
   Widget Styles
   ============================================ */

.cart-dropdown__product.removing {
    pointer-events: none;
}

.cart-dropdown__delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-dropdown__product-list.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ============================================
   Slider Styles
   ============================================ */

.offer-slide .add-to-cart-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.offer-slide .qty-btn {
    transition: all 0.2s ease;
}

.offer-slide .qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Индикатор обновления для quantity block */
[data-offer-id].updating {
    position: relative;
}

[data-offer-id].updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    pointer-events: none;
}

/* Плавное появление quantity block */
[data-offer-id] {
    animation: cart-fade-in 0.3s ease-in;
}

@keyframes cart-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   Success State
   ============================================ */

@keyframes cart-success-flash {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(75, 162, 133, 0.1);
    }
}

.cart-system-success {
    animation: cart-success-flash 0.6s ease-in-out;
}

/* ============================================
   Error Notification
   ============================================ */

.cart-system-error-notification {
    position: fixed;
    top: 20px;
    right: -400px;
    max-width: 350px;
    background: #EF4444;
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: right 0.3s ease-out;
    font-size: 14px;
    line-height: 1.4;
}

.cart-system-error-notification.show {
    right: 20px;
}

.cart-system-error-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.cart-system-error-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 639px) {
    .cart-system-error-notification {
        max-width: calc(100vw - 40px);
        font-size: 13px;
    }
    
    .cart-system-error-notification.show {
        right: 20px;
    }
}

/* ============================================
   Accessibility
   ============================================ */

.cart-system-loading *,
.updating *,
.removing * {
    pointer-events: none;
}

button:disabled {
    cursor: not-allowed !important;
}

