/*
 * Поиск Thiscode в стиле «Двери Регионов» — версия 2.
 * Подключить на сайте ПОСЛЕ виджета, в конце <head>:
 *   <link rel="stylesheet" href="/local/templates/newshablon/css/thiscode-dveriregionov.css">
 *
 * Только CSS: разметка и скрипты виджета не меняются.
 * Все правила привязаны к #tc-search-widget-root — остальной сайт не затрагивается.
 * Шрифт Montserrat на сайте уже подключён.
 */

#tc-search-widget-root {
    /* одна тёплая шкала серых + один акцент */
    --dr-accent: #ed4815;
    --dr-accent-press: #d23e10;
    --dr-accent-tint: #fdf0ea;
    --dr-ink: #1f1d1b;
    --dr-ink-2: #5f5b56;
    --dr-ink-3: #9a958f;
    --dr-line: #ebe8e4;
    --dr-surface: #f6f5f3;
    --dr-surface-2: #efedea;
    --dr-bg: #ffffff;

    --dr-r-sm: 8px;
    --dr-r-md: 12px;
    --dr-r-lg: 16px;

    --dr-shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 12px 32px -12px rgba(60, 40, 20, .18);
    --dr-ease: cubic-bezier(.2, .7, .2, 1);

    --dr-font: "Montserrat", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --dr-bar-h: 88px;
    --dr-title-w: 264px;
}

/* ============ основа ============ */
#tc-search-widget-root.tc-search-widget,
#tc-search-widget-root .fullscreen-search,
#tc-search-widget-root .product-price,
#tc-search-widget-root .product-old-price {
    font-family: var(--dr-font) !important;
}
#tc-search-widget-root .fullscreen-search {
    background: var(--dr-bg);
    color: var(--dr-ink);
    -webkit-font-smoothing: antialiased;
}
#tc-search-widget-root button,
#tc-search-widget-root input {
    font-family: var(--dr-font);
}
#tc-search-widget-root button {
    -webkit-tap-highlight-color: transparent;
}

/* ============ верхняя панель: заголовок · поиск · закрыть в одну строку ============ */
#tc-search-widget-root .search-header {
    position: relative;
    z-index: 1;
    height: var(--dr-bar-h);
    padding: 0 28px;
    border-bottom: 1px solid var(--dr-line);
    background: var(--dr-bg);
}
#tc-search-widget-root .search-header h2 {
    width: calc(var(--dr-title-w) - 28px);
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
    color: var(--dr-ink);
}
#tc-search-widget-root .close-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--dr-r-md);
    background: var(--dr-surface);
    color: var(--dr-ink);
    font-size: 17px;
    line-height: 1;
    transition: background-color .2s, color .2s, transform .15s var(--dr-ease);
}
#tc-search-widget-root .close-btn:hover {
    background: var(--dr-ink);
    color: #fff;
}
#tc-search-widget-root .close-btn:active {
    transform: scale(.94);
}

/* строка поиска поднимается в верхнюю панель, между заголовком и крестиком */
#tc-search-widget-root .search-input-wrapper {
    position: relative;
    z-index: 2;
    height: var(--dr-bar-h);
    margin-top: calc(-1 * var(--dr-bar-h));
    padding: 16px 104px 16px var(--dr-title-w);
    border-bottom: none;
    pointer-events: none;
}
#tc-search-widget-root .search-input-wrapper > * {
    pointer-events: auto;
}
#tc-search-widget-root .search-input {
    width: 100%;
    max-width: 880px;
    height: 56px;
    padding: 0 22px 0 56px;
    border: 1.5px solid transparent;
    border-radius: var(--dr-r-md);
    background: var(--dr-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' stroke='%231f1d1b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9.5' cy='9.5' r='7'/%3E%3Cpath d='m15 15 5 5'/%3E%3C/svg%3E") no-repeat 20px 50%;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -.01em;
    color: var(--dr-ink);
    box-shadow: none;
    transition: background-color .2s, border-color .2s, box-shadow .2s;
}
#tc-search-widget-root .search-input::placeholder {
    color: var(--dr-ink-3);
    font-weight: 500;
}
#tc-search-widget-root .search-input:hover {
    background-color: var(--dr-surface-2);
}
#tc-search-widget-root .search-input:focus {
    border-color: var(--dr-accent);
    background-color: var(--dr-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' stroke='%23ed4815' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9.5' cy='9.5' r='7'/%3E%3Cpath d='m15 15 5 5'/%3E%3C/svg%3E");
    box-shadow: 0 0 0 4px rgba(237, 72, 21, .10);
}
#tc-search-widget-root .search-input::-webkit-search-cancel-button {
    cursor: pointer;
}
#tc-search-widget-root .correction-info {
    max-width: 880px;
    margin-top: 6px;
    border-radius: var(--dr-r-sm);
    background: var(--dr-accent-tint);
    color: var(--dr-ink);
}
#tc-search-widget-root .correction-info button {
    color: var(--dr-accent);
    font-weight: 600;
}

