/* =============================================
   style-modern.css — основной стиль сайта ЗЕВС
   ============================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #222;
    background: #fff;
}

/* =============================================
   Layout
   ============================================= */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================
   Header
   ============================================= */

.header {
    background: #0000FF;
    color: #fff;
    padding: 25px 0;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.logo img {
    max-height: 198px;
    width: auto;
}

.header-title {
    flex: 1;
    text-align: center;
    line-height: 1.2;
}

.brutal {
    font-family: 'Russo One', sans-serif;
    font-size: 2.8rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    text-shadow: 6px 6px 12px rgba(0, 0, 0, 0.9);
}

.dancing {
    font-family: 'Marck Script', cursive;
    font-size: 1.85rem;
    display: block;
    animation: sway 5s infinite ease-in-out;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header-video video {
    max-width: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    display: block;
}

/* =============================================
   Navigation
   ============================================= */

.nav {
    background: #0000FF;
    padding: 16px 0;
}

.nav .container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.nav a {
    color: #fff;
    text-decoration: none;
    padding: 10px 22px;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* =============================================
   Main Content
   ============================================= */

.main {
    padding: 50px 0;
}

.hero {
    display: flex;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
}

.hero-image {
    max-width: 420px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: fadeIn 1.2s ease forwards;
}

.hero-text {
    flex: 1;
    min-width: 300px;
}

.description {
    font-family: Georgia, serif;
    font-size: 1.15rem;
    color: #001f5c;
    line-height: 1.7;
}

/* =============================================
   Animations
   ============================================= */

@keyframes sway {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    25%      { transform: rotate(3deg) translateY(-6px); }
    50%      { transform: rotate(0deg) translateY(0); }
    75%      { transform: rotate(-3deg) translateY(-6px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 992px) {
    .hero {
        gap: 30px;
        justify-content: center;
        text-align: center;
    }
    
    .hero-image {
        max-width: 340px;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .brutal { font-size: 2.25rem; letter-spacing: 4px; }
    .dancing { font-size: 1.55rem; }
    
    .header-video video {
        max-width: 100%;
    }
    
    .nav a {
        padding: 12px 18px;
        font-size: 1.05rem;
    }
    
    .hero-text {
        min-width: 100%;
    }
}

/* =============================================
   Адаптив для страницы operator.php
   ============================================= */

.operator-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ==================== ДЕСКТОП (ПК) ==================== */
@media (min-width: 1200px) {
    .operator-row {
        flex-wrap: nowrap !important;           /* горизонтальная линия */
    }
    
    .operator-row > div {
        flex: 1 1 20%;                          /* 5 равных колонок */
        min-width: 0;
    }
    
    /* Блок фильтров тоже участвует в горизонтальной раскладке */
    .operator-row .filter-block {
        flex: 1 1 20% !important;
    }
}

/* ==================== ПЛАНШЕТЫ ==================== */
@media (max-width: 1199px) and (min-width: 768px) {
    .operator-row > div {
        flex: 1 1 48%;          /* 2 колонки на планшете */
    }
    
    .operator-row .filter-block {
        flex: 1 1 100% !important;   /* фильтры на всю ширину */
        order: 6;                    /* всегда внизу */
    }
}

/* Общие стили для селектов */
.select-list {
    height: 520px;                    /* базовая высота для ПК */
    min-height: 44px;                 /* минимальная высота на всех устройствах */
}

/* На очень больших экранах */
@media (min-width: 1400px) {
    .select-list {
        height: 624px !important;
    }
}

/* ==================== СМАРТФОНЫ И ПЛАНШЕТЫ ==================== */
@media (max-width: 991px) {
    .operator-row {
        flex-direction: column;     
    }
    
    .operator-row > div {
        flex: 1 1 100%;             
    }
    
    /* Блок фильтров всегда последний */
    .operator-row .filter-block {
        order: 6;
        margin-top: 1rem;
    }

    /* На мобильных высота полностью управляется JavaScript */
    .select-list {
        height: auto !important;
        min-height: 44px;
        max-height: 420px;           /* ограничение сверху, чтобы не растягивался на весь экран */
    }
}

/* Дополнительно для очень маленьких экранов (iPhone SE и т.п.) */
@media (max-width: 767px) {
    .select-list {
        max-height: 360px;           /* чуть меньше на узких экранах */
    }
}

/* Глобальные бледные подсказки (placeholder) — для всех полей ввода */
::placeholder {
    color: #999999 !important;
    opacity: 1 !important;
}

:-ms-input-placeholder {
    color: #999999 !important;
}

::-ms-input-placeholder {
    color: #999999 !important;
}

/* Дополнительно для лучшей совместимости */
input::placeholder,
textarea::placeholder,
select::placeholder {
    color: #999999 !important;
}

/* Единый блок: поле поиска + кнопка лупы */
.input-group.input-group-lg {
    border-radius: 0.375rem;
    position: relative !important;
    overflow: visible;
    z-index: 10;
}

.input-group-lg .form-control#search_full {
    border: 2px solid #ced4da;
    border-right: none;
    border-radius: 0;
    background-color: #ffffff;
    height: 50px;
    transition: border-color 0.25s ease;
}

.input-group-lg .form-control#search_full.search-highlight {
    border-color: #28a745 !important;
}

/* Кнопка поиска */
#search_btn {
    border: 2px solid #ced4da;
    border-left: none;
    border-radius: 0;
    background-color: #ffffff;
    height: 50px;
    width: 52px;
    padding: 0;
    transition: background-color 0.25s ease;
}

/* Зелёная подсветка для всего блока целиком */
#search_full.search-highlight,
#search_full.search-highlight + #search_btn {
    border-color: #28a745 !important;
}

/* Внешняя подсветка (box-shadow) только вокруг всего блока */
.input-group-lg:has(.search-highlight) {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Синяя подсветка при фокусе на всём блоке */
.input-group-lg:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.input-group-lg:focus-within #search_full,
.input-group-lg:focus-within #search_btn {
    border-color: #86b7fe;
}

/* Hover для кнопки */
#search_btn:hover {
    background-color: #f8f9fa;
}


/* Ленточки в колонке "Наименование" */
.ribbon {
    position: absolute;
    top: 6px;
    right: -35px;
    z-index: 5;
    font-size: 9.6px;
    font-weight: 700;
    padding: 3.5px 13px 3.5px 10px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.28);
    white-space: nowrap;
    line-height: 1.05;
    transform: rotate(37deg) translateX(26px);
    transform-origin: center;
}

