/* ==========================================================================
   RHL Light Compare – Simple Panel
   Тема: BLOCKY – чистый, оптимизированный, модульный CSS
   Версия: 2.0
   ========================================================================== */

:root {
    /* Цветовая схема (без изменений) */
    --primary: #0055ff;
    --primary-dark: #0044cc;
    --success: #34c759;
    --success-dark: #2ab04a;
    --danger: #ff3b30;
    --danger-dark: #e6352b;
    --warning: #ff9500;
    
    /* Нейтральные */
    --text-main: #1d1d1f;
    --text-sub: #424245;
    --border: #d2d2d7;
    --bg-light: #f5f5f7;
    --bg-white: #ffffff;
    
    /* Тени и скругления */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 85, 255, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Анимация */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
}



/* ==========================================================================
   3. КНОПКИ СРАВНЕНИЯ (на карточках товаров)
   ========================================================================== */
.rhl-simple-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px; /* Чуть больше места для солидности */
    background: #ffffff; /* Белая кнопка — классика для второстепенных действий */
    color: #475569; /* Спокойный серый текст (Slate 600) */
    border: 1px solid #e2e8f0; /* Легкая рамка */
    border-radius: 6px; /* Строгое B2B скругление, как во всей системе */
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* Едва заметная тень */
    line-height: 1;
    white-space: nowrap;
}

.rhl-simple-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a; /* Темный текст при наведении */
    transform: none; /* Убираем "всплывание" */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.rhl-simple-btn:active {
    background: #f1f5f9;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); /* Эффект нажатия внутрь */
}

.rhl-simple-btn.in-compare {
    background: #eff6ff; /* Тонкий синий фон */
    color: #1d4ed8;      /* Синий текст */
    border-color: #bfdbfe;
    box-shadow: none;
}
.rhl-simple-btn.in-compare:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}
.rhl-simple-btn::before {
    content: '+';
    font-size: 16px;
    font-weight: 400; /* Тоньше */
    color: #94a3b8; /* Серый плюс */
    transition: all 0.2s ease;
}

.rhl-simple-btn.in-compare::before {
    content: '✓';
    color: #3b82f6; /* Синяя галочка */
    font-weight: 600;
}

.rhl-simple-btn:hover::before {
    transform: none; /* Убираем увеличение иконки */
    color: inherit; /* Иконка принимает цвет текста при ховере */
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .rhl-simple-btn {
        padding: 10px 18px;
        font-size: 13px;
        border-radius: 6px; /* Сохраняем строгость и на мобильных */
    }
}
/* ==========================================================================
   4. УВЕДОМЛЕНИЯ – СОВРЕМЕННЫЙ СТЕК
   ========================================================================== */
.rhl-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 340px;
    max-width: calc(100% - 48px);
    padding: 16px 20px;
    background: var(--bg-white);
    color: var(--text-main);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 10000;
    border-left: 4px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: translateX(120%);
    opacity: 0;
    transition: transform var(--transition-base), opacity var(--transition-fast);
    pointer-events: auto;
}

.rhl-notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Типы уведомлений */
.rhl-notification.success {
    background: #e7f6e7;
    border-left-color: var(--success);
    color: #1d5e2c;
}

.rhl-notification.error {
    background: #ffeae9;
    border-left-color: var(--danger);
    color: #8b1e1e;
}

.rhl-notification.warning {
    background: #fff3e0;
    border-left-color: var(--warning);
    color: #8a4e0e;
}

.rhl-notification.info {
    background: var(--bg-light);
    border-left-color: var(--primary);
    color: var(--text-main);
}

/* Иконка (задаётся через data-атрибут или content) */
.rhl-notification-icon {
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
}

/* Контент */
.rhl-notification-content {
    flex: 1;
}

.rhl-notification-title {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 0.9375rem;
}

.rhl-notification-message {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    opacity: 0.9;
}

/* Кнопка закрытия */
.rhl-notification-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: currentColor;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity var(--transition-fast), background var(--transition-fast);
}

