/* ============================================================
   Custom Search — финальная версия
   Палитра: #fff, #0055c0, #ff6600
   ============================================================ */

#custom-search-results {
    position: fixed !important;
    z-index: 99999;
    background: #ffffff !important;
    color: #1a1f2b !important;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(16,24,40,.08), 0 20px 40px rgba(16,24,40,.10);
    border: 1px solid #e6ebf2;
    max-height: 560px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease;
    color-scheme: light !important;
    forced-color-adjust: none;
}

#custom-search-results.is-open {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

#custom-search-results *,
#custom-search-results *::before,
#custom-search-results *::after {
    color-scheme: light !important;
    forced-color-adjust: none;
    box-sizing: border-box;
}

/* Скроллбар */
#custom-search-results::-webkit-scrollbar { width: 8px; }
#custom-search-results::-webkit-scrollbar-track { background: transparent; }
#custom-search-results::-webkit-scrollbar-thumb {
    background: #d6dde8;
    border-radius: 4px;
    border: 2px solid #ffffff;
}

/* ===== Хедер ===== */
.custom-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 6px;
    font-size: 12px;
    color: #5b6474;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.custom-search-header__count {
    color: #9aa3b2;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* ===== Карточка товара ===== */
.custom-search-item {
    display: flex !important;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none !important;
    color: #1a1f2b !important;
    background: #ffffff !important;
    transition: background .15s ease;
    position: relative;
    cursor: pointer;
    border: none;
}
.custom-search-item:hover,
.custom-search-item.is-active {
    background: #eef3fb !important;
}
.custom-search-item:active {
    background: #e3ebf7 !important;
}
.custom-search-item:focus-visible {
    outline: 2px solid #0055c0;
    outline-offset: -2px;
}

/* Картинка */
.custom-search-item__img-wrap {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f4f7fc !important;
    border: 1px solid #e6ebf2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.custom-search-item__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.custom-search-item__noimg {
    color: #9aa3b2 !important;
    opacity: .55;
    display: flex;
    align-items: center;
    justify-content: center;
}
.custom-search-item__noimg svg { width: 22px; height: 22px; }

/* Текст — строго по левому краю */
.custom-search-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-start;
    text-align: left !important;
}
.custom-search-item__title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: #1a1f2b !important;
    text-align: left !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
}
.custom-search-item__title mark {
    background: rgba(255,102,0,.20) !important;
    color: #1a1f2b !important;
    padding: 0 1px;
    border-radius: 2px;
}
.custom-search-item__article {
    font-size: 12px;
    color: #5b6474 !important;
    text-align: left !important;
}

/* Цена */
.custom-search-item__price-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}
.custom-search-item__price {
    font-size: 15px;
    font-weight: 700;
    color: #0055c0 !important;
    white-space: nowrap;
}

/* ===== Пусто ===== */
.custom-search-empty {
    padding: 36px 20px;
    text-align: center;
    color: #5b6474 !important;
    font-size: 14px;
    line-height: 1.5;
}
.custom-search-empty svg {
    display: block;
    margin: 0 auto 12px;
    width: 40px;
    height: 40px;
    opacity: .35;
    color: #9aa3b2 !important;
}
.custom-search-empty strong { color: #1a1f2b !important; font-weight: 600; }

/* ===== Кнопка «Все результаты» ===== */
#custom-search-all-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    margin: 6px 4px 2px;
    border-radius: 10px;
    background: #ff6600 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    transition: background .15s ease;
}
#custom-search-all-btn:hover { background: #e65c00 !important; }

/* ===== Skeleton ===== */
.custom-search-skeleton {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
}
.custom-search-skeleton__img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: #eef1f6 !important;
    flex-shrink: 0;
    animation: cs-pulse 1.2s ease-in-out infinite;
}
.custom-search-skeleton__lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.custom-search-skeleton__line {
    height: 12px;
    border-radius: 6px;
    background: #eef1f6 !important;
    animation: cs-pulse 1.2s ease-in-out infinite;
}
.custom-search-skeleton__line--short { width: 40%; }
@keyframes cs-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .5; }
}

/* ===== История ===== */
.custom-search-history__title {
    padding: 10px 14px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9aa3b2 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.custom-search-history__clear {
    background: none;
    border: none;
    color: #5b6474 !important;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.custom-search-history__clear:hover {
    background: #eef3fb !important;
    color: #1a1f2b !important;
}
.custom-search-history__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 10px;
    color: #1a1f2b !important;
    text-decoration: none !important;
    font-size: 14px;
    cursor: pointer;
    background: none !important;
    border: none;
    width: 100%;
    text-align: left;
}
.custom-search-history__item:hover { background: #eef3fb !important; }
.custom-search-history__item svg {
    width: 16px;
    height: 16px;
    color: #9aa3b2 !important;
    flex-shrink: 0;
}

/* ===== Мобильные ===== */
@media (max-width: 768px) {
    #custom-search-results {
        position: fixed !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-height: 80vh;
        border-radius: 20px 20px 0 0;
    }
    .custom-search-item__img-wrap { width: 52px; height: 52px; }
}