/* ============ фильтры ============ */
#tc-search-widget-root .filters-sidebar {
    width: var(--dr-title-w);
    padding: 28px 20px 28px 28px;
    border-right: none;
    background: var(--dr-bg);
}
#tc-search-widget-root .filter-group {
    margin-bottom: 28px;
    padding-bottom: 0;
    border-bottom: none;
}
#tc-search-widget-root .filter-group-title {
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.01em;
    text-transform: none;
    color: var(--dr-ink);
}
#tc-search-widget-root .filter-options {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 2px;
    max-height: none;       /* прокручивается вся колонка фильтров, без второй полосы прокрутки */
    overflow: visible;
    margin: 0 -10px;
    padding: 0 2px;
}
/* теги в колонку, как пункты меню: проще сканировать глазом */
#tc-search-widget-root .filter-tag,
#tc-search-widget-root .color-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: none;
    border-radius: var(--dr-r-sm);
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    color: var(--dr-ink-2);
    transition: background-color .15s, color .15s, transform .15s var(--dr-ease);
}
#tc-search-widget-root .filter-tag::before {
    content: "";
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 1.5px solid #d6d1cb;
    border-radius: 5px;
    background: #fff no-repeat 50% 50%;
    transition: border-color .15s, background-color .15s;
}
#tc-search-widget-root .filter-tag:hover,
#tc-search-widget-root .color-filter-item:hover {
    background: var(--dr-surface);
    color: var(--dr-ink);
}
#tc-search-widget-root .filter-tag:hover::before {
    border-color: var(--dr-ink-3);
}
#tc-search-widget-root .filter-tag:active {
    transform: scale(.985);
}
#tc-search-widget-root .filter-tag.active,
#tc-search-widget-root .color-filter-item.active {
    background: transparent;
    font-weight: 600;
    color: var(--dr-ink);
}
#tc-search-widget-root .filter-tag.active::before {
    border-color: var(--dr-accent);
    background-color: var(--dr-accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.2 5 8.6l4.6-5'/%3E%3C/svg%3E");
}
#tc-search-widget-root .filter-tag.active:hover {
    background: var(--dr-surface);
}
#tc-search-widget-root .color-square {
    border-radius: 5px;
}

/* цена */
#tc-search-widget-root .price-range {
    padding: 0;
}
#tc-search-widget-root .price-inputs {
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: var(--dr-ink-3);
}
#tc-search-widget-root .price-input {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    max-width: none;
    height: 42px;
    padding: 0 12px;
    border: 1.5px solid transparent;
    border-radius: var(--dr-r-sm);
    background: var(--dr-surface);
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--dr-ink);
    -moz-appearance: textfield;
    transition: border-color .2s, background-color .2s;
}
#tc-search-widget-root .price-input::-webkit-outer-spin-button,
#tc-search-widget-root .price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#tc-search-widget-root .price-input::placeholder {
    color: var(--dr-ink-3);
}
#tc-search-widget-root .price-input:focus {
    outline: none;
    border-color: var(--dr-accent);
    background: var(--dr-bg);
}
#tc-search-widget-root .price-slider-container {
    height: 36px;
    margin: 6px 0 0;
}
#tc-search-widget-root .price-slider-track {
    height: 3px;
    background: var(--dr-surface-2);
}
#tc-search-widget-root .price-slider-track-fill {
    height: 3px;
    background: var(--dr-ink);
}
#tc-search-widget-root .price-slider-input::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    background: #fff;
    border: 1.5px solid var(--dr-line);
    box-shadow: 0 2px 6px rgba(60, 40, 20, .18);
    transition: transform .15s var(--dr-ease), border-color .15s;
}
#tc-search-widget-root .price-slider-input::-webkit-slider-thumb:hover,
#tc-search-widget-root .price-slider-input:active::-webkit-slider-thumb {
    background: #fff;
    border-color: var(--dr-accent);
    transform: scale(1.12);
}
#tc-search-widget-root .price-slider-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #fff;
    border: 1.5px solid var(--dr-line);
    box-shadow: 0 2px 6px rgba(60, 40, 20, .18);
}
#tc-search-widget-root .price-values {
    margin-top: 0;
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--dr-ink-3);
}