.rhl-notification-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.04);
}

/* Прогресс-бар */
.rhl-notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    transform: scaleX(1);
    transform-origin: left;
    transition: transform 0.1s linear;
}

/* Стек уведомлений – позиционирование через JS (лучше, чем nth-child) */
.rhl-notification {
    will-change: transform, opacity;
}
/* 3. Кнопка сравнения (делаем её невидимой, пока не наведешь) */
.rhl-simple-btn {
    background: none !important;
    border: none !important;
    color: #64748b !important;
    font-size: 13px !important;
    text-decoration: underline !important;
    padding: 0 !important;
    cursor: pointer;
}
.rhl-simple-btn:hover { color: #3b82f6 !important; }

/* 4. Инструмент сопоставления (делаем его строгим) */
.b2b-matching-box {
    border-top: 1px solid #e2e8f0 !important;
    padding-top: 20px !important;
}

/* Финальный лоск для таблицы */
.rhl-professional-comparison {
    --b2b-blue: #3b82f6;
    --b2b-slate: #64748b;
    --b2b-dark: #0f172a;
    font-family: inherit;
}

.rhl-comparison-table {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.rhl-header-product {
    padding: 20px;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.rhl-parameter-row {
    transition: background 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

.rhl-parameter-row:hover {
    background: #fcfdfe;
}

.rhl-param-name {
    font-weight: 600;
    color: var(--b2b-slate);
    background: #fcfdfe;
    width: 250px;
}

/* Скрытая панель в футере (Bottom Bar) */
.rhl-compare-bar {
    position: fixed;
    bottom: -100px;
    left: 0; right: 0;
    background: var(--b2b-dark);
    color: #fff;
    padding: 15px 0;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

.rhl-compare-bar.active { bottom: 0; }

.rhl-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}/* Контейнер кнопок в панели */
.rhl-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Общий стиль для кнопок бара */
.rhl-bar-link, .rhl-bar-clear {
    font-family: inherit;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Кнопка "ОТКРЫТЬ ТАБЛИЦУ" (Главная) */
.rhl-bar-link {
    background-color: #3b82f6 !important; /* Твой синий */
    color: #ffffff !important;
    border: 1px solid #3b82f6 !important;
}

.rhl-bar-link:hover {
    background-color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Кнопка "ОЧИСТИТЬ" (Второстепенная) */
.rhl-bar-clear {
    background-color: transparent !important;
    color: #94a3b8 !important; /* Slate 400 */
    border: 1px solid #334155 !important; /* Slate 700 */
}

.rhl-bar-clear:hover {
    color: #f8fafc !important;
    border-color: #64748b !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}.rhl-bar-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f8fafc;
}

.rhl-bar-icon {
    font-size: 18px;
    color: #3b82f6;
}

.rhl-bar-label {
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
}

.rhl-bar-count {
    background: #3b82f6;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
}

/* Плавное появление бара */
.rhl-compare-bar {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.rhl-compare-bar.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* ==========================================================================
   5. АДАПТИВНОСТЬ
   ========================================================================== */
@media (max-width: 768px) {
    /* Корректируем наш новый нижний бар для мобилок */
    .rhl-compare-bar {
        padding: 10px 0;
    }
    .rhl-bar-container {
        flex-direction: column; /* На очень узких экранах инфо и кнопки в два ряда */
        gap: 10px;
    }
    
    /* Твои уведомления для мобилок — оставляем, они супер */
    .rhl-notification {
        top: 10px;
        right: 10px;
        left: 10px;
    }
}

@media (max-width: 480px) {
    #rhl-panel-toggle {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
    }

    .rhl-panel-item {
        padding: 10px;
    }

    .rhl-panel-image {
        width: 48px;
        height: 48px;
    }
}

/* ==========================================================================
   6. PREFERS-REDUCED-MOTION – доступность
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01s !important;
        animation-duration: 0.01s !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }

    .rhl-notification-progress {
        display: none !important;
    }
}