/* Кастомный брейкпоинт для 1010px */
@media (max-width: 999px) {
    .hide-below-1010 {
        display: none !important;
    }
    .show-below-1010 {
        display: block !important;
    }
}
@media (min-width: 1000px) {
    .hide-above-1010 {
        display: none !important;
    }
    .show-above-1010 {
        display: block !important;
    }
}

/* ========== СТИЛИ ДЛЯ ПОИСКА С АВТОДОПОЛНЕНИЕМ ========== */

/* Стили для автодополнения поиска */
.search-autocomplete-container {
    position: relative;
    width: 100%;
}

.search-autocomplete-container .input-group {
    position: relative;
}

/* Dropdown меню для результатов поиска - ЗАКРЕПЛЕНО СО СТРОКОЙ ПОИСКА */
.autocomplete-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1060 !important;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px !important;
    width: 100% !important;
}

/* Заголовки секций */
.autocomplete-dropdown .dropdown-header,
.autocomplete-dropdown .section-header {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    color: #6c757d;
}

/* Разделители */
.autocomplete-dropdown .dropdown-divider {
    margin: 0;
}

/* Элементы результатов */
.autocomplete-dropdown .autocomplete-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #212529;
    text-decoration: none;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.autocomplete-dropdown .autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-dropdown .autocomplete-item:hover {
    background-color: #f8f9fa !important;
    text-decoration: none;
}

.autocomplete-dropdown .autocomplete-item.active {
    background-color: #e7f1ff !important;
}

/* ========== АДАПТИВНЫЕ СТИЛИ ДЛЯ МОБИЛЬНЫХ ========== */
@media (max-width: 999px) {
    .autocomplete-dropdown {
        /* УБИРАЕМ fixed - теперь absolute как и на десктопе */
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        top: 100% !important;
        bottom: auto !important;
        width: 100% !important;
        max-height: 50vh !important;
        margin-top: 4px !important;
    }
    
    @media (max-width: 576px) {
        .autocomplete-dropdown {
            margin-top: 3px !important;
        }
    }
}

/* Анимация */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.autocomplete-dropdown {
    animation: fadeIn 0.2s ease-out;
}

/* ========== СТИЛИ ДЛЯ ПЛАШЕК СЕРВИСОВ ========== */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important;
}

.service-content {
    overflow: hidden;
}

