/* Поиск MODNOTAK: подсказка при наборе в шапке Upsell по макету Ярослава 28.10.
   Цвета от темы (светлая и тёмная), графит — только кнопка «Показать все товары». */
.msearch-dd { padding: 0; text-align: left; }
.msearch-sg { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.msearch-sg--wide { grid-template-columns: minmax(0, 1fr); }
.msearch-sg__side { padding: 22px 16px 22px 24px; border-right: 1px solid rgba(128, 128, 128, .18); }
.msearch-sg__main { display: flex; flex-direction: column; min-width: 0; padding: 22px 20px 20px; }
.msearch-sg__title { display: block; padding: 0 0 10px; font-size: 16px; font-weight: 500; line-height: 1.3; opacity: .6; }
.msearch-sg__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.msearch-sg__clear { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: 14px; opacity: .6; cursor: pointer; }
.msearch-sg__clear:hover { opacity: 1; }
.msearch-sg__cat { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; color: inherit; font-size: 16px; line-height: 1.3; text-decoration: none; }
.msearch-sg__cat > span { flex: 1 1 auto; min-width: 0; }
.msearch-sg__cat b { font-weight: inherit; }
.msearch-sg__chev { flex: 0 0 auto; opacity: .5; }
.msearch-sg__cat:hover, .msearch-sg__cat:focus-visible { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.msearch-sg__cat:hover .msearch-sg__chev { opacity: 1; }
.msearch-sg__sep { height: 1px; margin: 16px 0 18px; background: rgba(128, 128, 128, .2); }
.msearch-sg__hist { display: flex; flex-wrap: wrap; gap: 8px; }
.msearch-sg__h { padding: 6px 12px; border: 1px solid rgba(128, 128, 128, .3); border-radius: 16px; color: inherit; font-size: 14px; line-height: 1.3; text-decoration: none; }
.msearch-sg__h:hover, .msearch-sg__h:focus-visible { border-color: currentColor; color: inherit; }
.msearch-sg__list { display: flex; flex-direction: column; gap: 2px; }
.msearch-sg__item { display: flex; align-items: center; gap: 20px; padding: 8px 14px 8px 8px; border-radius: 10px; color: inherit; text-decoration: none; }
/* первая строка подсвечена, пока курсор не на другой */
.msearch-sg__item:first-child, .msearch-sg__item:hover, .msearch-sg__item:focus-visible { background: rgba(128, 128, 128, .1); color: inherit; outline: none; }
.msearch-sg__list:hover .msearch-sg__item:first-child:not(:hover), .msearch-sg__list:focus-within .msearch-sg__item:first-child:not(:focus-visible):not(:hover) { background: none; }
.msearch-sg__img { display: flex; flex: 0 0 96px; align-items: center; justify-content: center; width: 96px; height: 72px; }
.msearch-sg__img img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
[data-up-theme="dark"] .msearch-sg__img { border-radius: 8px; background: #fff; }
.msearch-sg__name { flex: 1 1 auto; min-width: 0; display: -webkit-box; overflow: hidden; font-size: 16px; line-height: 1.4; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msearch-sg__name b { font-weight: 700; }
.msearch-sg__price { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; min-width: 96px; white-space: nowrap; }
.msearch-sg__p { font-size: 18px; font-weight: 700; line-height: 1.3; }
.msearch-sg__old, .msearch-sg__out { font-size: 14px; line-height: 1.3; opacity: .55; }
.msearch-sg__old { text-decoration: line-through; }
.msearch-sg__all { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; margin-top: 14px; padding: 0 16px; border-radius: 10px; background: #1c1b1a; color: #fff; font-size: 16px; font-weight: 600; text-align: center; text-decoration: none; }
.msearch-sg__all:hover, .msearch-sg__all:focus-visible { background: #000; color: #fff; }
.msearch-sg__note { padding: 16px 24px 0; font-size: 15px; line-height: 1.4; opacity: .85; }
.msearch-sg__none { font-size: 16px; line-height: 1.4; }
[data-up-theme="dark"] .msearch-sg__all { background: #f2f1ef; color: #1c1b1a; }
[data-up-theme="dark"] .msearch-sg__all:hover, [data-up-theme="dark"] .msearch-sg__all:focus-visible { background: #fff; color: #1c1b1a; }
.msearch-back { display: none; }

/* ПК: под строкой поиска, не выше окна */
@media (min-width: 1180px) {
    .msearch-dd { max-height: calc(100vh - 140px); overflow: auto; }
}

/* Телефон и планшет: поиск на весь экран, стрелка «назад», одна колонка, кнопка внизу экрана */
@media (max-width: 1179.98px) {
    html.msearch-lock, html.msearch-lock body { overflow: hidden; }
    .js-search.msearch-full { position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; width: auto; height: 100%; margin: 0; padding: 10px 12px 0; background: var(--up-body-bg, #fff); }
    [data-up-theme="dark"] .js-search.msearch-full { background: var(--up-body-dr-bg, #1c1b1a); }
    .msearch-full .msearch-back { display: flex; flex: 0 0 44px; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
    .msearch-full > .msearch-back { position: absolute; top: 10px; left: 6px; }
    .msearch-full > .search__form { flex: 0 0 auto; margin-left: 44px; }
    .msearch-full > .dr-angle-before { display: none !important; }
    .msearch-full > .search__dropdown { position: static !important; display: block !important; flex: 1 1 auto; width: auto !important; max-height: none !important; margin: 8px -12px 0 !important; overflow: auto !important; border-radius: 0 !important; box-shadow: none !important; opacity: 1 !important; visibility: visible !important; transform: none !important; -webkit-overflow-scrolling: touch; }
    .msearch-sg { grid-template-columns: minmax(0, 1fr); }
    .msearch-sg__side { padding: 12px 16px 0; border-right: 0; }
    .msearch-sg__main { padding: 0 16px; }
    .msearch-sg__side + .msearch-sg__main { margin-top: 16px; padding-top: 18px; border-top: 1px solid rgba(128, 128, 128, .2); }
    .msearch-sg__sep { margin: 12px 0 16px; }
    .msearch-sg__item { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 4px 16px; padding: 12px 0; border-radius: 0; border-bottom: 1px solid rgba(128, 128, 128, .15); }
    .msearch-sg__item:first-child, .msearch-sg__item:hover { background: none; }
    .msearch-sg__img { grid-row: 1 / span 2; width: 88px; height: 76px; }
    .msearch-sg__name { font-size: 15px; }
    .msearch-sg__price { flex-direction: row; align-items: baseline; gap: 10px; min-width: 0; }
    .msearch-sg__p { font-size: 17px; }
    .msearch-sg__all { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); min-height: 52px; margin: 14px 0 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
    .msearch-sg__note { padding: 8px 16px 0; }
    .msearch-sg__none { padding: 16px 0; }
}
