/* Мгновенный поиск: дропдаун в шапке + страница /search/ (MTSPB-104) */

form.search { position: relative; }

.search-drop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 340px;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    background: var(--surface-elev, #16161a);
    border: 1px solid var(--border-strong, rgba(255,255,255,.14));
    border-radius: var(--radius-lg, 14px);
    box-shadow: 0 18px 48px rgba(0,0,0,.55);
    z-index: 1200;
    padding: 6px;
}

.search-drop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm, 8px);
    text-decoration: none;
    color: var(--text, #f2f2f2);
}
.search-drop-item:hover,
.search-drop-item.is-active,
.search-drop-all.is-active { background: var(--surface, rgba(255,255,255,.06)); }

.search-drop-img {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
}
.search-drop-noimg { background: var(--surface, rgba(255,255,255,.06)); }

.search-drop-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.search-drop-name {
    font-size: 13.5px;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.search-drop-meta { font-size: 11.5px; color: var(--text-mute, #8a8a93); }

.search-drop-price {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--accent, #ff6a00);
}
.search-drop-price.is-order { color: var(--text-mute, #8a8a93); font-weight: 500; }

.search-drop-item.is-section .search-drop-name { font-weight: 600; }
.search-drop-sect-ico { flex: 0 0 auto; font-size: 16px; }

.search-drop-all {
    display: block;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent, #ff6a00);
    text-decoration: none;
    border-top: 1px solid var(--border, rgba(255,255,255,.08));
    margin-top: 4px;
}

.search-drop-empty {
    padding: 18px 14px;
    font-size: 13px;
    color: var(--text-mute, #8a8a93);
    text-align: center;
}

@media (max-width: 720px) {
    .search-drop { position: fixed; left: 8px; right: 8px; top: 64px; min-width: 0; }
}

/* --- мобильная шапка: поиск иконкой, по тапу — строка на всю ширину (MTSPB-107) --- */
@media (max-width: 767px) {
    .header-inner { position: relative; }

    form.search {
        width: 44px;
        height: 44px;
        justify-self: end;
        flex: 0 0 auto;
    }
    form.search:not(.is-open) { cursor: pointer; }
    form.search:not(.is-open) .search-ico {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        color: var(--text, #f2f2f2);
    }
    form.search:not(.is-open) input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }
    form.search:not(.is-open) .search-drop { display: none; }

    form.search.is-open {
        position: absolute;
        left: 8px;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        width: auto;
        height: 48px;
        max-width: none;
        justify-self: stretch; /* иначе justify-self:end даёт shrink-to-fit у absolute грид-ребёнка */
        z-index: 260;
        animation: search-slide-in .18s var(--easing, ease) both;
    }
    form.search.is-open input {
        background: var(--bg, #0a0a0a);
        border-color: var(--accent, #ff6a00);
    }
    form.search.is-open .search-ico { left: 16px; top: 50%; transform: translateY(-50%); }

    @keyframes search-slide-in {
        from { opacity: 0; transform: translateY(-50%) scaleX(.92); }
        to   { opacity: 1; transform: translateY(-50%) scaleX(1); }
    }

    .search-drop { top: 72px; }
}

/* --- страница /search/ --- */
.search-page-head { padding: 28px 0 8px; }
.search-page-head h1 { margin: 0 0 6px; }
.search-page-sub { color: var(--text-mute, #8a8a93); font-size: 14px; }
.search-page-empty {
    padding: 48px 0 64px;
    color: var(--text-dim, #b5b5bd);
    font-size: 15px;
    line-height: 1.6;
}