.service-content h5 {
    font-size: 1rem;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.service-content .text-muted {
    font-size: 0.8rem;
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2; /* Добавлено стандартное свойство */
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-icon i {
    font-size: 1.5rem;
}

@media (max-width: 575.98px) {
    .service-content h5 {
        font-size: 0.9rem;
    }
    .service-content .text-muted {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
        line-clamp: 1; /* Добавлено стандартное свойство */
    }
    .service-icon i {
        font-size: 1.2rem;
    }
    .service-icon {
        padding: 0.75rem !important;
    }
    .service-content {
        padding: 0.75rem !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .service-content h5 {
        font-size: 0.9rem;
    }
    .service-content .text-muted {
        font-size: 0.75rem;
    }
    .service-icon i {
        font-size: 1.4rem;
    }
}

@media (min-width: 1200px) {
    .service-content h5 {
        font-size: 1.1rem;
    }
    .service-content .text-muted {
        font-size: 0.85rem;
    }
    .service-icon i {
        font-size: 1.75rem;
    }
}

/* ========== РАСШИРЕННАЯ ПАЛИТРА ЦВЕТОВ ========== */
:root {
    --bs-custom-1: #4361ee;
    --bs-custom-1-rgb: 67, 97, 238;
    --bs-custom-2: #2a9d8f;
    --bs-custom-2-rgb: 42, 157, 143;
    --bs-custom-3: #e9c46a;
    --bs-custom-3-rgb: 233, 196, 106;
    --bs-custom-4: #f4a261;
    --bs-custom-4-rgb: 244, 162, 97;
    --bs-custom-5: #e76f51;
    --bs-custom-5-rgb: 231, 111, 81;
    --bs-custom-6: #9d4edd;
    --bs-custom-6-rgb: 157, 78, 221;
    --bs-custom-7: #43aa8b;
    --bs-custom-7-rgb: 67, 170, 139;
    --bs-custom-8: #ff6b6b;
    --bs-custom-8-rgb: 255, 107, 107;
    --bs-custom-9: #6c5ce7;
    --bs-custom-9-rgb: 108, 92, 231;
    --bs-custom-10: #00b894;
    --bs-custom-10-rgb: 0, 184, 148;
    --bs-custom-11: #fd79a8;
    --bs-custom-11-rgb: 253, 121, 168;
    --bs-custom-12: #e17055;
    --bs-custom-12-rgb: 225, 112, 85;
}

.bg-custom-1 { background-color: rgba(var(--bs-custom-1-rgb), 0.1) !important; border-left-color: var(--bs-custom-1) !important; }
.bg-custom-2 { background-color: rgba(var(--bs-custom-2-rgb), 0.1) !important; border-left-color: var(--bs-custom-2) !important; }
.bg-custom-3 { background-color: rgba(var(--bs-custom-3-rgb), 0.1) !important; border-left-color: var(--bs-custom-3) !important; }
.bg-custom-4 { background-color: rgba(var(--bs-custom-4-rgb), 0.1) !important; border-left-color: var(--bs-custom-4) !important; }
.bg-custom-5 { background-color: rgba(var(--bs-custom-5-rgb), 0.1) !important; border-left-color: var(--bs-custom-5) !important; }
.bg-custom-6 { background-color: rgba(var(--bs-custom-6-rgb), 0.1) !important; border-left-color: var(--bs-custom-6) !important; }
.bg-custom-7 { background-color: rgba(var(--bs-custom-7-rgb), 0.1) !important; border-left-color: var(--bs-custom-7) !important; }
.bg-custom-8 { background-color: rgba(var(--bs-custom-8-rgb), 0.1) !important; border-left-color: var(--bs-custom-8) !important; }
.bg-custom-9 { background-color: rgba(var(--bs-custom-9-rgb), 0.1) !important; border-left-color: var(--bs-custom-9) !important; }
.bg-custom-10 { background-color: rgba(var(--bs-custom-10-rgb), 0.1) !important; border-left-color: var(--bs-custom-10) !important; }
.bg-custom-11 { background-color: rgba(var(--bs-custom-11-rgb), 0.1) !important; border-left-color: var(--bs-custom-11) !important; }
.bg-custom-12 { background-color: rgba(var(--bs-custom-12-rgb), 0.1) !important; border-left-color: var(--bs-custom-12) !important; }

.text-custom-1 { color: var(--bs-custom-1) !important; }
.text-custom-2 { color: var(--bs-custom-2) !important; }
.text-custom-3 { color: var(--bs-custom-3) !important; }
.text-custom-4 { color: var(--bs-custom-4) !important; }
.text-custom-5 { color: var(--bs-custom-5) !important; }
.text-custom-6 { color: var(--bs-custom-6) !important; }
.text-custom-7 { color: var(--bs-custom-7) !important; }
.text-custom-8 { color: var(--bs-custom-8) !important; }
.text-custom-9 { color: var(--bs-custom-9) !important; }
.text-custom-10 { color: var(--bs-custom-10) !important; }
.text-custom-11 { color: var(--bs-custom-11) !important; }
.text-custom-12 { color: var(--bs-custom-12) !important; }

/* Стили для отображения результатов */
.autocomplete-item .item-content {
    display: flex;
    align-items: center;
}

.autocomplete-item .item-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    color: #6c757d;
    min-width: 24px;
}

.autocomplete-item .item-text {
    flex: 1;
    min-width: 0;
}

.autocomplete-item .item-title {
    font-weight: 500;
    margin-bottom: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-item .item-meta {
    font-size: 0.875rem;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-item .item-badge {
    margin-left: 0.5rem;
    font-size: 0.75rem;
}

/* Стили для изображений в результатах */
.autocomplete-item .item-image {
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
    border-radius: 0.25rem;
    object-fit: cover;
    flex-shrink: 0;
}

.autocomplete-item .item-image-placeholder {
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    flex-shrink: 0;
}

/* Стили для иконок радиостанций */
.autocomplete-item .radio-icon {
    color: #0d6efd;
    background-color: #e7f1ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Стили для иконок телеканалов */
.autocomplete-item .tv-icon {
    color: #dc3545;
    background-color: #ffe6e6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Футер с кнопкой "Показать все" */
.autocomplete-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.autocomplete-footer .autocomplete-item {
    text-align: center;
    color: #0d6efd;
    font-weight: 500;
}

/* Отступы для мобильной версии */
@media (max-width: 768px) {
    .search-autocomplete-container {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    
    #mobileSearchInput {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    .input-group {
        margin-bottom: 0 !important;
    }
}