/**
 * ============================================================================
 * CAPACITOR FILTER - Полные стили для плагина фильтрации конденсаторов
 * ============================================================================
 * 
 * ВСЕ ЦВЕТА С !important ДЛЯ ПЕРЕОПРЕДЕЛЕНИЯ ТЕМ И ПЛАГИНОВ
 * 
 * АВТОР: Gorbunov Anton
 * ВЕРСИЯ: 3.0.2
 */

/* ============================================================================
   1. БАЗОВЫЕ СТИЛИ
   ============================================================================ */

.cotk-filter-wrapper * {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cotk-filter-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    color: #333333 !important;
    line-height: 1.6 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
    background: #ffffff !important;
}

/* ============================================================================
   2. ВЕРХНЯЯ ПАНЕЛЬ: ТИПЫ ВЫВОДОВ
   ============================================================================ */

.cotk-lead-types-section {
    margin-bottom: 30px !important;
    background: #f8f9fa !important;
    padding: 25px !important;
    border-radius: 8px !important;
    border: 1px solid #e0e0e0 !important;
}

.cotk-lead-columns {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 30px !important;
}

.cotk-lead-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
}

.cotk-lead-category {
    background: #ffffff !important;
    padding: 15px !important;
    border-radius: 6px !important;
    border: 1px solid #e0e0e0 !important;
}

.cotk-lead-category-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #122D79 !important;
    margin-bottom: 15px !important;
    padding-bottom: 8px !important;
    border-bottom: 2px solid #122D79 !important;
}

.cotk-lead-items {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.cotk-lead-item {
    padding: 10px 12px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    background: #f8f9fa !important;
    border: 1px solid #e0e0e0 !important;
}

.cotk-lead-item:hover {
    background: #f0f4ff !important;
    border-color: #667eea !important;
    transform: translateX(3px) !important;
}

.cotk-lead-item.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    border-color: #667eea !important;
}

.cotk-lead-item.link {
    background: #f8f9fa !important;
    color: #333333 !important;
}

.cotk-lead-item.inactive {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    background: #e9ecef !important;
}

.cotk-lead-label {
    font-size: 13px !important;
    line-height: 1.4 !important;
    color: #333333 !important;
}

.cotk-lead-item.current .cotk-lead-label {
    color: #ffffff !important;
}

/* ============================================================================
   3. ОСНОВНАЯ ОБЛАСТЬ
   ============================================================================ */

.cotk-main-area {
    display: grid !important;
    grid-template-columns: 320px 1fr !important;
    gap: 25px !important;
    align-items: start !important;
    width: 100% !important;
}

/* ============================================================================
   4. ЛЕВАЯ ПАНЕЛЬ: ФИЛЬТРЫ
   ============================================================================ */

.cotk-sidebar {
    background: #f0f0f0 !important;
    border-radius: 8px !important;
    padding: 20px !important;
    position: sticky !important;
    top: 20px !important;
    width: 100% !important;
    min-width: 280px !important;
    max-width: 320px !important;
}

.cotk-sidebar__title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #122D79 !important;
    margin-bottom: 20px !important;
    text-transform: uppercase !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #122D79 !important;
}

.cotk-filter-group {
    margin-bottom: 10px !important;
    background: #ffffff !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    border: 1px solid #e0e0e0 !important;
}

.cotk-filter-header {
    padding: 12px 15px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: background 0.2s ease !important;
    user-select: none !important;
}

.cotk-filter-header:hover {
    background: #f5f5f5 !important;
}

.cotk-filter-header.active {
    background: #f5f5f5 !important;
}

.cotk-filter-arrow {
    font-size: 16px !important;
    color: #666666 !important;
    transition: transform 0.3s ease !important;
    font-weight: bold !important;
}

.cotk-filter-header.active .cotk-filter-arrow {
    transform: rotate(90deg) !important;
}

.cotk-filter-title {
    flex: 1 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #333333 !important;
    text-transform: uppercase !important;
}

.cotk-filter-content {
    max-height: 300px !important;
    overflow-y: auto !important;
    transition: max-height 0.3s ease !important;
}

.cotk-filter-content.collapse {
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.control-box {
    list-style: none !important;
    padding: 10px !important;
    margin: 0 !important;
    max-height: 200px !important;
    overflow-y: auto !important;
}

.control-box li {
    padding: 6px 10px !important;
    margin: 2px 0 !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    transition: all 0.2s ease !important;
    background: #f8f9fa !important;
    color: #333333 !important;
}

.control-box li.link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
}

.control-box li.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.control-box li.disabled {
    display: none !important;
}

.control-box li.disabled:first-child:last-child {
    display: block !important;
    opacity: 0.5 !important;
    cursor: default !important;
    text-decoration: none !important;
    background: #e9ecef !important;
}

/* ============================================================================
   5. КНОПКИ УПРАВЛЕНИЯ В САЙДБАРЕ
   ============================================================================ */