.ribbon.has-stock {
    background: rgba(40, 167, 69, 0.92);
}

.ribbon.archive {
    background: rgba(173, 120, 70, 0.92);
}

.ribbon.price-on-order-unavailable {
    background: rgba(108, 117, 125, 0.92);
}


/* Мобильные карточки (оставляем как было) */
.card-price.has-stock::after,
.card-price.archive::after {
    /* ... существующий код для карточек ... */
}

.pagination-modern {
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-modern .page-link {
    min-width: 40px;
    text-align: center;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #0d6efd;
    background-color: #fff;
}

.pagination-modern .page-item.active .page-link {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
    font-weight: 600;
}

.pagination-modern .page-item.disabled .page-link {
    color: #6c757d;
    cursor: not-allowed;
}

/* =============================================
   Стиль для товаров на заказ, которые сейчас недоступны для резерва
   ============================================= */

.price-on-order-unavailable {
    background-color: #f8f9fa !important;   /* лёгкий серый фон */
    color: #6c757d !important;
}

.price-on-order-unavailable .text-muted {
    color: #6c757d !important;
    font-weight: normal;
}

/* На мобильных карточках тоже применяем */
.card-price.price-on-order-unavailable {
    background-color: #f8f9fa !important;
}

.card-price.price-on-order-unavailable span {
    color: #6c757d !important;
}

/* =============================================
   Ограничение ширины основного контента 
   (operator.php и rows.php)
   ============================================= */

.container-fluid {
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Для страниц operator и rows делаем более жёсткое ограничение */
.operator-page .container-fluid,
.rows-page .container-fluid {
    max-width: 1920px;
}

/* Центрирование основного контента */
main .container-fluid {
    max-width: 1920px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Если нужно чуть уже (рекомендую 1800-1900px для комфортного вида) */
@media (min-width: 1200px) {
    .container-fluid {
        max-width: 1850px;   /* можно поставить 1800px или 1900px по вкусу */
    }
}

/* Мигание красной рамкой — дважды */
.search-suggestions.flash-red-border {
    border: 3px solid #dc3545 !important;
    box-shadow: 0 0 0 8px rgba(220, 53, 69, 0.6);
    transition: all 0.2s ease;
}

select.flash-red-border,
.form-select.flash-red-border {
    border: 3px solid #dc3545 !important;
    box-shadow: 0 0 0 8px rgba(220, 53, 69, 0.6) !important;
    transition: all 0.2s ease;
}

@keyframes flashRed {
    0%, 100% { 
        box-shadow: 0 0 0 6px rgba(220, 53, 69, 0.4); 
    }
    50% { 
        box-shadow: 0 0 0 12px rgba(220, 53, 69, 0.8); 
    }
}

/* ====================== ОКНО ПОДСКАЗОК — ПОВЕРХ ВСЕГО ====================== */
.search-suggestions {
    position: fixed !important;
    z-index: 99999 !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.search-suggestions .close-suggestions {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: 2px solid #dc3545;
    color: #dc3545;
    font-size: 18px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 10;
    transition: all 0.2s ease;
}

.search-suggestions .close-suggestions:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

/* Чтобы крестик не мешал кликам по ссылкам подсказок */
.search-suggestions .close-suggestions {
    pointer-events: auto;
}

/* Мобильные фильтры */
.collapse-chevron {
    transition: transform 0.3s ease;
}
[data-bs-toggle="collapse"][aria-expanded="true"] .collapse-chevron {
    transform: rotate(180deg);
}

/* Чуть больше воздуха между блоком и кнопкой */
#filters-collapse {
    margin-bottom: 8px;
}