/* выбранные фильтры */
#tc-search-widget-root .active-filters {
    padding: 0;
    background: transparent;
}
#tc-search-widget-root .active-filter-tag {
    height: 32px;
    margin: 0 6px 6px 0;
    padding: 0 6px 0 12px;
    border-radius: var(--dr-r-sm);
    background: var(--dr-ink);
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}
#tc-search-widget-root .active-filter-tag button {
    color: rgba(255, 255, 255, .7);
}

/* сброс — тихая текстовая ссылка */
#tc-search-widget-root .reset-filters-btn {
    width: auto;
    height: auto;
    margin: 4px 0 0 -2px;
    padding: 6px 2px;
    border: none;
    border-radius: 4px;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--dr-line);
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
    color: var(--dr-ink-2);
    transition: color .15s, text-decoration-color .15s;
}
#tc-search-widget-root .reset-filters-btn:hover {
    background: transparent;
    color: var(--dr-accent);
    text-decoration-color: currentColor;
}

/* ============ результаты ============ */
#tc-search-widget-root .results-area {
    padding: 24px 28px 40px 8px;
    background: var(--dr-bg);
    scroll-behavior: smooth;
}
#tc-search-widget-root .results-stats {
    margin: 4px 0 18px;
    padding: 0;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--dr-ink-3);
}
#tc-search-widget-root .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
    gap: 36px 20px;
}

/* карточка без рамки: фото на тёплой подложке, текст под ним */
#tc-search-widget-root .product-card {
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    transform: none;
    animation: dr-card-in .45s var(--dr-ease) both;
}
#tc-search-widget-root .product-card:hover {
    transform: none;
    box-shadow: none;
}
#tc-search-widget-root .product-card > a:first-child {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: var(--dr-r-lg);
    background: var(--dr-surface);
    transition: background-color .3s, box-shadow .3s;
}
#tc-search-widget-root .product-card:hover > a:first-child {
    background: var(--dr-surface-2);
    box-shadow: var(--dr-shadow);
}
#tc-search-widget-root .product-image {
    display: block;
    width: 100%;
    height: 100%;
    padding: 9% 14%;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: multiply;          /* белый фон фото сливается с подложкой */
    transition: transform .5s var(--dr-ease);
}
#tc-search-widget-root .product-card:hover .product-image {
    transform: scale(1.045);
}
#tc-search-widget-root .product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 4px 0;
}
#tc-search-widget-root .p-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 10px;
    margin: 0 0 6px;
}
#tc-search-widget-root .product-price {
    padding: 0;
    border-radius: 0;
    background: none;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    color: var(--dr-ink);
    white-space: nowrap;
}
#tc-search-widget-root .product-old-price {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--dr-ink-3) !important;
    text-decoration-color: var(--dr-ink-3);
}
#tc-search-widget-root .p-price:has(.product-old-price) .product-price {
    color: var(--dr-accent);
}
#tc-search-widget-root .product-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--dr-ink-2);
}
#tc-search-widget-root .product-title a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 2.9em;
    color: inherit;
    text-decoration: none;
    text-wrap: pretty;
    transition: color .2s;
}
#tc-search-widget-root .product-card:hover .product-title a,
#tc-search-widget-root .product-title a:hover {
    color: var(--dr-ink);
}
#tc-search-widget-root .product-title mark {
    padding: 0 1px;
    border-radius: 3px;
    background: var(--dr-accent-tint);
    color: var(--dr-accent);
}
#tc-search-widget-root .product-vendor {
    margin-top: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--dr-ink-3);
}
#tc-search-widget-root .product-row:empty {
    display: none;
}

