﻿/* ============================================
   SEARCH.CSS — поиск запчастей и результаты
   Подключать ТОЛЬКО на страницах поиска
   ============================================ */

/* ===== КОНТЕЙНЕРЫ ===== */
.search-container,
.search-results-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 30px 40px;
}

/* ===== ШАПКИ ПОИСКА ===== */
.search-header,
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

    .search-header h1,
    .results-header h1 {
        font-size: 2rem;
        font-weight: 800;
        color: #000;
        margin: 0;
    }

/* Бейдж артикула */
.articul-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #FFE733;
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #000;
    font-family: 'Montserrat', sans-serif;
}

.articul-label {
    font-weight: 600;
    color: #333;
}

.articul-value {
    font-weight: 800;
    color: #000;
    font-size: 1.1rem;
}

.btn-back-search {
    padding: 10px 20px;
    background: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
}

    .btn-back-search:hover {
        background: #000;
        color: #FFE733;
    }

/* ===== ФОРМА НАЧАЛА ПОИСКА ===== */
.search-start-card {
    background: #fff;
    border: 3px solid #000;
    border-radius: 20px;
    padding: 50px 40px;
    text-align: center;
    max-width: 800px;
    margin: 40px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

    .search-start-card h1 {
        font-size: 2.2rem;
        font-weight: 800;
        color: #000;
        margin-bottom: 15px;
    }

.search-start-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.search-start-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    display: flex;
    gap: 10px;
    border: 3px solid #000;
    border-radius: 50px;
    padding: 8px;
    background: #fff;
    transition: all 0.3s;
}

.search-start-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 15px 25px;
    font-size: 1.2rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    background: transparent;
}

.btn-search-start {
    padding: 15px 40px;
    background: #000;
    color: #FFE733;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}

    .btn-search-start:hover {
        background: #FFE733;
        color: #000;
    }

.search-start-hints {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f0;
    color: #666;
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .search-start-card {
        padding: 30px 20px;
    }

    .search-input-wrapper {
        flex-direction: column;
        border-radius: 16px;
    }

    .btn-search-start {
        border-radius: 12px;
    }
}

/* ===== СЕКЦИЯ БРЕНДОВ ===== */
.brands-section {
    background: #fff;
    border: 2px solid #000;
    border-radius: 16px;
    padding: 30px;
}

.brands-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid #FFE733;
}

    .brands-header h2 {
        font-size: 1.6rem;
        font-weight: 800;
        margin-bottom: 8px;
    }

.brands-subtitle {
    color: #666;
    font-size: 1rem;
}

.brands-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 10px 20px;
    background: #f8f8f8;
    border: 2px solid #000;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
}

    .btn-action:hover {
        background: #FFE733;
    }

.btn-search-submit {
    padding: 12px 30px;
    background: #000;
    color: #FFE733;
    border: 2px solid #000;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
    margin-left: auto;
}

    .btn-search-submit:hover {
        background: #FFE733;
        color: #000;
    }

    .btn-search-submit.btn-large {
        padding: 15px 40px;
        font-size: 1.1rem;
    }

        .btn-search-submit:disabled,
        .btn-search-submit.btn-large:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            background: #999;
            color: #fff;
        }

            .btn-search-submit:disabled:hover,
            .btn-search-submit.btn-large:disabled:hover {
                background: #999;
                color: #fff;
            }

/* Карточки брендов */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.brand-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

    .brand-card:hover {
        border-color: #000;
        background: #fff;
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .brand-card.selected {
        background: #FFFDE7 !important;
        border-color: #FFE733 !important;
    }

.brand-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #FFE733;
}

.brand-content {
    flex: 1;
    min-width: 0;
}

.brand-name {
    font-weight: 700;
    color: #000;
    font-size: 1.05rem;
    margin-bottom: 3px;
    font-family: 'Montserrat', sans-serif;
}

