/* result.css v2.0.73 */
header {
    width: 100%;
    justify-content: space-around;
    background-color: #f9f9f9;
    /* border-radius: 15px; */
    z-index: 1000;
}

.container {
    width: 40%;
    margin: 0;
    background-color: transparent;
    display: flex;
    border-radius: 15px;
}

.searchBlock {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
}

.searchText {
    font-size: 56px;
    color: #161B2D;
    margin-bottom: 10px;
}

.search-box {
    display: flex;
    padding: 4px 0 4px 0;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    outline: solid 2px #dfdfdf;
    /* background-color: #2A2A2A; */
    /* width: 80%; */
    border-radius: 15px;
    transition: 0.2s cubic-bezier(0.33, 1, 0.68, 1);
    /* margin-bottom: 20px; */
    /* gap: 10px; */
}

.search-box button {
    width: 100px;
    margin-right: 8px;
}

#article,
#articleMobile {
    padding: 0px 15px;
    width: 70%;
    border: none;
    background-color: transparent;
    height: 36px;
    border-radius: 15px;
    color: #161B2D;
    font-size: 16px;
    font-weight: 500;
    font-family: "Unbounded", sans-serif;
    font-optical-sizing: auto;
    transition: 0.2s cubic-bezier(0.33, 1, 0.68, 1);
    margin-right: 10px;
}

#article::placeholder,
#articleMobile::placeholder {
    color: rgba(156, 156, 156, 0.28);
    transition: 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}

.search-box:hover {
    outline: #1280D0 solid 2px;
}

#article:hover::placeholder,
#articleMobile:hover::placeholder {
    color: #1280D0;
}

#article:focus,
#articleMobile:focus {
    outline: none;
}

#article:focus>.search-box {
    outline: #1280D0 solid 2px;
}

.search-box:focus {
    outline: #1280D0 solid 2px;
}

button {
    display: flex;
    justify-content: center;
    padding: 5px 30px;
    width: 30%;
    background-color: #1280D0;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    margin-right: 0;
    font-size: 16px;
    font-weight: 600;
    font-family: "Unbounded", sans-serif;
    font-optical-sizing: auto;
    transition: 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}


/* Основной контейнер */

.main-container {
    background-color: #fff;
    width: 100%;
    border-radius: 15px 15px 0 0;
}

.results-container {
    width: 90%;
    /* max-width: 800px; */
    margin: 10px auto;
    font-family: "Unbounded", sans-serif;
}

/* Заголовки секций */
.section-header {
    font-size: 20px;
    font-weight: 600;
    color: #1280D0;
    margin: 25px 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #1280D0;
    display: inline-block;
}

/* Обёртка для секций */
.section-container {
    margin-bottom: 30px;
}


/* Блок товара */
.result-item {
    position: relative;
    padding: 10px;
    margin-bottom: 0;
    border: none;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: white;
    transition: border-color 0.2s, transform 0.2s;
    min-width: 0;
    max-width: 100%;
}

/* Выбранная позиция (оригинал) */
.result-item.original {
    border: 1.5px solid #1280D0;
    /* background: #f0f8ff; */
    /* box-shadow: 0 4px 16px rgba(18, 128, 208,0.2); */
}

.result-item.original::before {
    content: 'Выбранная позиция';
    position: sticky;
    top: -12px;
    left: 50%;
    /* transform: translateX(-50%); */
    width: auto;
    background: #1280D0;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
    display: none;
}

.result-item:hover {
    /* box-shadow: 0 4px 12px rgba(0,0,0,0.1); */
    /* transform: translateY(-2px); */
}

.result-image {
    transition: opacity 0.2s cubic-bezier(0.33, 1, 0.68, 1);
    opacity: 1;
}

.result-image.loading {
    opacity: 0.6;
    filter: blur(1px);
}


.right-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    width: 100%;
    flex: 1;
    min-height: 0;
    min-width: 0;
}

.result-info {
    flex: 1;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
}

/* Цена + кнопки внизу карточки при разной высоте описания / доставки */
.result-card-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-shrink: 0;
    margin-top: auto;
}

.result-card-footer .result-btns {
    margin-top: 0;
}

.result-card-footer .result-price {
    margin-top: 8px;
}

