/* ==========================================================================
   LENPEDIA PRICE: ULTIMATE UI/UX (SCROLL EDITION)
   ========================================================================== */

/* 1. ГЛАВНЫЙ КОНТЕЙНЕР */
.lenpedia-price-container {
    background: #ffffff;
    border-radius: 30px;
    box-shadow: 0 30px 60px -15px rgba(37, 99, 235, 0.15);
    padding: 50px 50px 120px; /* Увеличил отступ снизу, чтобы кнопка не наезжала на текст */
    margin: 60px auto;
    max-width: 100%;
    font-family: 'Manrope', sans-serif !important;
    color: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* 2. ЛОГИКА СКРЫТИЯ */
.lenpedia-price-all-tables-container {
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.lenpedia-price-container.collapsed .lenpedia-price-all-tables-container {
    max-height: 450px !important;
}

.lenpedia-price-container.expanded .lenpedia-price-all-tables-container {
    max-height: none !important;
}

/* Шторка (Gradient Fade) */
.lenpedia-price-container::before {
    content: '';
    position: absolute;
    bottom: 90px;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 60%, #ffffff 100%);
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.lenpedia-price-container.collapsed::before {
    opacity: 1;
}

/* --- ИСПРАВЛЕНИЕ: ОГРАНИЧЕНИЕ ШИРИНЫ ТОЛЬКО ДЛЯ ТЕКСТА --- */
/* Применяем 800px только к текстовым элементам */
.lenpedia-price-all-tables-container > p,
.lenpedia-price-all-tables-container > ul,
.lenpedia-price-all-tables-container > ol,
.lenpedia-price-all-tables-container > h3,
.lenpedia-price-all-tables-container > h4,
.lenpedia-price-all-tables-container > blockquote {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    color: #475569;
}

/* Заголовки */
.lenpedia-price-all-tables-container > h3,
.lenpedia-price-all-tables-container > h4 {
    margin-top: 35px;
    margin-bottom: 15px;
    color: #1e293b;
}

/* ВАЖНО: Обертка таблицы и сама таблица - НА ВСЮ ШИРИНУ */
.lenpedia-table-scroll-wrapper,
.lenpedia-price-table {
    width: 100% !important;
    max-width: 100% !important;
}

/* --- ГОРИЗОНТАЛЬНЫЙ СКРОЛЛ (ОБЕРТКА) --- */
.lenpedia-table-scroll-wrapper {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 25px;
    padding-bottom: 5px; /* Место для скроллбара */
    
    /* Стили скроллбара */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.lenpedia-table-scroll-wrapper::-webkit-scrollbar { height: 6px; }
.lenpedia-table-scroll-wrapper::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* 3. ТАБЛИЦА (СТИЛИ) */
.lenpedia-price-table {
    border-collapse: collapse;
    border: none;
}

.lenpedia-price-table td, 
.lenpedia-price-table th {
    background: transparent !important;
    border: none !important;
    padding: 20px 15px;
    vertical-align: middle;
}

.lenpedia-price-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
}
.lenpedia-price-table tbody tr:hover {
    background-color: #f8fafc !important;
}

/* Колонка названия */
.lenpedia-price-table td:first-child {
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
    min-width: 250px; /* Минимальная ширина текста, чтобы не жался */
}

/* Колонка цены */
.lenpedia-price-table td:last-child {
    text-align: right;
    font-size: 1.35rem;
    font-weight: 800;
    color: #2563eb;
    white-space: nowrap; /* Цена всегда в одну строку */
    padding-left: 30px;
}

/* Заголовок всего блока */
.lenpedia-price-container > h2 {
    font-size: 2.4rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 40px;
    color: #0f172a;
}

/* 4. КНОПКА (SUPER BUTTON) */
.lenpedia-price-expand-button {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    
    width: 260px;
    height: 60px;
    border-radius: 100px;
    
    /* Градиент ОТКРЫТИЯ (Синий -> Зеленый) */
    background: linear-gradient(90deg, #2563eb 0%, #10b981 100%);
    background-size: 200% auto;
    
    color: #ffffff;
    font-weight: 800 !important;
    font-size: 1rem !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
    border: 2px solid rgba(255,255,255,0.2);
    
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lenpedia-price-expand-button:hover {
    transform: translateX(-50%) translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.5);
    background-position: right center;
}

.lenpedia-price-expand-button::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: rotate(45deg);
    margin-bottom: 3px;
    transition: transform 0.4s ease;
}

/* --- СТИЛЬ "СВЕРНУТЬ" (ОГНЕННЫЙ ГРАДИЕНТ) --- */
.lenpedia-price-container.expanded .lenpedia-price-expand-button {
    background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%); /* Оранжевый -> Красный */
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
}

.lenpedia-price-container.expanded .lenpedia-price-expand-button:hover {
    background-position: right center;
    box-shadow: 0 20px 40px rgba(239, 68, 68, 0.5);
}

.lenpedia-price-container.expanded .lenpedia-price-expand-button::after {
    transform: rotate(-135deg);
    margin-bottom: -3px;
}

/* --- STICKY (ЛИПКАЯ КНОПКА) --- */
.lenpedia-price-expand-button.is-sticky {
    position: fixed !important;
    bottom: 30px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3) !important;
    z-index: 9999;
    animation: popUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lenpedia-price-expand-button.is-sticky:hover {
    transform: translateX(-50%) translateY(-5px) !important;
}

@keyframes popUp {
    0% { transform: translateX(-50%) translateY(100px); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}





/* --- НОВОЕ: ПОДСКАЗКА СКРОЛЛА (CSS) --- */
.lenpedia-mobile-scroll-hint {
    display: none; /* Скрыто на ПК */
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 15px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
}

.lenpedia-mobile-scroll-hint video {
    width: 32px;
    height: 32px;
    display: block;
    mix-blend-mode: multiply; /* Убирает белый фон у видео, если он есть */
}

/* Включаем подсказку ТОЛЬКО на мобильных */
@media (max-width: 768px) {
    .lenpedia-mobile-scroll-hint {
        display: flex; /* Показываем */
    }
    
    /* Уменьшаем отступ у скролл-обертки, так как сверху теперь подсказка */
    .lenpedia-table-scroll-wrapper {
        margin-top: 5px; 
    }
}








/* 5. МОБИЛЬНАЯ АДАПТАЦИЯ (Updated) */
@media (max-width: 768px) {
    .lenpedia-price-container {
        padding: 30px 15px 100px; /* Отступы по бокам меньше */
        border-radius: 20px;
    }

    /* Текст на мобильном - на всю ширину (убираем 800px) */
    .lenpedia-price-all-tables-container > p,
    .lenpedia-price-all-tables-container > ul {
        max-width: 100%;
        padding: 0 5px;
    }

    /* --- ЛОГИКА ТАБЛИЦЫ НА ТЕЛЕФОНЕ --- */
    
    /* 1. Заставляем таблицу быть широкой */
    .lenpedia-price-table {
        min-width: 600px; /* Таблица шире экрана -> включается скролл */
    }

    /* 2. Возвращаем обычное поведение ячеек (строки, не карточки) */
    .lenpedia-price-table tbody tr {
        display: table-row; 
        flex-direction: unset;
    }
    
    .lenpedia-price-table td {
        display: table-cell;
        padding: 15px 10px;
        width: auto;
        text-align: left;
    }

    /* 3. Возвращаем шапку (если есть) */
    .lenpedia-price-table thead { display: table-header-group; }

    /* Настройка шрифтов для мобилы в таблице */
    .lenpedia-price-table td:first-child {
        font-size: 0.95rem; /* Чуть меньше текст */
        white-space: normal; /* Перенос текста названия */
    }
    
    .lenpedia-price-table td:last-child {
        font-size: 1.2rem;
        padding-left: 15px;
    }

    /* Кнопка */
    .lenpedia-price-expand-button {
        width: 90%;
    }
}