/* листание фото (скрипт thiscode-dveriregionov.js): точки внизу фото */
#tc-search-widget-root .dr-dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    display: flex;
    gap: 4px;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}
#tc-search-widget-root .product-card:hover .dr-dots,
#tc-search-widget-root .dr-has-gallery:focus-visible .dr-dots {
    opacity: 1;
}
@media (hover: none) {
    #tc-search-widget-root .dr-dots {
        opacity: 1;   /* на телефоне наведения нет — точки видны всегда */
    }
}
#tc-search-widget-root .dr-dots i {
    width: 16px;
    height: 3px;
    border-radius: 2px;
    background: rgba(31, 29, 27, .18);
    transition: background-color .2s, width .2s var(--dr-ease);
}
#tc-search-widget-root .dr-dots i.is-active {
    width: 24px;
    background: var(--dr-ink);
}
#tc-search-widget-root .dr-has-gallery .product-image {
    transition: transform .5s var(--dr-ease), opacity .15s;
}

/* кнопка «В корзину» */
#tc-search-widget-root .product-row {
    margin-top: 12px;
}
#tc-search-widget-root .product-buttons {
    width: 100%;
    padding: 0;
    gap: 8px;
}
#tc-search-widget-root .product-buttons .cart-btn {
    flex: 1;
    width: 100%;
    max-width: none;
    height: 42px;
    border: none;
    border-radius: var(--dr-r-sm);
    background: var(--dr-accent-tint);
    font-size: 14px;
    font-weight: 600;
    color: var(--dr-accent);
    cursor: pointer;
}
#tc-search-widget-root .product-buttons .cart-btn:hover {
    background: var(--dr-accent);
    color: #fff;
}
#tc-search-widget-root .product-buttons .cart-btn.added {
    background: var(--dr-ink);
    color: #fff;
}
#tc-search-widget-root .product-buttons .cart-btn.added::before {
    content: "✓";
    margin-right: 6px;
}
#tc-search-widget-root .product-buttons .cart-btn.is-loading {
    pointer-events: none;
    opacity: .7;
}

/* уведомление о добавлении в корзину */
#tc-search-widget-root .dr-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 100001;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 16px;
    width: max-content;
    max-width: min(640px, calc(100vw - 32px));
    padding: 14px 16px 14px 20px;
    border-radius: 14px;
    background: var(--dr-ink);
    box-shadow: 0 16px 40px -12px rgba(31, 29, 27, .5);
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255, 255, 255, .72);
    opacity: 0;
    transform: translate(-50%, 16px);
    pointer-events: none;
    transition: opacity .25s, transform .35s var(--dr-ease);
}
#tc-search-widget-root .dr-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}
#tc-search-widget-root .dr-toast b {
    font-weight: 600;
    color: #fff;
}
#tc-search-widget-root .dr-toast span {
    flex: 1 1 220px;
    min-width: 0;
}
#tc-search-widget-root .dr-toast a {
    flex-shrink: 0;
    padding: 9px 14px;
    border-radius: var(--dr-r-sm);
    background: var(--dr-accent);
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: background-color .2s;
}
#tc-search-widget-root .dr-toast a:hover {
    background: var(--dr-accent-press);
}
#tc-search-widget-root .dr-toast a.dr-toast-secondary {
    background: rgba(255, 255, 255, .1);
}
#tc-search-widget-root .dr-toast a.dr-toast-secondary:hover {
    background: rgba(255, 255, 255, .18);
}
#tc-search-widget-root .dr-toast.is-error {
    background: #3a2a24;
}