/* Бренд */
.result-brand {
    font-weight: 500;
    color: #161B2D;
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Название */
.result-name {
    font-size: 12px;
    color: #9d9da5;
    font-weight: 400;
    margin: 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Артикул */
.result-number {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    color: #999;
    margin-top: 2px;
}

/* Цена */
.result-price {
    display: flex;
    font-size: 18px;
    font-weight: 500;
    color: #161B2D;
    margin: 4px 0 0;
}

/* Наличие */
.result-availability {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    color: #28a745;
    margin: 2px 0;
}

/* изображения */

.result-image-container {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.result-photo-brand {
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 2;
    max-width: calc(100% - 12px);
    margin: 0;
    padding: 4px 8px;
    border-radius: 8px;
    background: #fff;
    color: #161B2D;
    font-family: "Unbounded", sans-serif;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 4px rgba(22, 27, 45, 0.12);
    pointer-events: none;
}

.result-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}

.result-image-container img[data-src] {
    opacity: 0;
}

.result-image-container img.loaded {
    opacity: 1;
}


/* Бренд (доп. к правилам выше — сетка не должна раздуваться от длинного названия) */
.result-brand {
    font-weight: 500;
    color: #161B2D;
    font-size: 14px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Название */
/* .result-name {
    font-size: 16px;
    color: #9d9da5;
    font-weight: 600;
    margin: 6px 0;
} */

/* Артикул */
.result-number {
    font-size: 12px;
    font-weight: 400;
    color: #555;
    margin-top: 2px;
}

/* Цена */
.result-price {
    display: flex;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    color: #161B2D;
    margin: 2px 0 0;
}

/* Наличие */
.result-availability {
    font-size: 12px;
    font-weight: 400;
    color: #28a745;
    margin: 2px 0 0;
}

.result-availability.result-availability--out {
    color: #d32f2f;
}

.result-btns {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    margin-top: auto;
    gap: 8px;
}

/* Кнопка "В корзину" */
.add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 0;
    padding: 10px 16px;
    white-space: nowrap;
}

.add-to-cart:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.info-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Кнопка "Подробнее" */
.about-result {
    flex: 1;
    background: transparent;
    transition: 0.2s cubic-bezier(0.33, 1, 0.68, 1);
    outline: #e8e8e8 1.5px solid;
    font-size: 14px;
    font-weight: 600;
    margin-top: 0;
    padding: 10px 16px;
    color: #161B2D;
}

.about-result:hover {
    outline: #1280D0 1.5px solid;
    color: #1280D0;
    background: transparent;
}

/* Метка "Оригинал" */
.original-label {
    color: #1280D0;
    font-weight: 600;
    margin-top: 10px;
    font-size: 14px;
}

/* Фото товара */
.product-photo {
    width: 80px;
    margin-top: 10px;
    border-radius: 15px;
}

/* Индикатор загрузки */
.loading-text {
    text-align: center;
    color: #666;
    margin: 20px 0;
    font-style: italic;
}

/* Ошибка */
.no-results {
    text-align: center;
    color: #d9534f;
    font-size: 18px;
    margin: 20px 0;
}

/* Ссылка назад */
.back-link {
    display: block;
    text-align: center;
    margin: 30px auto;
    color: #1280D0;
    font-weight: 600;
    text-decoration: none;
    font-size: 16px;
}

.back-link:hover {
    text-decoration: underline;
}

/* Уведомление о копировании */
.share-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 15px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.33, 1, 0.68, 1);
    pointer-events: none;
}

#analogues,
#favorites-list {
    display: grid;
    /* minmax(0,1fr) — иначе длинный текст задаёт min-width колонки и одна карта «ломает» сетку */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

#analogues .result-item,
#favorites-list .result-item {
    height: 100%;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

/* Стили поиска (можно перенести в style.css или result.css) */
.search-block-fixed {
    /* margin: 0 0 20px 0; */
    padding: 15px 15px 15px 0;
    /* background-color: white; */
    border-radius: 15px;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
    width: 100%;
}

.search-block-fixed .container {
    padding: 0;
}

.search-block-fixed .search-box {
    margin: 0 0 0 0;
}

.search-history {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding: 0 20px;
}

.search-history-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0 2px;
    border-radius: 15px;
    border: none;
    background: #f9f9f9;
    box-shadow: none;
    z-index: 1200;
}

.search-history-dropdown.show {
    display: flex;
}

