/* Иконка-триггер поиска в шапке (десктоп и мобайл) */
.bydoors-search-trigger {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s ease;
}
.bydoors-search-trigger:hover,
.bydoors-search-trigger:focus-visible {
    background: rgba(140, 37, 31, 0.08);
    outline: none;
}
.bydoors-search-trigger svg {
    width: 22px;
    height: 22px;
    display: block;
}
.bydoors-headerright__search {
    margin-right: 14px;
}
.bydoors-headerright__search svg {
    width: 24px;
    height: 24px;
}
.bydoors-mobicons .bydoors-search-trigger {
    width: 38px;
    height: 38px;
    padding: 8px;
}

/* Overlay */
.bydoors-search {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.bydoors-search[hidden] { display: none; }

.bydoors-search__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.bydoors-search__panel {
    position: relative;
    margin-top: 8vh;
    width: min(720px, calc(100vw - 32px));
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.bydoors-search__field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}
.bydoors-search__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}
.bydoors-search__input {
    flex: 1;
    border: none;
    outline: none;
    font: inherit;
    font-size: 18px;
    background: transparent;
    color: #333;
    padding: 6px 0;
    min-width: 0;
}
.bydoors-search__input::placeholder { color: #999; }
.bydoors-search__close {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}
.bydoors-search__close:hover { background: rgba(140, 37, 31, 0.08); }
.bydoors-search__close svg { width: 22px; height: 22px; }

.bydoors-search__results {
    overflow-y: auto;
    flex: 1;
}

.bydoors-search__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f4f4f4;
    transition: background 0.12s ease;
}
.bydoors-search__item:last-child { border-bottom: none; }
.bydoors-search__item:hover,
.bydoors-search__item:focus-visible,
.bydoors-search__item.is-active {
    background: #f8f3f2;
    outline: none;
}
.bydoors-search__thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 6px;
    background: #f3f3f3 center/cover no-repeat;
}
.bydoors-search__meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.bydoors-search__title {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bydoors-search__title mark {
    background: #ffe9bf;
    color: inherit;
    padding: 0;
}
.bydoors-search__cat {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}
.bydoors-search__price {
    font-size: 15px;
    font-weight: 500;
    color: #8c251f;
    flex-shrink: 0;
    white-space: nowrap;
}

.bydoors-search__status {
    padding: 14px 16px;
    color: #888;
    font-size: 14px;
    border-top: 1px solid #f4f4f4;
}
.bydoors-search__status:empty { display: none; }

/* Mobile tweaks */
@media (max-width: 640px) {
    .bydoors-search__panel {
        margin-top: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .bydoors-search__input { font-size: 16px; }
    .bydoors-search__thumb { width: 48px; height: 48px; }
}

/* Прячем триггер на десктопе для мобильной шапки и наоборот */
@media (min-width: 981px) {
    .bydoors-mobicons .bydoors-search-trigger { display: none; }
}
@media (max-width: 980px) {
    .bydoors-headerright__search { display: none; }
}