.brand-description {
    color: #666;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-check-icon {
    color: #FFE733;
    font-weight: 800;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.brand-checkbox:checked ~ .brand-check-icon {
    opacity: 1;
}

.brand-checkbox:checked ~ .brand-content .brand-name {
    color: #000;
}

.brand-card:has(.brand-checkbox:checked) {
    background: #FFFDE7;
    border-color: #FFE733;
}

.brands-bottom-actions {
    display: flex;
    justify-content: center;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

/* ===== LAYOUT РЕЗУЛЬТАТОВ ===== */
.results-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    width: 100%;
}

.results-main {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.new-search-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== БОКОВАЯ ПАНЕЛЬ ФИЛЬТРОВ ===== */
.filters-sidebar {
    width: 300px;
    max-height: calc(100vh - 40px);
    position: sticky;
    top: 20px;
    overflow-y: auto;
    padding-right: 8px;
}

    .filters-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .filters-sidebar::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }

    .filters-sidebar::-webkit-scrollbar-thumb {
        background: #000;
        border-radius: 3px;
    }

        .filters-sidebar::-webkit-scrollbar-thumb:hover {
            background: #FFE733;
        }

.filters-block {
    background: #fff;
    border: 2px solid #000;
    border-radius: 12px;
    padding: 20px;
}

    .filters-block h3 {
        font-size: 1.1rem;
        font-weight: 800;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 2px solid #FFE733;
    }

.filters-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.btn-filter-action {
    width: 100%;
    flex: 1;
    padding: 8px 16px;
    background: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

    .btn-filter-action:hover {
        background: #FFE733;
    }

.filters-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 5px;
}

    .filters-list::-webkit-scrollbar {
        width: 6px;
    }

    .filters-list::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .filters-list::-webkit-scrollbar-thumb {
        background: #000;
        border-radius: 3px;
    }

        .filters-list::-webkit-scrollbar-thumb:hover {
            background: #FFE733;
        }

.filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f8f8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.7rem;
}

    .filter-item:hover {
        background: #FFFDE7;
    }

    .filter-item.original {
        border-left: 3px solid #FFE733;
    }

    .filter-item input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: #FFE733;
    }