.search-history-dropdown-title {
    padding: 4px 18px 8px;
    color: #9ea2ab;
    font-size: 14px;
    font-weight: 500;
}

.search-history-dropdown-row {
    display: grid;
    grid-template-columns: 28px 1fr 26px;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 2px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    transition: background 0.15s;
}

.search-history-dropdown-row:hover {
    background: #ebebeb;
}

.search-history-dropdown-icon {
    color: #babec7;
    font-size: 17px;
    line-height: 1;
}

.search-history-dropdown-item {
    display: block;
    justify-self: stretch;
    width: 100%;
    text-align: left;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: #1c2230;
    font-size: 16px;
    font-weight: 500;
    font-family: "Unbounded", sans-serif;
    cursor: pointer;
    transition: none;
}

.search-history-dropdown-item:hover,
.search-history-dropdown-item:focus-visible {
    background: transparent !important;
    color: #1c2230 !important;
    box-shadow: none !important;
}

.search-history-dropdown-remove {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #b2b7c1;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    transition: color 0.15s, background 0.15s;
}

.search-history-dropdown-remove:hover {
    color: #7f8796;
    background: rgba(255, 255, 255, 0.5);
}

.search-history-dropdown-empty {
    padding: 10px 16px;
    color: #7a8799;
    font-size: 13px;
}

/* .search-history-item {
    padding: 6px 12px;
    background-color: #e8e8e8;
    border-radius: 15px;
    font-size: 14px;
    color: #161B2D;
    cursor: pointer;
    transition: 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}

.search-history-item:hover {
    background-color: #1280D0;
    color: white;
} */

button.add-to-cart.in-cart,
button.add-to-cart.in-cart:hover,
button.add-to-cart.in-cart:focus,
button.add-to-cart.in-cart:active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    max-height: none;
    margin-top: 0;
    padding: 10px 0;
    border: 0;
    border-radius: 999px;
    background: #f2f3f5;
    color: #161B2D;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    box-shadow: none;
    box-sizing: border-box;
}

.add-to-cart.in-cart .qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    color: #161B2D;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.add-to-cart.in-cart .qty-btn.minus {
    color: #9aa1ad;
}

.add-to-cart.in-cart .qty-btn:hover,
.add-to-cart.in-cart .qty-btn:active {
    background: transparent;
    color: #161B2D;
}

.qty {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    /* font-size: 20px; */
}

.qty-input {
    flex: 0 1 auto;
    width: 36px;
    min-width: 24px;
    max-width: 44px;
    height: 26px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    padding: 0;
    margin: 0;
    outline: none;
    -moz-appearance: textfield;
    box-sizing: border-box;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-to-cart.in-cart .qty-input {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
    height: 1.2em;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    color: #161B2D;
}

.qty-input:focus,
.add-to-cart.in-cart .qty-input:focus {
    background: transparent;
    color: #161B2D;
    border: 0;
    border-radius: 0;
}

.mobile-menu {
    display: none;
}

.mobres {
    display: none;
}

/* Кнопка "В избранное" */
.fav-btn {
    /* position: absolute; */
    top: 25px;
    right: 16px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}

.fav-btn:hover {
    background-color: #f0f0f0;
}

.fav-icon {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}



@media (max-width: 1070px) and (min-width: 868px) {

    #analogues,
    #favorites-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .result-btns {
        flex-wrap: wrap;
        gap: 8px;
    }

    .add-to-cart,
    .add-to-cart.in-cart {
        width: auto;
        min-width: 140px;
        padding: 10px 15px;
    }

    .about-result {
        padding: 7px 12px;
        font-size: 15px;
    }

    .result-item {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .result-image-container {
        width: 120px;
        height: 120px;
    }

    .result-brand {
        font-size: 14px;
    }

    .result-name {
        font-size: 14px;
    }

    .result-price {
        font-size: 18px;
    }

    .add-to-cart,
    .add-to-cart.in-cart {
        width: auto;
        min-width: 140px;
        padding: 10px 15px;
    }

    .about-result {
        padding: 7px 12px;
        font-size: 15px;
    }

    .result-item {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .result-image-container {
        width: 120px;
        height: 120px;
    }

    .result-brand {
        font-size: 14px;
    }

    .result-name {
        font-size: 14px;
    }

    .result-price {
        font-size: 18px;
    }
}

/* === Фильтры === */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 0px;
    justify-content: center;
    width: 100%;
    background: #f9f9f9;
    align-items: center;
    position: sticky;
    top: 80px;
    z-index: 100;
    border-radius: 0 0 15px 15px;
}

.filter-group {
    position: relative;
}

.filter-btn {
    padding: 8px 16px;
    background: #f9f9f9;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.filter-btn:hover {
    color: #fff;
    background-color: #1280D0;
}

.filter-btn.active {
    background: #1280D0;
    color: white;
    border-color: #1280D0;
}

.filter-arrow {
    font-size: 10px;
}

/* Выпадающий список */
.filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 15px;
    padding: 10px;
    min-width: 180px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
}

