/**
 * Lottie Animations CSS
 * Стили для Lottie-анимаций на raspilim.com
 * Цветовая схема: #00e6e8 (основной), #0097A7 (темный)
 */

/* =====================================================
   PRELOADER - полноэкранный прелоадер при загрузке
   ===================================================== */
#lottie-preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f4f5 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#lottie-preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#lottie-preloader .preloader-animation {
    width: 400px;
    height: 400px;
    max-width: 80vw;
    max-height: 80vw;
}

#lottie-preloader .preloader-text {
    margin-top: 20px;
    font-size: 18px;
    color: #0097A7;
    font-weight: 500;
    text-align: center;
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* =====================================================
   AJAX LOADER - универсальный лоадер для AJAX запросов
   ===================================================== */
.lottie-ajax-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.lottie-ajax-loader.active {
    display: flex;
}

.lottie-ajax-loader .loader-animation {
    width: 240px;
    height: 240px;
}

/* Компактный лоадер для блоков */
.lottie-loader-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    padding: 20px;
}

.lottie-loader-inline .loader-animation {
    width: 160px;
    height: 160px;
}

/* =====================================================
   CART ANIMATIONS - анимации корзины
   ===================================================== */

/* Пустая корзина */
.lottie-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: 60vh;
    margin: 0 auto;
}

.lottie-cart-empty .empty-animation {
    width: 500px;
    height: 500px;
    max-width: 90vw;
    margin-bottom: 30px;
}

.lottie-cart-empty .empty-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.lottie-cart-empty .empty-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.lottie-cart-empty .btn-to-catalog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #00e6e8 0%, #00BCD4 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 230, 232, 0.3);
}

.lottie-cart-empty .btn-to-catalog:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 230, 232, 0.4);
    color: #fff;
    text-decoration: none;
}

/* Успешное добавление в корзину */
.lottie-cart-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    animation: popup-appear 0.3s ease-out;
}

.lottie-cart-success.active {
    display: flex;
}

@keyframes popup-appear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.lottie-cart-success .success-animation {
    width: 240px;
    height: 240px;
}

.lottie-cart-success .success-text {
    margin-top: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #00BCD4;
    text-align: center;
}

.lottie-cart-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
}

.lottie-cart-success-overlay.active {
    display: block;
}

/* =====================================================
   404 PAGE - страница ошибки
   ===================================================== */
.lottie-404-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 40px 20px;
    text-align: center;
    margin: 0 auto;
}

.lottie-404-page .error-animation {
    width: 700px;
    height: 700px;
    max-width: 90vw;
    margin-bottom: 40px;
}

.lottie-404-page .error-title {
    font-size: 72px;
    font-weight: 700;
    color: #00e6e8;
    margin-bottom: 10px;
    line-height: 1;
    text-shadow: 2px 2px 0 #0097A7;
}

.lottie-404-page .error-subtitle {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.lottie-404-page .error-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    max-width: 500px;
    line-height: 1.6;
}

.lottie-404-page .error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.lottie-404-page .btn-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #00e6e8 0%, #00BCD4 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 230, 232, 0.3);
}

.lottie-404-page .btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 230, 232, 0.4);
    color: #fff;
    text-decoration: none;
}

.lottie-404-page .btn-catalog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: transparent;
    border: 2px solid #00e6e8;
    color: #00BCD4;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.lottie-404-page .btn-catalog:hover {
    background: rgba(0, 230, 232, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
}

/* =====================================================
   RESPONSIVE - мобильная адаптация
   ===================================================== */
@media (max-width: 768px) {
    #lottie-preloader .preloader-animation {
        width: 300px;
        height: 300px;
    }

    #lottie-preloader .preloader-text {
        font-size: 18px;
    }

    .lottie-cart-empty .empty-animation {
        width: 350px;
        height: 350px;
    }

    .lottie-cart-empty .empty-title {
        font-size: 22px;
    }

    .lottie-404-page .error-animation {
        width: 450px;
        height: 450px;
    }

    .lottie-404-page .error-title {
        font-size: 48px;
    }

    .lottie-404-page .error-subtitle {
        font-size: 22px;
    }

    .lottie-404-page .error-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .lottie-404-page .btn-home,
    .lottie-404-page .btn-catalog {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    #lottie-preloader .preloader-animation {
        width: 250px;
        height: 250px;
    }

    .lottie-cart-empty .empty-animation {
        width: 280px;
        height: 280px;
    }

    .lottie-cart-success {
        width: calc(100% - 40px);
        padding: 25px;
    }

    .lottie-cart-success .success-animation {
        width: 180px;
        height: 180px;
    }

    .lottie-404-page .error-animation {
        width: 320px;
        height: 320px;
    }

    .lottie-404-page .error-title {
        font-size: 36px;
    }

    .lottie-404-page .error-subtitle {
        font-size: 18px;
    }
}

/* =====================================================
   UTILITIES - вспомогательные классы
   ===================================================== */

/* Скрыть элемент с анимацией */
.lottie-fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

/* Показать элемент с анимацией */
.lottie-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Пульсация для привлечения внимания */
.lottie-pulse {
    animation: lottiePulse 2s ease-in-out infinite;
}

@keyframes lottiePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