/* появление карточек лесенкой (первые 12 при каждой выдаче) */
@keyframes dr-card-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
#tc-search-widget-root .product-card:nth-child(2)  { animation-delay: 30ms; }
#tc-search-widget-root .product-card:nth-child(3)  { animation-delay: 60ms; }
#tc-search-widget-root .product-card:nth-child(4)  { animation-delay: 90ms; }
#tc-search-widget-root .product-card:nth-child(5)  { animation-delay: 120ms; }
#tc-search-widget-root .product-card:nth-child(6)  { animation-delay: 150ms; }
#tc-search-widget-root .product-card:nth-child(7)  { animation-delay: 180ms; }
#tc-search-widget-root .product-card:nth-child(8)  { animation-delay: 210ms; }
#tc-search-widget-root .product-card:nth-child(9)  { animation-delay: 240ms; }
#tc-search-widget-root .product-card:nth-child(10) { animation-delay: 270ms; }
#tc-search-widget-root .product-card:nth-child(11) { animation-delay: 300ms; }
#tc-search-widget-root .product-card:nth-child(12) { animation-delay: 330ms; }

/* кнопки на карточке (если включат корзину / избранное / сравнение) */
#tc-search-widget-root .icon-btn.favorite:hover path,
#tc-search-widget-root .icon-btn.compare:hover path {
    fill: var(--dr-accent);
}
#tc-search-widget-root .icon-btn.compare.active,
#tc-search-widget-root .icon-btn.favorite.active {
    color: var(--dr-accent);
    text-shadow: none;
}
#tc-search-widget-root .cart-btn,
#tc-search-widget-root .oneclick-btn {
    min-height: 42px;
    border: none;
    border-radius: var(--dr-r-sm);
    background: var(--dr-surface);
    font-size: 14px;
    font-weight: 600;
    color: var(--dr-ink);
    transition: background-color .2s, color .2s, transform .15s var(--dr-ease);
}
#tc-search-widget-root .cart-btn svg path {
    stroke: currentColor;
}
#tc-search-widget-root .cart-btn:hover,
#tc-search-widget-root .cart-btn.added,
#tc-search-widget-root .oneclick-btn:hover {
    border: none;
    background: var(--dr-accent);
    color: #fff;
}
#tc-search-widget-root .cart-btn:active,
#tc-search-widget-root .oneclick-btn:active {
    transform: scale(.97);
}

/* модальное окно */
#tc-search-widget-root .modal-overlay {
    background: rgba(31, 29, 27, .45);
    backdrop-filter: blur(3px);
}
#tc-search-widget-root .modal-content {
    padding: 28px;
    border-radius: 20px;
    box-shadow: var(--dr-shadow);
}
#tc-search-widget-root .modal-content h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.02em;
}
#tc-search-widget-root .modal-content input {
    height: 48px;
    border: 1.5px solid transparent;
    border-radius: var(--dr-r-sm);
    background: var(--dr-surface);
}
#tc-search-widget-root .modal-content input:focus {
    outline: none;
    border-color: var(--dr-accent);
    background: #fff;
}
#tc-search-widget-root .modal-content button {
    height: 50px;
    border-radius: var(--dr-r-sm);
    background: var(--dr-accent);
    font-weight: 600;
}
#tc-search-widget-root .modal-content button:hover {
    background: var(--dr-accent-press);
}

/* пусто / загрузка */
#tc-search-widget-root .no-results {
    padding: 80px 20px;
    font-size: 17px;
    font-weight: 600;
    color: var(--dr-ink);
}
#tc-search-widget-root .loading-spinner,
#tc-search-widget-root .loading-more {
    font-size: 14px;
    font-weight: 500;
    color: var(--dr-ink-3);
}

/* кнопка открытия поиска (если используется встроенная) */
#tc-search-widget-root .search-open-btn {
    border-radius: 16px;
    background: var(--dr-accent);
    box-shadow: 0 10px 24px -8px rgba(237, 72, 21, .6);
}

/* прокрутка */
#tc-search-widget-root .results-area,
#tc-search-widget-root .filters-sidebar,
#tc-search-widget-root .filter-options {
    scrollbar-width: thin;
    scrollbar-color: #dcd8d3 transparent;
}

/* клавиатура */
#tc-search-widget-root button:focus-visible,
#tc-search-widget-root a:focus-visible,
#tc-search-widget-root input:focus-visible {
    outline: 2px solid var(--dr-accent);
    outline-offset: 2px;
}