.filter-name {
    flex: 1;
    font-weight: 600;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-price {
    color: #666;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-apply-filter {
    width: 100%;
    padding: 10px 16px;
    background: #000;
    color: #FFE733;
    border: 2px solid #000;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

    .btn-apply-filter:hover {
        background: #FFE733;
        color: #000;
    }

/* Кнопка сортировки (только эта — остальные sort-* мёртвые) */
.btn-sort {
    width: 100%;
    padding: 10px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif;
}

    .btn-sort:hover {
        background: #FFE733;
    }

/* ===== ФИЛЬТР ПО ЦЕНЕ ===== */
.price-filter {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.price-input-group {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
}

    .price-input-group label {
        min-width: 35px;
        font-weight: 600;
        color: #000;
        font-size: 15px;
        flex-shrink: 0;
    }

.price-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #000;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

    .price-input:focus {
        outline: none;
        border-color: #FFE733;
        box-shadow: 0 0 0 3px rgba(255, 232, 31, 0.3);
    }

    .price-input::placeholder {
        color: #999;
        font-style: italic;
        font-size: 14px;
    }

/* ===== ШАПКА ТАБЛИЦЫ РЕЗУЛЬТАТОВ (STICKY) ===== */
.resultHeader.sticky-header {
    position: sticky;
    top: 80px;
    z-index: 100;
    display: grid;
    grid-template-columns: 70px 30px 100px 110px 120px 110px;
    gap: 0;
    background: #000;
    color: #FFE733;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid #000;
    height: 50px;
    align-items: center;
}

    .resultHeader.sticky-header span {
        display: flex;
        align-items: center;
        height: 100%;
    }

/* Колонки grid */
.col-qty {
    grid-column: 1;
    justify-content: center;
    padding-left: 10px;
}

.col-return {
    grid-column: 2;
}

.col-percent {
    grid-column: 3;
    justify-content: center;
}

.col-delivery {
    grid-column: 4;
    justify-content: center;
}

.col-price {
    grid-column: 5;
    justify-content: flex-end;
    padding-right: 10px;
}

.col-actions {
    grid-column: 6;
    justify-content: center;
}

/* ===== БЛОКИ БРЕНДОВ В РЕЗУЛЬТАТАХ ===== */
.dataBlock {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: visible;
    transition: box-shadow 0.3s;
}

    .dataBlock:hover {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
        border-color: #000;
    }

.brand-header-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 15px;
    padding: 18px 20px;
    background: #f8f8f8;
    border-bottom: 2px solid #FFE733;
    border-radius: 10px 10px 0 0;
}

.d-brand {
    font-weight: 800;
    color: #000;
    font-size: 1.1rem;
    font-family: 'Montserrat', sans-serif;
}

.d-articul {
    font-family: monospace;
    color: #666;
    font-size: 0.85rem;
    margin-top: 3px;
    background: #fff;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.d_name {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

/* ===== ТАБЛИЦЫ ПОЗИЦИЙ ===== */
.visibleItems,
.hiddenItems {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

    .visibleItems td,
    .hiddenItems td {
        padding: 14px 10px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.9rem;
        vertical-align: middle;
    }

        .visibleItems td:nth-child(1),
        .hiddenItems td:nth-child(1) {
            width: 70px;
            text-align: center;
        }

        .visibleItems td:nth-child(2),
        .hiddenItems td:nth-child(2) {
            width: 30px;
            text-align: center;
        }

        .visibleItems td:nth-child(3),
        .hiddenItems td:nth-child(3) {
            width: 100px;
            text-align: center;
        }

        .visibleItems td:nth-child(4),
        .hiddenItems td:nth-child(4) {
            width: 110px;
            text-align: center;
        }

        .visibleItems td:nth-child(5),
        .hiddenItems td:nth-child(5) {
            width: 120px;
            text-align: right;
            padding-right: 15px;
        }

        .visibleItems td:nth-child(6),
        .hiddenItems td:nth-child(6) {
            width: 110px;
            text-align: center;
        }

    .visibleItems tr,
    .hiddenItems tr {
        transition: all 0.2s ease;
        background-color: #fff !important;
    }

        .visibleItems tr:hover,
        .hiddenItems tr:hover {
            background-color: #FFFDE7 !important;
            transform: translateX(2px);
        }

/* ===== ЯЧЕЙКИ ТАБЛИЦ ===== */
.td-quantity {
    font-weight: 700;
    color: #4CAF50;
    text-align: center;
    width: 70px;
    font-size: 0.95rem;
}

.td-ret {
    width: 30px;
    text-align: center;
}

    .td-ret.allow-return {
        color: #d32f2f;
        font-size: 1.1rem;
    }

.td-percent {
    color: #666;
    font-size: 0.85rem;
    width: 100px;
    text-align: center;
}

.td-delivery {
    width: 110px;
    text-align: center;
}

.deliveryS {
    font-weight: 600;
    color: #000;
    font-size: 0.9rem;
}

.delivery-today {
    display: inline-block;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: #2E7D32;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid #A5D6A7;
}

.td-price {
    width: 120px;
    text-align: right;
}

.salePrice {
    font-weight: 800;
    color: #000;
    font-size: 1.05rem;
    font-family: 'Montserrat', sans-serif;
}

.whName {
    font-size: 0.75rem;
    color: #999;
    margin-top: 2px;
}

.td-select {
    width: 60px;
    text-align: center;
}

/* ===== КНОПКИ ДЕЙСТВИЙ В ТАБЛИЦЕ ===== */
.td-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.actions-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-addtocart,
.btn-addtofavorite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1rem;
    cursor: pointer;
}

.btn-addtocart {
    background: #000;
    color: #FFE733;
}

    .btn-addtocart:hover {
        background: #FFE733;
        color: #000;
        transform: scale(1.1);
    }

.btn-addtofavorite {
    background: #f8f8f8;
    color: #999;
    border: 1px solid #e0e0e0;
}

    .btn-addtofavorite:hover {
        background: #FFFDE7;
        color: #FFE733;
        border-color: #FFE733;
    }

/* ===== ЗАГОЛОВКИ СЕКЦИЙ (оригиналы/аналоги) ===== */
.section-title {
    padding: 14px 20px;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 10px;
    margin-bottom: 15px;
    font-family: 'Montserrat', sans-serif;
}

.original-title {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    background: #FFE733 !important;
    color: #000 !important;
    border-left: 5px solid #000 !important;
    padding: 16px 20px !important;
    font-size: 28px !important;
    font-weight: 800 !important;
    margin: 20px 0 !important;
    line-height: 1.2 !important;
    text-align: left !important;
    justify-content: flex-start !important;
    border-radius: 8px !important;
}

    .original-title .fa-check,
    .original-title i,
    .original-title svg {
        font-size: 28px !important;
        margin: 0 !important;
        color: #000 !important;
        flex-shrink: 0 !important;
    }

.analog-title {
    background: #FFE733;
    color: #000;
    border-left: 5px solid #000;
}

.remarkAnalog {
    padding: 12px 18px;
    background: #FFFDE7;
    color: #666;
    font-size: 0.85rem;
    border-radius: 8px;
    margin-bottom: 20px;
    line-height: 1.5;
    border-left: 3px solid #FFE733;
}

.analogLabel {
    padding: 12px 20px;
    background: #f8f8f8;
    font-weight: 700;
    color: #000;
    border-left: 4px solid #FFE733;
    margin-bottom: 15px;
}

.minMaxValues {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.85rem;
    margin: 0 3px;
}

/* Порядок отображения */
.originalItems {
    order: 1;
    margin-bottom: 30px;
}

.analogItems {
    order: 2;
}

.originalItems,
.analogItems {
    width: 100%;
}

/* ===== КНОПКИ "ЕЩЁ" / "УБРАТЬ" (STICKY) ===== */
.moreItems {
    position: sticky;
    top: 140px;
    z-index: 50;
    padding: 10px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid #FFE733;
    margin: 0;
}

.more-link {
    color: #000;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 20px;
    border: 2px solid #000;
    border-radius: 20px;
    display: inline-block;
    transition: all 0.3s;
    font-size: 0.85rem;
    font-family: 'Montserrat', sans-serif;
    background: #fff;
}

    .more-link:hover {
        background: #FFE733;
        border-color: #FFE733;
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

/* ===== КНОПКА "ЗАГРУЗИТЬ ЕЩЁ" ===== */
.load-more-container {
    text-align: center;
    padding: 30px 20px;
    margin-top: 20px;
}

.btn-load-more {
    padding: 15px 40px;
    background: #000;
    color: #FFE733;
    border: 2px solid #000;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
}

    .btn-load-more:hover {
        background: #FFE733;
        color: #000;
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }

/* ===== ПРАВЫЙ ФИЛЬТР (td_rp2/td_rp3) ===== */
.td_rp2 {
    font-weight: 600;
    color: #000;
}

.td_rp3 {
    text-align: right;
    font-weight: 700;
    color: #666;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    .results-layout {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: static;
        order: -1;
    }

    .resultHeader.sticky-header {
        top: 70px;
        font-size: 0.75rem;
        padding: 10px 12px;
        grid-template-columns: 150px 1fr 60px 25px 80px 90px 100px 80px;
        gap: 5px;
    }

    .moreItems {
        top: 120px;
    }
}

@media (max-width: 768px) {
    .resultHeader.sticky-header {
        display: none;
    }

    .brand-header-row {
        grid-template-columns: 1fr;
    }

    .visibleItems td,
    .hiddenItems td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }

    .brands-grid {
        grid-template-columns: 1fr;
    }
}