.filter-dropdown.show {
    display: block;
}

.filter-dropdown label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 15px;
    font-size: 13px;
}

.filter-dropdown label:hover {
    background: #f0f0f0;
}

/* Поиск бренда */
.brand-search-container {
    padding: 8px;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

.brand-search-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 13px;
    box-sizing: border-box;
}

.brand-search-input:focus {
    outline: none;
    border-color: #1280D0;
}

.brand-item {
    padding: 4px 8px !important;
}

/* Фильтр по цене */
.filter-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-input {
    width: 70px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 14px;
}

.price-input:focus {
    outline: none;
    border-color: #1280D0;
}

/* Переключатель "Самый быстрый" */
.toggle-filter {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 16px;
    background: #f9f9f9;
    border: none;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: 0.2s;
}

/* Только устройства с реальным hover (мышь) — на тач после тапа :hover «залипает» и перекрывает unchecked */
@media (hover: hover) and (pointer: fine) {
    .toggle-filter:hover {
        background: #1280D0;
        color: #fff;
    }
}

.toggle-filter input {
    display: none;
}

.toggle-filter:has(input:checked) {
    background: #1280D0;
    color: white;
    border-color: #1280D0;
}

#filtersPopup .toggle-filter {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    margin: 0;
    padding: 14px 16px;
    background: #fff;
    color: #161B2D;
    border: 1.5px solid #e6e8ed;
    border-radius: 15px;
    font-family: "Unbounded", sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

#filtersPopup .toggle-filter:has(input:checked) {
    background: #1280D0;
    color: #fff;
    border-color: #1280D0;
}

.toggle-label {
    white-space: nowrap;
}

/* Кнопка сброса */
.reset-btn {
    background: #f44336;
    border-color: #f44336;
    color: white;
    margin-left: auto;
}

.reset-btn:hover {
    background: #d32f2f;
    border-color: #d32f2f;
}

/* Время доставки в карточке */
.delivery-time {
    font-size: 12px;
    font-weight: 400;
    color: #28a745;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.delivery-time.fast {
    color: #1280D0;
    font-weight: 400;
}

.delivery-time.fast.delivery-tomorrow {
    color: #002f5c;
}

.warehouse-delivery--tomorrow {
    color: #002f5c;
    font-weight: 400;
}

.delivery-range {
    font-size: 11px;
    color: #666;
    font-weight: normal;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Мобильные фильтры - скрыты по умолчанию */
.filters-mobile {
    display: none;
    outline: 2px solid #f9f9f9;
    outline-offset: -2px;
}

/* Десктопные фильтры - показаны по умолчанию */
.filters-desktop {
    display: flex;
}

#filtersContainer.filters-desktop {
    justify-content: center;
    align-items: center;
    background: #fff;
    position: sticky;
    top: 95px;
    z-index: 90;
    border-radius: 15px;
    padding: 10px 12px;
    margin-top: 6px;
    gap: 10px;
    width: fit-content;
    margin-inline: auto;
    outline: 2px solid #f9f9f9;
    outline-offset: -2px;
}

#filtersContainer .filter-group-search {
    position: relative;
    margin-left: auto;
    order: 99;
}

#filtersContainer .search-box-compact {
    width: 260px;
    padding: 3px 4px;
    outline: none;
    border: 1px solid #dfe3ea;
    border-radius: 15px;
    background: #f9f9f9;
}

#filtersContainer .search-box-compact:hover,
#filtersContainer .search-box-compact:focus-within {
    border-color: #1280D0;
}

#filtersContainer .search-box-compact #article {
    width: 100%;
    height: 30px;
    margin-right: 6px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 500;
}