/* широкие экраны: контент не растягивается бесконечно */
@media (min-width: 1680px) {
    #tc-search-widget-root .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
    }
}

/* ============ планшет и телефон ============ */
@media (max-width: 768px) {
    #tc-search-widget-root {
        --dr-bar-h: 60px;
    }
    #tc-search-widget-root .search-header {
        height: auto;
        min-height: var(--dr-bar-h);
        padding: 8px 12px 8px 16px;
        padding-top: max(8px, env(safe-area-inset-top));
        border-bottom: none;
    }
    #tc-search-widget-root .search-header h2 {
        width: auto;
        font-size: 18px;
    }
    #tc-search-widget-root .close-btn {
        width: 44px;
        height: 44px;
    }
    /* на телефоне поиск — отдельной строкой под заголовком */
    #tc-search-widget-root .search-input-wrapper {
        height: auto;
        margin-top: 0;
        padding: 0 16px 12px;
        pointer-events: auto;
    }
    #tc-search-widget-root .search-input {
        max-width: none;
        height: 50px;
        padding-left: 48px;
        background-position: 16px 50%;
        font-size: 16px;
    }
    #tc-search-widget-root .filters-mobile-bar {
        padding: 0 16px 12px;
        border-bottom: 1px solid var(--dr-line);
        background: var(--dr-bg);
    }
    #tc-search-widget-root .filters-toggle-btn {
        justify-content: flex-start;
        min-height: 42px;
        padding: 0 14px 0 42px;
        border: none;
        border-radius: var(--dr-r-sm);
        background: var(--dr-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%231f1d1b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 5h12M5.5 9h7M8 13h2'/%3E%3C/svg%3E") no-repeat 16px 50%;
        font-size: 14px;
        font-weight: 600;
        color: var(--dr-ink);
    }
    #tc-search-widget-root .filters-toggle-btn:active {
        background-color: var(--dr-surface-2);
    }
    #tc-search-widget-root .filters-toggle-badge {
        min-width: 20px;
        height: 20px;
        margin-left: auto;
        background: var(--dr-accent);
    }

    /* выезжающая панель фильтров */
    #tc-search-widget-root .filters-sidebar {
        width: 100%;
        padding: 0 20px 20px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        border-right: none;
        border-radius: 20px 20px 0 0;
        background: var(--dr-bg);
        box-shadow: 0 -12px 40px rgba(31, 29, 27, .16);
    }
    /* в widget.css шапка панели скрыта на всех экранах — на телефоне возвращаем, иначе фильтры не закрыть */
    #tc-search-widget-root .filters-drawer-header {
        display: flex;
        margin: 0 -20px 16px;
        padding: 18px 20px 14px;
        border-bottom: 1px solid var(--dr-line);
        border-radius: 20px 20px 0 0;
        background: var(--dr-bg);
        z-index: 20;   /* в widget.css у кружков ползунка цены z-index 10 — при прокрутке они вылезали поверх шапки */
    }
    #tc-search-widget-root .filters-drawer-header::before {
        content: "";
        position: absolute;
        top: 7px;
        left: 50%;
        width: 36px;
        height: 4px;
        margin-left: -18px;
        border-radius: 2px;
        background: var(--dr-line);
    }
    #tc-search-widget-root .filters-drawer-title {
        font-size: 18px;
        font-weight: 700;
        letter-spacing: -.02em;
        color: var(--dr-ink);
    }
    #tc-search-widget-root .filters-drawer-close {
        width: 40px;
        height: 40px;
        border-radius: var(--dr-r-sm);
        background: var(--dr-surface);
        color: var(--dr-ink);
    }
    #tc-search-widget-root .filter-options {
        max-height: none;
    }

    #tc-search-widget-root .results-area {
        padding: 14px 16px 32px;
    }
    #tc-search-widget-root .results-stats {
        margin: 0 0 14px;
        font-size: 12px;
    }
    #tc-search-widget-root .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 12px;
    }
    #tc-search-widget-root .product-card > a:first-child {
        border-radius: var(--dr-r-md);
    }
    #tc-search-widget-root .product-info {
        padding: 10px 2px 0;
    }
    #tc-search-widget-root .product-price {
        font-size: 16px;
    }
    #tc-search-widget-root .product-old-price {
        font-size: 12px;
    }
    #tc-search-widget-root .product-title {
        margin-bottom: 4px;
        font-size: 13px;
    }
    #tc-search-widget-root .product-vendor {
        font-size: 11px;
    }
}

