/* Триггер в шапке */
.header__search-toggle {
	width: 36px;
	height: 33px;
	margin-right: 12px;
	padding: 0;
	background: transparent;
	border: 0;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: color .3s cubic-bezier(.785,.135,.15,.86);
}
.header__search-toggle:hover { color: #e05100; }
.header__search-toggle svg { display: block; }

/* Сжимаем отступ между меню и лупами, чтобы всё влезло */
.header__bottom .header__wrapper .main-nav {
	margin-right: 20px;
}
.header__bottom .main-nav > ul > li {
	margin-right: 28px;
}
.header__bottom .main-nav > ul > li:last-child {
	margin-right: 0;
}

@media (max-width: 1366px) {
	.header__bottom .header__wrapper .main-nav {
		margin-right: 14px;
	}
	.header__bottom .main-nav > ul > li {
		margin-right: 20px;
		font-size: 14px;
	}
	.header__search-toggle {
		margin-right: 10px;
	}
}

@media (max-width: 1200px) {
	.header__search-toggle {
		margin-right: 12px;
	}
}

@media (max-width: 576px) {
	.header__search-toggle {
		width: 30px;
		height: 28px;
		margin-right: 10px;
	}
}

body.peletto-ps-open,
body.peletto-ps-modal-open { overflow: hidden; }

/* ── Оверлей поиска ────────────────────────────────────── */
.peletto-ps {
	position: fixed; inset: 0;
	z-index: 999999;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding-top: 8vh;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
	font-family: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.peletto-ps.is-open { opacity: 1; pointer-events: auto; }
.peletto-ps__backdrop {
	position: absolute; inset: 0;
	background: rgba(0,0,0,.72);
	backdrop-filter: saturate(180%) blur(8px);
	-webkit-backdrop-filter: saturate(180%) blur(8px);
}
.peletto-ps__panel {
	position: relative;
	width: min(720px, calc(100% - 32px));
	max-height: 80vh;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 24px 60px rgba(0,0,0,.35), 0 4px 12px rgba(0,0,0,.1);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: translateY(-8px) scale(.98);
	transition: transform .22s cubic-bezier(.2,.9,.3,1.1);
}
.peletto-ps.is-open .peletto-ps__panel { transform: translateY(0) scale(1); }

/* Ввод */
.peletto-ps__head {
	position: relative;
	display: flex; align-items: center; gap: 12px;
	padding: 16px 20px;
	border-bottom: 1px solid #eee;
}
.peletto-ps__icon { width: 22px; height: 22px; color: #999; flex-shrink: 0; }
.peletto-ps__input {
	flex: 1;
	border: 0; outline: 0;
	background: transparent;
	font: inherit; font-size: 17px; color: #000;
	padding: 4px 0;
}
.peletto-ps__input::placeholder { color: #aaa; }
.peletto-ps__spinner {
	width: 18px; height: 18px;
	border: 2px solid #eee;
	border-top-color: #e05100;
	border-radius: 50%;
	opacity: 0; transition: opacity .15s;
	animation: peletto-ps-spin .7s linear infinite;
	flex-shrink: 0;
}
.peletto-ps__spinner.is-visible { opacity: 1; }
@keyframes peletto-ps-spin { to { transform: rotate(360deg); } }

.peletto-ps__close {
	width: 32px; height: 32px; padding: 0;
	background: transparent; border: 0; border-radius: 6px;
	color: #999; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	transition: background .15s, color .15s;
}
.peletto-ps__close:hover { background: #f5f5f5; color: #000; }

/* Тело */
.peletto-ps__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0; }
.peletto-ps__body::-webkit-scrollbar { width: 10px; }
.peletto-ps__body::-webkit-scrollbar-thumb {
	background: rgba(0,0,0,.15);
	border: 3px solid transparent;
	background-clip: content-box;
	border-radius: 8px;
}

/* Недавние */
.peletto-ps__recent { padding: 8px 12px; }
.peletto-ps__recent-head {
	display: flex; justify-content: space-between; align-items: center;
	padding: 8px 8px 4px;
	font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
	color: #999; font-weight: 600;
}
.peletto-ps__recent-clear {
	background: transparent; border: 0; color: #999;
	font: inherit; font-size: 11px; letter-spacing: 0; text-transform: none;
	cursor: pointer; padding: 4px 6px; border-radius: 4px;
}
.peletto-ps__recent-clear:hover { background: #f5f5f5; color: #333; }
.peletto-ps__recent-list { margin: 0; padding: 0; list-style: none; }
.peletto-ps__recent-item {
	display: flex; align-items: center; gap: 10px;
	width: 100%; padding: 10px 12px;
	background: transparent; border: 0; border-radius: 6px;
	color: #333; font: inherit; font-size: 14px; text-align: left;
	cursor: pointer; transition: background .12s;
}
.peletto-ps__recent-item:hover { background: #f5f5f5; }
.peletto-ps__recent-item svg { color: #bbb; flex-shrink: 0; }

/* Результаты */
.peletto-ps__list { margin: 0; padding: 4px 8px; list-style: none; }
.peletto-ps__item { border-radius: 8px; transition: background .12s; }
.peletto-ps__item.is-active,
.peletto-ps__item:hover { background: #f5f5f5; }
.peletto-ps__item-link {
	display: grid;
	grid-template-columns: 60px 1fr auto;
	align-items: center; gap: 14px;
	padding: 10px 12px;
	text-decoration: none; color: inherit;
}
.peletto-ps__item-img {
	position: relative;
	width: 60px; height: 60px;
	border-radius: 6px; overflow: hidden;
	background: #f5f5f5; flex-shrink: 0;
}
.peletto-ps__item-img img {
	width: 100%; height: 100%;
	object-fit: cover; display: block;
}
.peletto-ps__sale {
	position: absolute; top: 4px; left: 4px;
	padding: 2px 6px;
	background: #e05100; color: #fff;
	font: 700 9px/1 Montserrat, sans-serif;
	font-style: normal; letter-spacing: .05em; text-transform: uppercase;
	border-radius: 3px;
}
.peletto-ps__item-body { min-width: 0; }
.peletto-ps__item-title {
	display: block; font-size: 15px; font-weight: 500; color: #000;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.peletto-ps__item-meta {
	display: flex; gap: 10px; margin-top: 3px;
	font-size: 12px; color: #999;
	overflow: hidden;
}
.peletto-ps__item-meta > span {
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.peletto-ps__sku { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.peletto-ps__item-prices {
	display: flex; flex-direction: column;
	align-items: flex-end; text-align: right;
}
.peletto-ps__price-brutto { font-size: 14px; font-weight: 700; color: #e05100; }
.peletto-ps__price-netto  { font-size: 12px; color: #999; margin-top: 2px; }

/* Показать все */
.peletto-ps__all {
	display: block;
	margin: 4px 16px 12px;
	padding: 12px;
	text-align: center;
	font-size: 14px; font-weight: 600;
	color: #e05100; text-decoration: none;
	background: #fff5ef;
	border-radius: 8px;
	transition: background .15s;
}
.peletto-ps__all:hover { background: #ffe6d5; }

/* Пусто */
.peletto-ps__empty { padding: 48px 24px; text-align: center; color: #999; }
.peletto-ps__empty svg { color: #ddd; margin-bottom: 12px; }
.peletto-ps__empty p { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: #333; }
.peletto-ps__empty span { font-size: 13px; }

/* Скелетон */
.peletto-ps__skel-wrap { padding: 8px; }
.peletto-ps__skel {
	display: grid; grid-template-columns: 60px 1fr;
	gap: 14px; padding: 12px; align-items: center;
}
.peletto-ps__skel-img {
	width: 60px; height: 60px; border-radius: 6px;
	background: #f0f0f0; animation: peletto-ps-pulse 1.4s ease-in-out infinite;
}
.peletto-ps__skel-lines { display: flex; flex-direction: column; gap: 8px; }
.peletto-ps__skel-lines i {
	display: block; height: 12px; border-radius: 4px;
	background: #f0f0f0; animation: peletto-ps-pulse 1.4s ease-in-out infinite;
}
.peletto-ps__skel-lines i:first-child { width: 60%; }
.peletto-ps__skel-lines i:last-child  { width: 35%; }
@keyframes peletto-ps-pulse {
	0%, 100% { opacity: 1; } 50% { opacity: .5; }
}

/* ── Модалка превью товара ─────────────────────────────── */
.peletto-ps-modal {
	position: fixed; inset: 0;
	z-index: 1000000;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 24px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
	font-family: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.peletto-ps-modal.is-open { opacity: 1; pointer-events: auto; }
.peletto-ps-modal__backdrop {
	position: absolute; inset: 0;
	background: rgba(0,0,0,.8);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}
.peletto-ps-modal__panel {
	position: relative;
	width: min(880px, 100%);
	max-height: 90vh;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 30px 80px rgba(0,0,0,.5);
	overflow: hidden;
	display: grid;
	grid-template-columns: 1fr 1fr;
	transform: translateY(12px) scale(.97);
	transition: transform .25s cubic-bezier(.2,.9,.3,1.1);
}
.peletto-ps-modal.is-open .peletto-ps-modal__panel {
	transform: translateY(0) scale(1);
}
.peletto-ps-modal__close {
	position: absolute; top: 14px; right: 14px;
	width: 36px; height: 36px; padding: 0;
	background: #fff; border: 0; border-radius: 50%;
	color: #333; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 2px 8px rgba(0,0,0,.15);
	z-index: 2;
	transition: background .15s, transform .15s;
}
.peletto-ps-modal__close:hover { background: #f5f5f5; transform: scale(1.05); }
.peletto-ps-modal__img {
	background: #f5f5f5;
	display: flex; align-items: center; justify-content: center;
	overflow: hidden;
	min-height: 280px;
}
.peletto-ps-modal__img img {
	width: 100%; height: 100%;
	max-height: 90vh;
	object-fit: contain;
	display: block;
}
.peletto-ps-modal__info {
	padding: 32px 32px 28px;
	display: flex; flex-direction: column;
	overflow-y: auto;
	gap: 10px;
}
.peletto-ps-modal__cat {
	font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
	color: #999; font-weight: 600;
}
.peletto-ps-modal__title {
	margin: 0;
	font-size: 22px; font-weight: 700; color: #000;
	line-height: 1.25;
}
.peletto-ps-modal__sku {
	font-size: 12px; color: #999;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.peletto-ps-modal__desc {
	font-size: 14px; line-height: 1.55; color: #555;
	margin: 4px 0 8px;
	max-height: 160px;
	overflow: hidden;
}
.peletto-ps-modal__desc p { margin: 0 0 8px; }
.peletto-ps-modal__desc p:last-child { margin-bottom: 0; }
.peletto-ps-modal__desc ul, .peletto-ps-modal__desc ol { margin: 0 0 8px; padding-left: 20px; }
.peletto-ps-modal__desc li { list-style: disc; }
.peletto-ps-modal__prices {
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid #eee;
	display: flex; flex-direction: column; gap: 4px;
}
.peletto-ps-modal__price-brutto {
	font-size: 22px; font-weight: 700; color: #e05100;
}
.peletto-ps-modal__price-netto {
	font-size: 13px; color: #777;
}
.peletto-ps-modal__actions {
	display: flex; flex-wrap: wrap; gap: 10px;
	padding-top: 14px;
}
.peletto-ps-modal__add {
	flex: 1 1 auto;
	min-height: 46px;
	padding: 12px 22px;
	background: #e05100; color: #fff;
	border: 0; border-radius: 4px;
	font: 700 13px/1 Montserrat, sans-serif;
	letter-spacing: .08em; text-transform: uppercase;
	cursor: pointer;
	transition: background .2s, transform .2s;
}
.peletto-ps-modal__add:hover:not(:disabled) { background: #c44600; }
.peletto-ps-modal__add:disabled,
.peletto-ps-modal__add.is-disabled {
	background: #ddd; color: #888;
	cursor: not-allowed;
}
.peletto-ps-modal__more {
	flex: 1 1 auto;
	min-height: 46px;
	padding: 12px 22px;
	background: transparent;
	color: #333;
	border: 1px solid #ddd; border-radius: 4px;
	font: 700 13px/1 Montserrat, sans-serif;
	letter-spacing: .08em; text-transform: uppercase;
	text-decoration: none;
	display: inline-flex; align-items: center; justify-content: center;
	transition: background .15s, border-color .15s;
}
.peletto-ps-modal__more:hover { background: #f5f5f5; border-color: #bbb; }
.peletto-ps-modal__toast {
	margin-top: 10px;
	padding: 10px 14px;
	background: #e7f6ec; color: #1a7a3a;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity .2s, transform .2s;
	pointer-events: none;
}
.peletto-ps-modal__toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* ── Мобильные ─────────────────────────────────────────── */
@media (max-width: 640px) {
	.peletto-ps { padding-top: 0; align-items: stretch; }
	.peletto-ps__panel {
		width: 100%; max-height: 100vh;
		border-radius: 0;
	}
	.peletto-ps__item-link { grid-template-columns: 52px 1fr; gap: 10px; }
	.peletto-ps__item-img  { width: 52px; height: 52px; }
	.peletto-ps__item-prices { grid-column: 2; align-items: flex-start; margin-top: 4px; }
	.peletto-ps__price-brutto { font-size: 13px; }
	.peletto-ps__price-netto  { font-size: 11px; }

	.peletto-ps-modal { padding: 0; align-items: stretch; }
	.peletto-ps-modal__panel {
		width: 100%; max-height: 100vh;
		border-radius: 0;
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
	}
	.peletto-ps-modal__img {
		min-height: 40vh;
		max-height: 50vh;
	}
	.peletto-ps-modal__img img {
		max-height: 50vh;
	}
	.peletto-ps-modal__info {
		padding: 20px 18px 100px;
	}
	.peletto-ps-modal__title { font-size: 18px; }
	.peletto-ps-modal__desc  { max-height: none; }
	.peletto-ps-modal__price-brutto { font-size: 20px; }

	.peletto-ps-modal__actions {
		position: fixed;
		left: 0; right: 0; bottom: 0;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
		background: #fff;
		box-shadow: 0 -4px 16px rgba(0,0,0,.08);
		z-index: 3;
	}
	.peletto-ps-modal__add,
	.peletto-ps-modal__more {
		min-height: 48px;
		font-size: 12px;
	}
	.peletto-ps-modal__close {
		top: 10px; right: 10px;
		width: 40px; height: 40px;
	}
}

/* На странице поиска — плитки категорий после товаров */
body.search .main-items__content .categories__items {
	margin-top: 60px !important;
	margin-bottom: 0 !important;
	padding-top: 40px;
	border-top: 1px solid #eee;
}

/* На странице поиска — сжимаем отступы у переехавших блоков */
body.search .main-items__content .title.title_main {
	margin-bottom: 0 !important;
}

body.search .main-items__content .categories__items.mb-80,
body.search .main-items__content .categories__items {
	padding-top: 0 !important;
}