#filtersContainer .search-box-compact button {
    width: auto;
    min-width: 72px;
    margin-right: 0;
    padding: 6px 12px;
    font-size: 13px;
}

@media (min-width: 868px) {
    header>.container {
        display: none;
    }
}

@media (max-width: 867px) {

    header {
        display: none;
    }

    header>.container {
        display: flex;
    }

    #filtersContainer .filter-group-search {
        display: none;
    }
}

#filtersContainer .filter-group {
    position: relative;
}

#filtersToggleBtnDesktop {
    font-weight: 600;
}

.filters-popup {
    display: flex;
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 100001;
    align-items: flex-end;
    transition: background 0.34s ease, visibility 0s linear 0.34s;
}

.filters-popup.show {
    visibility: visible;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    transition: background 0.34s ease, visibility 0s linear 0s;
}

.filters-popup-content {
    background: white;
    width: 100%;
    max-height: 85vh;
    border-radius: 15px 15px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translate3d(0, 100%, 0);
    transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
}

.filters-popup.show .filters-popup-content {
    transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
    .filters-popup,
    .filters-popup-content {
        transition: none;
    }
}

.filters-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.filters-popup-header h3 {
    margin: 0;
    font-size: 18px;
}

.filters-popup-close {
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.filters-popup-close:hover,
.filters-popup-close:focus-visible {
    color: #1280D0;
    background: transparent;
    outline: none;
}

.filters-popup-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px;
}

.filters-popup-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.filters-popup-footer .reset-btn {
    flex: 1;
    margin: 0;
}

.filters-popup-footer .apply-btn {
    flex: 1;
    margin: 0;
    background: #28a745;
    border-color: #28a745;
}

.popup-filter-section {
    margin-bottom: 20px;
}

.popup-filter-label {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}

.popup-brand-search input,
.popup-price-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.popup-brand-search input {
    width: 90%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 14px;
    margin-bottom: 10px;
}

.popup-brand-list {
    max-height: 150px;
    overflow-y: auto;
}

.popup-brand-list label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    cursor: pointer;
    border-radius: 15px;
    font-size: 14px;
}

.popup-brand-list label:hover {
    background: #f0f0f0;
}

.popup-sort-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    border-radius: 15px;
    font-size: 14px;
    margin-bottom: 4px;
}

.popup-sort-options label:hover {
    background: #f0f0f0;
}

.popup-price-inputs input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 14px;
}

/* Единый стиль чекбоксов, радио и селектов (result.html, catalogsearch.html) */
.filter-dropdown input[type="radio"],
.filters-popup input[type="radio"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    margin-top: 2px;
    accent-color: #1280D0;
    cursor: pointer;
    flex-shrink: 0;
}

.filters-popup .popup-sort-options input[type="radio"] {
    margin-top: 0;
}

/* Чекбоксы: скругление + компактная белая галочка на синем */
.filter-dropdown input[type="checkbox"],
.filters-popup input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    min-width: 17px;
    margin: 0;
    margin-top: 2px;
    border: 2px solid #c5c9d4;
    border-radius: 15px;
    background-color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition:
        border-color 0.15s,
        background-color 0.15s;
}

.filter-dropdown input[type="checkbox"]:checked,
.filters-popup input[type="checkbox"]:checked {
    background-color: #1280D0;
    border-color: #1280D0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1.2 5.4L4.8 9 10.8 1'/%3E%3C/svg%3E");
    background-size: 7px 6px;
    background-position: center;
    background-repeat: no-repeat;
}

.filter-dropdown input[type="checkbox"]:focus-visible,
.filters-popup input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(18, 128, 208, 0.45);
    outline-offset: 1px;
}

.filter-dropdown select,
.filters-popup select,
.filters select,
select.oil-filter-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: "Unbounded", sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #161b2d;
    background-color: #fff;
    border: 1px solid #d0d3db;
    border-radius: 15px;
    padding: 10px 12px;
    min-height: 42px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-dropdown select:focus,
.filters-popup select:focus,
.filters select:focus,
select.oil-filter-select:focus {
    outline: none;
    border-color: #1280D0;
}

/* === Стили для избранного (fav.html) — только в избранном, не ломаем каталог === */
body.page-fav #favorites-list .result-item {
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

body.page-fav #favorites-list .result-item .result-image-container {
    flex-shrink: 0;
}