/* без анимаций для тех, кто их отключил в системе */
@media (prefers-reduced-motion: reduce) {
    #tc-search-widget-root .product-card {
        animation: none;
    }
    #tc-search-widget-root .product-image,
    #tc-search-widget-root .product-card > a:first-child {
        transition: none;
    }
}

/* ===== цвет: квадратики фильтра (блок генерирует colors/build-swatches.js) =====
   Цвет товара и HEX-код пишет feed_dveri.php (профиль poisk). Скрипт thiscode-dveriregionov.js
   ставит квадратику data-dr-color, а пунктам фильтра задаёт постоянный порядок (светлые → тёмные → дерево → металл). */
#tc-search-widget-root .color-square {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: none;
    border-radius: 6px;
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(31, 29, 27, .12);
    transition: box-shadow .15s;
}
#tc-search-widget-root .color-filter-item {
    cursor: pointer;
}
#tc-search-widget-root .color-filter-item:hover .color-square {
    box-shadow: inset 0 0 0 1px rgba(31, 29, 27, .12), 0 0 0 3px var(--dr-surface-2);
}
/* выбранный цвет: оранжевое кольцо вокруг квадратика */
#tc-search-widget-root .color-filter-item.active .color-square {
    box-shadow: inset 0 0 0 1px rgba(31, 29, 27, .12), 0 0 0 2px #fff, 0 0 0 4px var(--dr-accent);
}
#tc-search-widget-root .color-name {
    font-size: 14px;
}
#tc-search-widget-root .color-square[data-dr-color="wood-light"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55 0.03' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0.604 0 0 0 0 0.416 0 0 0 0 0.227 3.4 0 0 0 -1.25'/%3E%3C/filter%3E%3Crect width='48' height='48' fill='%23E2C49A'/%3E%3Crect width='48' height='48' filter='url(%23g)'/%3E%3C/svg%3E");
}
#tc-search-widget-root .color-square[data-dr-color="wood"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55 0.03' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.306 0 0 0 0 0.173 0 0 0 0 0.071 3.4 0 0 0 -1.25'/%3E%3C/filter%3E%3Crect width='48' height='48' fill='%23B07A42'/%3E%3Crect width='48' height='48' filter='url(%23g)'/%3E%3C/svg%3E");
}
#tc-search-widget-root .color-square[data-dr-color="wood-dark"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55 0.03' numOctaves='3' seed='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.125 0 0 0 0 0.078 0 0 0 0 0.051 3.4 0 0 0 -1.25'/%3E%3C/filter%3E%3Crect width='48' height='48' fill='%234E3527'/%3E%3Crect width='48' height='48' filter='url(%23g)'/%3E%3C/svg%3E");
}
#tc-search-widget-root .color-square[data-dr-color="silver"] {
    background-image: linear-gradient(135deg, #f1f2f3 0%, #a4a8ac 42%, #eef0f1 58%, #8d9196 100%);
}
#tc-search-widget-root .color-square[data-dr-color="gold"] {
    background-image: linear-gradient(135deg, #f5e2a0 0%, #b88f3e 45%, #f3dc98 60%, #9c7630 100%);
}
#tc-search-widget-root .color-square[data-dr-color="copper"] {
    background-image: linear-gradient(135deg, #d8a07a 0%, #8a5230 45%, #c98b62 60%, #5f3620 100%);
}
#tc-search-widget-root .color-square[data-dr-color="any"] {
    background-image: conic-gradient(from 200deg, #e0533d, #efb73e, #7bb662, #3f8fd2, #8a5cc2, #e0533d);
}
/* на карточке строка «Цвет:» не нужна — точный оттенок уже в названии товара */
#tc-search-widget-root .product-card .product-color {
    display: none;
}
/* ===== /цвет ===== */
