/* =====================================================================
   Поиск по каталогу — редизайн, фирменный стиль Цветомании
   Брендбук: #A11826 (основной), #F13A5F (акцент), Tilda Sans
   ===================================================================== */

/* Сохраняем старый селектор, чтобы не сломать сайт, где он уже используется */
.page_content .search-page { display: none; }
.all_search_result {
    text-align: center;
    padding: 0;
    font-size: 15px;
    text-decoration: underline;
}

/* --- Контейнер --- */
.tsv-search {
    font-family: 'Tilda Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: #1a1a1a;
    margin: 0 auto 32px;
    max-width: 880px;
    padding: 0 12px;
    box-sizing: border-box;
}

/* --- Форма --- */
.tsv-search__form {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

.tsv-search__field {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #e6e6e6;
    border-radius: 14px;
    padding: 0 44px 0 48px;
    min-height: 56px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.tsv-search__field:hover {
    border-color: #c9c9c9;
}

.tsv-search__field:focus-within {
    border-color: #A11826;
    box-shadow: 0 0 0 4px rgba(161, 24, 38, .08);
}

.tsv-search__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9a9a9a;
    pointer-events: none;
    transition: color .18s ease;
}

.tsv-search__field:focus-within .tsv-search__icon {
    color: #A11826;
}

.tsv-search__input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 17px;
    line-height: 1.3;
    color: #1a1a1a;
    padding: 10px 0;
}

.tsv-search__input::placeholder {
    color: #a0a0a0;
    font-weight: 400;
}

.tsv-search__clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    background: #f2f2f2;
    color: #6b6b6b;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease, transform .15s ease;
    padding: 0;
}

.tsv-search__clear:hover {
    background: #A11826;
    color: #fff;
    transform: translateY(-50%) scale(1.05);
}

.tsv-search__clear.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(.8);
}

/* --- Сабмит --- */
.tsv-search__submit {
    flex: 0 0 auto;
    min-width: 132px;
    padding: 0 28px;
    background: #A11826;
    color: #fff;
    border: 0;
    border-radius: 14px;
    font: inherit;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: .2px;
    cursor: pointer;
    transition: background .15s ease, transform .06s ease;
}

.tsv-search__submit:hover { background: #8d1420; }
.tsv-search__submit:active { transform: scale(.98); }
.tsv-search__submit:focus-visible {
    outline: 2px solid #F13A5F;
    outline-offset: 2px;
}

/* --- Подсказка об исправлении раскладки --- */
.tsv-search__hint {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fdf5ec;
    color: #6b4a1a;
    font-size: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid #f4e4c8;
}

.tsv-search__hint svg { flex-shrink: 0; color: #c18b2b; }

.tsv-search__hint a {
    color: #A11826;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed rgba(161, 24, 38, .4);
}
.tsv-search__hint a:hover { border-bottom-style: solid; }

/* --- Метаинфо "найдено N товаров" --- */
.tsv-search__meta {
    margin-top: 16px;
    padding: 10px 0;
    font-size: 15px;
    color: #4a4a4a;
}

.tsv-search__meta strong {
    color: #1a1a1a;
    font-weight: 600;
}

/* --- Пустая выдача --- */
.tsv-search__empty {
    margin-top: 24px;
    padding: 40px 24px;
    text-align: center;
    background: linear-gradient(180deg, #fdfbf9 0%, #faf4ee 100%);
    border-radius: 20px;
    border: 1px solid #f0e4d7;
}

.tsv-search__empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #A11826;
    opacity: .72;
    margin-bottom: 16px;
}

.tsv-search__empty-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.25;
}

.tsv-search__empty-hint {
    font-size: 15px;
    color: #6b6b6b;
    margin-bottom: 22px;
}

.tsv-search__suggest {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tsv-search__chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    background: #fff;
    color: #333;
    border: 1px solid #e6dccf;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s ease;
    white-space: nowrap;
}

.tsv-search__chip:hover {
    background: #A11826;
    color: #fff;
    border-color: #A11826;
    transform: translateY(-1px);
}

.tsv-search__chip--primary {
    background: #A11826;
    color: #fff;
    border-color: #A11826;
}

.tsv-search__chip--primary:hover {
    background: #F13A5F;
    border-color: #F13A5F;
}

/* --- Адаптив: планшет --- */
@media (max-width: 768px) {
    .tsv-search { margin-bottom: 24px; }
    .tsv-search__field { min-height: 52px; padding: 0 40px 0 44px; border-radius: 12px; }
    .tsv-search__input { font-size: 16px; } /* Избегаем iOS zoom */
    .tsv-search__icon { left: 14px; width: 20px; height: 20px; }
    .tsv-search__submit { min-width: 52px; padding: 0 16px; border-radius: 12px; font-size: 0; }
    .tsv-search__submit::before {
        content: '→';
        font-size: 22px;
        line-height: 1;
    }
    .tsv-search__empty { padding: 32px 16px; border-radius: 16px; }
    .tsv-search__empty-title { font-size: 19px; }
}

/* --- Адаптив: мобилки --- */
@media (max-width: 480px) {
    .tsv-search { padding: 0 8px; margin-bottom: 20px; }
    .tsv-search__form { gap: 8px; }
    .tsv-search__submit { min-width: 48px; }
    .tsv-search__hint { font-size: 13px; padding: 10px 12px; }
    .tsv-search__empty-icon svg { width: 52px; height: 52px; }
    .tsv-search__chip { padding: 8px 14px; font-size: 13px; }
}

/* --- Подсветка найденного текста в выдаче (штатный компонент использует <b>) --- */
.tsv-search-highlight,
.search-page b {
    color: #A11826;
    font-weight: 600;
    background: rgba(241, 58, 95, .08);
    padding: 0 2px;
    border-radius: 2px;
}