body.page-fav #favorites-list .result-item .right-info {
    flex: 1;
    width: 100%;
}

.add-to-cart-fav {
    width: inherit;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 16px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.2s cubic-bezier(0.33, 1, 0.68, 1);
    margin-right: 10px;
}

.add-to-cart-fav:hover {
    background-color: #218838;
}

@media (max-width: 600px) {
    body.page-fav #favorites-list .result-item {
        flex-direction: column;
        align-items: flex-start;
    }

    body.page-fav #favorites-list .result-item .result-image-container {
        width: 100%;
        height: 180px;
    }

    body.page-fav #favorites-list .result-item .result-btns {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 867px) {

    header {
        display: none !important;
    }

    .main-container {
        border-radius: 0 !important;
    }

    /* Кнопки компактнее; крестик попапа — отдельные размеры ниже */
    button:not(.filters-popup-close) {
        padding: 9px 14px;
        font-size: 14px;
        width: auto;
        max-width: 100%;
    }

    button.add-to-cart {
        font-size: 14px;
        line-height: 1.2;
        padding: 9px 14px;
    }

    button.add-to-cart.in-cart,
    button.add-to-cart.in-cart:hover {
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 9px 0;
        font-size: 14px;
        line-height: 1.2;
    }

    .about-result {
        font-size: 11px;
        padding: 7px 10px;
    }

    .add-to-cart-fav {
        font-size: 11px;
        padding: 7px 12px;
    }

    #filtersContainer .search-box-compact button {
        min-width: 64px;
        padding: 5px 10px;
        font-size: 12px;
    }

    .filters-popup-footer {
        padding: 12px 14px;
        gap: 8px;
    }

    /* Скрываем десктопные фильтры, показываем мобильные */
    .filters-desktop {
        display: none !important;
    }

    .filters-mobile {
        display: flex !important;
        gap: 8px;
        width: fit-content;
        justify-content: center;
        align-items: center;
        padding: 8px 10px;
        margin: 8px auto 0;
        background: #fff;
        border-radius: 15px;
        position: sticky;
        top: 20px;
        z-index: 90;
    }

    #filtersToggleBtn {
        width: auto;
    }

    /* Кнопка "Фильтры" того же размера, что и "Самый быстрый" */
    .filters-mobile #filtersToggleBtn.filters-toggle-btn {
        padding: 8px 16px;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.2;
        min-height: auto;
    }

    #filtersToggleBtnDesktop {
        display: none;
    }

    .filters-toggle-btn {
        /* flex: 1; */
        justify-content: center;
    }

    .mobile-fast {
        white-space: nowrap;
    }

    .logo {
        display: none;
    }

    header>.container {
        display: flex;
        width: 90%;
    }

    .container {
        width: 90%;
    }

    .mainBtn,
    .cartBtn,
    .lkBtn,
    .fav {
        /* padding: 10px 20px; */
        font-size: 12px;
    }

    .searchBlock {
        margin-top: 0px;
        align-items: center;
        text-align: center;
        width: 95%;
    }

    .search-box {
        width: 95%;
    }

    /* Синий фон .navbar на мобилке бился с нижним .mobile-menu (см. mobile-search.css). Выравнивание шапки — через header .navbar */

    .pcbtn {
        display: none;
    }

    .pcres {
        display: none;
    }

    .mobres {
        display: flex;
    }

    .result-brand {
        font-size: 14px;
    }

    .result-name {
        font-size: 14px;
    }

    /* Цена */
    .result-price {
        display: flex;
        font-size: 18px;
        font-weight: 600;
        color: #161B2D;
        margin-top: 2px;
    }

    .mobile-menu {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        justify-content: center;
        align-items: center;
        gap: 10px;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 0 14px calc(10px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        z-index: 90000;
    }

    .filters-popup-content {
        max-height: 92vh;
    }

    .filters-popup-body {
        padding-bottom: 90px;
    }


    #analogues,
    #favorites-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* fav.html: контент и кнопки карточки над фиксированным .mobile-menu */
    body.page-fav .main-container {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 28px);
    }

    /*
     * Высота шапки в style.css: height: 7vh + padding 10px сверху/снизу (content-box).
     * Раньше top: 70px не совпадал с реальной высотой — при sticky оставалась полоска фона.
     */
    header {
        margin-bottom: 0;
    }

    /* Popup в мобильной версии */
    .photo-popup-content {
        padding: 16px;
        width: 95%;
    }

    .photo-popup-gallery {
        grid-template-columns: 1fr;
    }

    .gallery-image {
        height: 300px;
    }
}