.cotk-sidebar-controls {
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 2px solid #122D79 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.cotk-btn-back,
.cotk-btn-reset {
    width: 100% !important;
    padding: 10px 15px !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.cotk-btn-back {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
}

.cotk-btn-back:hover {
    opacity: 0.9 !important;
    transform: translateY(-1px) !important;
}

.cotk-btn-reset {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: #ffffff !important;
}

.cotk-btn-reset:hover {
    opacity: 0.9 !important;
    transform: translateY(-1px) !important;
}

/* ============================================================================
   6. ПРАВАЯ ПАНЕЛЬ: РЕЗУЛЬТАТЫ
   ============================================================================ */

.cotk-content {
    background: #ffffff !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 400px !important;
}

.cotk-loader {
    text-align: center !important;
    padding: 60px 20px !important;
    color: #666666 !important;
}

.cotk-loader__spinner {
    width: 40px !important;
    height: 40px !important;
    border: 3px solid #f3f3f3 !important;
    border-top: 3px solid #667eea !important;
    border-radius: 50% !important;
    animation: cotkSpin 1s linear infinite !important;
    margin: 0 auto 15px !important;
}

@keyframes cotkSpin {
    0% { transform: rotate(0deg) !important; }
    100% { transform: rotate(360deg) !important; }
}

.cotk-results-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    padding-bottom: 15px !important;
    border-bottom: 2px solid #e9ecef !important;
}

.cotk-results-count {
    font-size: 16px !important;
    color: #333333 !important;
}

.cotk-results-count strong {
    color: #667eea !important;
    font-size: 18px !important;
}

/* ============================================================================
   7. ВЫБРАННЫЕ ПАРАМЕТРЫ
   ============================================================================ */

.cotk-selected-params {
    background: #f8f9fa !important;
    padding: 15px !important;
    border-radius: 6px !important;
    margin-bottom: 25px !important;
    border: 1px solid #e0e0e0 !important;
}

.cotk-selected-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #122D79 !important;
    margin-bottom: 10px !important;
}

.cotk-selected-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.cotk-selected-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 12px !important;
    margin: 5px 0 !important;
    background: #ffffff !important;
    border-radius: 4px !important;
    border: 1px solid #e0e0e0 !important;
    transition: all 0.2s ease !important;
}

.cotk-selected-item:hover {
    border-color: #667eea !important;
    background: #f0f4ff !important;
}

.cotk-selected-text {
    font-size: 13px !important;
    color: #666666 !important;
}

.cotk-selected-text strong {
    color: #333333 !important;
    font-weight: 600 !important;
}

.cotk-selected-text span {
    color: #122D79 !important;
    font-weight: 600 !important;
}

.cotk-selected-remove {
    width: 24px !important;
    height: 24px !important;
    border: none !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
    padding: 0 !important;
}

.cotk-selected-remove:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    transform: scale(1.1) !important;
}

/* ============================================================================
   8. СЕТКА КАРТОЧЕК
   ============================================================================ */

.cotk-cards-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
}

.cotk-card {
    background: #f8f9fa !important;
    border-radius: 8px !important;
    padding: 20px !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    min-width: 0 !important;
    border: 1px solid #e0e0e0 !important;
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
}

.cotk-card:hover {
    background: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-3px) !important;
    border-color: #667eea !important;
    text-decoration: none !important;
    color: inherit !important;
}

.cotk-card__image {
    width: 100% !important;
    height: 150px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 15px !important;
    background: #ffffff !important;
    border-radius: 4px !important;
    padding: 10px !important;
}

.cotk-card__image img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

.cotk-card__name {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #122D79 !important;
    margin-bottom: 15px !important;
    line-height: 1.3 !important;
}

.cotk-card:hover .cotk-card__name {
    color: #667eea !important;
}

.cotk-card__specs {
    margin-bottom: 15px !important;
    text-align: left !important;
    background: #ffffff !important;
    padding: 12px !important;
    border-radius: 4px !important;
    border: 1px solid #e0e0e0 !important;
}

.spec-line {
    margin: 5px 0 !important;
    font-size: 13px !important;
    display: flex !important;
    justify-content: space-between !important;
}

.spec-label {
    color: #666666 !important;
}

.spec-value {
    color: #333333 !important;
    font-weight: 600 !important;
}

/* ============================================================================
   9. СООБЩЕНИЯ
   ============================================================================ */

.cotk-no-results {
    text-align: center !important;
    padding: 60px 20px !important;
    display: none !important;
}

.cotk-no-results__icon {
    font-size: 48px !important;
    margin-bottom: 15px !important;
    opacity: 0.5 !important;
}

.cotk-no-results h3 {
    font-size: 18px !important;
    color: #333333 !important;
    margin-bottom: 10px !important;
}

.cotk-no-results p {
    color: #666666 !important;
    margin-bottom: 20px !important;
}