@media (max-width: 600px) {

    /* Две карточки в ряд и на узких телефонах (раньше здесь была одна колонка) */
    #analogues,
    #favorites-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

/* === Стили для popup с фото === */
.photo-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.photo-popup.show {
    display: flex;
}

.photo-popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.photo-popup-content {
    position: relative;
    background: #fff;
    border-radius: 15px;
    padding: 22px;
    max-width: 980px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    box-shadow:
        0 20px 60px rgba(10, 20, 45, 0.28),
        0 2px 12px rgba(10, 20, 45, 0.12);
}

.photo-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 30px;
    color: #6b7280;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    transition: 0.2s cubic-bezier(0.33, 1, 0.68, 1);
    z-index: 2;
}

.photo-popup-close:hover {
    color: #1280D0;
    background-color: #eef6ff;
}

.photo-popup-content h3,
.photo-popup-title {
    margin: 0 38px 16px 0;
    font-size: clamp(18px, 2.2vw, 24px);
    line-height: 1.25;
    font-weight: 500;
    color: #111827;
    text-align: left;
}

.photo-popup-gallery {
    display: grid;
    gap: 14px;
}

.gallery-image {
    width: 100%;
    height: 240px;
    object-fit: contain;
    border-radius: 15px;
    transition: none;
}

.no-photos {
    text-align: center;
    color: #64748b;
    padding: 28px;
    font-size: 15px;
    background: #f8fafc;
    border-radius: 15px;
    outline: 1px solid #e6edf6;
}

.photo-popup-loading {
    margin: 0;
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.photo-popup-details {
    margin-top: 16px;
}

.details-props {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 6px;
    outline: 1px solid #e6edf6;
    border-radius: 15px;
    overflow: hidden;
    background: #fff;
}

.details-props tr:nth-child(odd) {
    background: #f9f9f9;
}

.details-props .prop-name {
    width: 38%;
    min-width: 170px;
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f8;
    color: #5b6880;
    font-size: 13px;
    font-weight: 400;
    vertical-align: top;
}

.details-props .prop-value {
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f8;
    color: #161B2D;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}

.details-props tr:last-child .prop-name,
.details-props tr:last-child .prop-value {
    border-bottom: none;
}

@media (max-width: 768px) {
    .photo-popup-content {
        padding: 14px;
        width: 95%;
        border-radius: 15px;
    }

    .photo-popup-gallery {
        grid-template-columns: 1fr;
    }

    .gallery-image {
        height: 280px;
    }

    .details-props .prop-name,
    .details-props .prop-value {
        display: block;
        width: auto;
        min-width: 0;
    }

    .details-props .prop-name {
        padding-bottom: 4px;
        border-bottom: none;
    }

    .details-props .prop-value {
        padding-top: 0;
    }
}

@media (max-width: 867px) {
    .filters.filters-mobile.listing-top {
        display: flex !important;
        align-items: center;
        gap: 8px;
        width: calc(100% - 24px);
        margin: 10px auto 0;
        padding: 0;
        background: transparent;
        border-radius: 0;
        outline: none;
        position: sticky;
        top: 8px;
        z-index: 90;
        box-sizing: border-box;
    }

    .listing-search {
        flex: 1;
        min-width: 0;
        height: 44px;
        display: flex;
        align-items: center;
        padding: 0 16px;
        border-radius: 22px;
        background: #f2f3f5;
        box-sizing: border-box;
    }

    .listing-search input {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        color: #161B2D;
        font-family: "Unbounded", sans-serif;
        font-size: 14px;
        font-weight: 400;
        outline: none;
    }

    .listing-search input::placeholder {
        color: #9aa1ad;
    }

    button.listing-filter-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        max-width: 44px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #1280D0;
        color: #fff;
        display: grid;
        place-items: center;
        flex: 0 0 44px;
    }

    button.listing-filter-btn:hover {
        background: #0F6FB2;
    }

    button.listing-filter-btn:hover circle {
        fill: #0F6FB2;
    }

    button.listing-filter-btn svg {
        width: 18px;
        height: 18px;
        display: block;
    }
}