.cotk-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
    color: #721c24 !important;
    padding: 20px !important;
    border-radius: 8px !important;
    border: 1px solid #f5c6cb !important;
    text-align: center !important;
    font-weight: 500 !important;
}

/* ============================================================================
   10. АДАПТИВНОСТЬ
   ============================================================================ */

@media (max-width: 1024px) {
    .cotk-main-area {
        grid-template-columns: 1fr !important;
    }
    
    .cotk-sidebar {
        position: relative !important;
        top: 0 !important;
        margin-bottom: 20px !important;
        max-width: 100% !important;
    }
}

@media (max-width: 900px) {
    .cotk-lead-columns {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .cotk-filter-wrapper {
        padding: 10px !important;
    }
    
    .cotk-cards-grid {
        grid-template-columns: 1fr !important;
    }
    
    .cotk-results-header {
        flex-direction: column !important;
        gap: 15px !important;
        align-items: flex-start !important;
    }
    
    .cotk-selected-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .cotk-selected-remove {
        align-self: flex-end !important;
    }
}

/* ============================================================================
   11. СКРОЛЛБАРЫ
   ============================================================================ */

.cotk-filter-content::-webkit-scrollbar,
.control-box::-webkit-scrollbar {
    width: 6px !important;
}

.cotk-filter-content::-webkit-scrollbar-track,
.control-box::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 3px !important;
}

.cotk-filter-content::-webkit-scrollbar-thumb,
.control-box::-webkit-scrollbar-thumb {
    background: #667eea !important;
    border-radius: 3px !important;
}

.cotk-filter-content::-webkit-scrollbar-thumb:hover,
.control-box::-webkit-scrollbar-thumb:hover {
    background: #5568d3 !important;
}

/* ============================================================================
   ИКОНКА РЕЕСТРА МИНПРОМТОРГА
   ============================================================================ */

.cotk-card__registry-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.cotk-card__registry-badge img {
    width: 40%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    transition: transform 0.2s ease;
}

.cotk-card__registry-badge:hover img {
    transform: scale(1.1);
}

.cotk-card {
    position: relative; /* Для позиционирования бейджа */
}

/* Адаптивность */
@media (max-width: 768px) {
    .cotk-card__registry-badge img {
        width: 30px;
        height: 30px;
    }
}


/* ============================================================================
   НОВЫЕ СТИЛИ ДЛЯ МНОЖЕСТВЕННОГО ВЫБОРА И ПОИСКА
   ============================================================================ */

/* Поиск в фильтре */
.filter-search-wrapper {
    padding: 10px !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.filter-search-input {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}

.filter-search-input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1) !important;
}

/* Список элементов фильтра */
.control-box-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: 250px !important;
    overflow-y: auto !important;
}

.filter-item {
    display: flex !important;
    align-items: center !important;
    padding: 8px 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.filter-item:last-child {
    border-bottom: none !important;
}

.filter-item:hover {
    background: #f0f4ff !important;
}

.filter-item.selected {
    background: #e8f0fe !important;
    color: #122D79 !important;
    font-weight: 500 !important;
}

.filter-item.disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    background: #f8f9fa !important;
}

.filter-checkbox {
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    margin-right: 10px !important;
    text-align: center !important;
    line-height: 20px !important;
    font-size: 14px !important;
    color: #667eea !important;
}

.filter-item.selected .filter-checkbox {
    color: #122D79 !important;
    font-weight: bold !important;
}

.filter-label {
    flex: 1 !important;
    font-size: 13px !important;
}

/* Выбранные параметры */
.cotk-selected-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 12px !important;
    margin: 5px 0 !important;
    background: #ffffff !important;
    border-radius: 4px !important;
    border: 1px solid #e0e0e0 !important;
    transition: all 0.2s ease !important;
}

.cotk-selected-item.cotk-selected-top {
    background: #f0f4ff !important;
    border-color: #667eea !important;
}

.cotk-selected-item:hover {
    border-color: #667eea !important;
    background: #f0f4ff !important;
}

.cotk-selected-text {
    font-size: 13px !important;
    color: #666666 !important;
}

.cotk-selected-text strong {
    color: #333333 !important;
    font-weight: 600 !important;
    margin-right: 5px !important;
}

.cotk-selected-text span {
    color: #122D79 !important;
    font-weight: 600 !important;
}

.cotk-selected-remove {
    width: 24px !important;
    height: 24px !important;
    border: none !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin-left: 10px !important;
}

.cotk-selected-remove:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    transform: scale(1.1) !important;
}

/* Кнопка "Назад" */
#cotk-back-btn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
}

#cotk-back-btn:hover {
    background: linear-gradient(135deg, #5a6268 0%, #545b62 100%) !important;
}

/* Счетчик выбранных */
.cotk-selected-count {
    display: inline-block !important;
    background: #667eea !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 2px 6px !important;
    border-radius: 10px !important;
    margin-left: 5px !important;
}