/* gw12-search */
/* Страница /search/ — макет «Работа с поиском Web», узел 1039:65685 / search-frames.
   Разметка: template/product/search.tpl. Карточки специалистов (.offers_list
   .sp-card) уже стилизованы общими правилами figma-home/figma-redesign — здесь
   hero-форма, AI-pill, чипсы, meta, empty + mobile overrides that must beat
   gw19-cathero (loads later) via body.product-search .cat_hero.cat_hero. */

/* overflow: bare PHP fatals / long error text blew body past 390 */
body.product-search,
body.product-search #content,
body.product-search .page_search{
	max-width:100%;
	overflow-x:hidden;
	box-sizing:border-box;
}
/* Compact search hero — beat gw19 .page_category .cat_hero.cat_hero.cat_hero
   (padding 40/180 + margin-bottom:-100 catalog card-overlap). Search shell is
   a short blue cap, not the tall category upper-cap. */
body.product-search .page_search .cat_hero.cat_hero.cat_hero,
body.product-search .page_category.page_search .cat_hero.cat_hero.cat_hero{
	padding:32px 0 40px !important;
	margin-bottom:0 !important;
	min-height:0;
}
body.product-search .cat_hero{ padding-bottom:40px; }

/* Title stack: display name + SEO h1 — beat gw19 .cat_hero.cat_hero type */
body.product-search .cat_hero.cat_hero .cat_hero__name{
	font-size:40px !important;
	line-height:1.15 !important;
	font-weight:300;
	margin:8px 0 10px;
	color:#fff;
	text-align:center;
}
body.product-search .cat_hero.cat_hero h1.home-widget-title{
	font-size:18px !important;
	line-height:1.35 !important;
	font-weight:400 !important;
	margin:0 auto 18px !important;
	opacity:.92;
	color:rgba(255,255,255,.92);
	text-align:center;
	text-transform:none !important;
}
body.product-search .cat_hero.cat_hero .breadcrumb{
	margin-bottom:16px !important;
}

/* ---------- форма поиска (белый бар, как Figma Search group) ---------- */
body.product-search .cat_hero.cat_hero .cat_hero__srch,
body.product-search .cat_hero__srch,
body.product-search .cat_hero__ai-wrap{
	max-width:980px;
}
body.product-search .cat_hero.cat_hero .cat_hero__srch,
body.product-search .cat_hero__srch{
	display:flex;
	align-items:center;
	gap:10px;
	max-width:980px;
	margin:22px auto 0;
	padding:6px;
	background:#fff;
	border-radius:10px;
	flex-wrap:nowrap;
	box-sizing:border-box;
}
body.product-search .cat_hero.cat_hero .cat_hero__field,
body.product-search .cat_hero__field{
	flex:1 1 auto;
	min-width:0;
	background:#f2f4f8;
	border-radius:8px;
	padding:0 14px;
	display:flex;
	align-items:center;
}
body.product-search .cat_hero__field input{
	width:100%;
	border:none;
	background:none;
	outline:none;
	height:48px;
	font-size:16px;
	color:var(--fg-navy,#0b2f7a);
	font-family:inherit;
}
body.product-search .cat_hero__field input::placeholder{ color:#8b93ab; }
body.product-search .cat_hero__field input::-webkit-search-cancel-button{ display:none; }

body.product-search .cat_hero.cat_hero .cat_hero__btn,
body.product-search .cat_hero__btn{
	flex:0 0 auto;
	display:inline-flex;
	align-items:center;
	justify-content:center;
	gap:8px;
	height:48px;
	padding:0 22px;
	border:none;
	border-radius:10px;
	background:var(--fg-blue,#0066b2);
	color:#fff;
	font-size:16px;
	font-weight:500;
	cursor:pointer;
	white-space:nowrap;
	width:auto;
	max-width:none;
	box-sizing:border-box;
}
body.product-search .cat_hero__btn:hover{ background:#00538f; }
body.product-search .cat_hero__btn svg{ flex:0 0 auto; }

body.product-search .cat_hero.cat_hero .cat_hero__settings,
body.product-search .cat_hero__settings{
	flex:0 0 auto;
	width:48px;
	height:48px;
	border-radius:10px;
	background:transparent;
	border:1px solid #d7deea;
	color:var(--fg-blue,#0066b2);
	display:flex;
	align-items:center;
	justify-content:center;
	cursor:pointer;
	padding:0;
	box-sizing:border-box;
}
body.product-search .cat_hero__settings:hover,
body.product-search .cat_hero__settings[aria-expanded="true"]{
	background:#eaf2fb;
	border-color:#b8c7de;
}

/* ---------- AI поиск (G47 — визуальный элемент, без отдельного бэкенда) --- */
body.product-search .cat_hero__ai-wrap{
	max-width:720px;
	margin:14px auto 0;
	text-align:right;
}
body.product-search .cat_hero__ai{
	display:inline-flex;
	align-items:center;
	gap:6px;
	padding:9px 20px;
	border-radius:999px;
	background:#fff;
	border:1px solid #ff7a3d;
	color:#ff7a3d;
	font-size:14px;
	font-weight:600;
	cursor:pointer;
	box-sizing:border-box;
}
body.product-search .cat_hero__ai:hover{ background:#fff5ef; }
body.product-search .cat_hero__ai::before{ content:"✦"; font-size:12px; }

/* ---------- панель настроек (шестерёнка -> «искать в описании») --------- */
body.product-search .cat_hero__settings-panel{
	max-width:720px;
	margin:0 auto;
	overflow:hidden;
	max-height:0;
	opacity:0;
	transition:max-height .2s ease, opacity .2s ease, margin .2s ease;
}
body.product-search .cat_hero__settings-panel.is-open{
	max-height:80px;
	opacity:1;
	margin-top:14px;
}
body.product-search .cat_hero__settings-panel .search_descr{
	display:flex;
	align-items:center;
	gap:8px;
	background:rgba(255,255,255,.12);
	border:1px solid rgba(255,255,255,.3);
	border-radius:10px;
	padding:12px 16px;
	color:#fff;
	font-size:14px;
	cursor:pointer;
}
body.product-search .cat_hero__settings-panel .search_descr input{ width:16px; height:16px; }

/* ---------- популярные запросы (чипсы) ---------- */
body.product-search .cat_hero__popular{
	max-width:900px;
	margin:26px auto 0;
	text-align:center;
}
body.product-search .cat_hero__popular-label{
	color:rgba(255,255,255,.75);
	font-size:13px;
	margin-bottom:11px;
}
body.product-search .cat_hero__chips{
	display:flex;
	flex-wrap:wrap;
	justify-content:center;
	gap:10px;
}
body.product-search .cat_hero__chips a{
	display:inline-block;
	padding:9px 18px;
	border-radius:999px;
	background:rgba(255,255,255,.1);
	border:1px solid rgba(255,255,255,.32);
	color:#fff;
	font-size:14px;
	line-height:1.2;
	text-decoration:none;
}
body.product-search .cat_hero__chips a:hover{
	background:#fff;
	border-color:#fff;
	color:var(--fg-navy,#0b2f7a);
}

/* ---------- метаданные + сетка карточек ---------- */
body.product-search .search_meta{
	margin:20px 0 16px;
	font-size:14px;
	line-height:1.4;
	color:var(--fg-muted,#5b6d9c);
	position:relative;
	z-index:2;
}
body.product-search .offers_list{
	display:grid;
	grid-template-columns:repeat(3,minmax(0,1fr));
	gap:24px;
	align-items:stretch;
	width:100%;
	max-width:100%;
	margin:0;
	box-sizing:border-box;
}
/* Grid already has gap — kill Bootstrap-ish item padding (double gutters) */
body.product-search .offers_list .item{
	display:flex;
	flex-direction:column;
	padding:0 !important;
	margin:0;
	min-width:0;
	max-width:100%;
	height:100%;
}
body.product-search .offers_list .item_inner.sp-card{
	display:flex;
	flex-direction:column;
	height:100%;
	min-height:100%;
	flex:1 1 auto;
	box-sizing:border-box;
}
body.product-search .offers_list .sp-card .texts{
	flex:1 1 auto;
	min-height:0;
}
body.product-search .offers_list .sp-card .location{
	min-height:44px;
}
body.product-search .offers_list .sp-card .contacts_wrap{
	margin-top:auto;
	flex:0 0 auto;
	display:flex;
	flex-direction:column;
	gap:8px;
}
/* Avatar: figma-redesign baseline 170px — beat gw18 83.33%/max 290 (~263 on 350 card) */
body.product-search .offers_list .item_inner.item_inner .img{
	width:170px !important;
	max-width:170px !important;
	height:170px !important;
	margin:8px auto 12px;
	aspect-ratio:1 / 1;
}
body.product-search .offers_list .item_inner.item_inner .img>a:not(.js-add-wishlist){
	padding:5px;
	box-sizing:border-box;
}
/* Long SEO titles: wrap mid-word rather than hard cut mid-token */
body.product-search .offers_list .sp-card .name,
body.product-search .offers_list .sp-card .name a{
	overflow-wrap:anywhere;
	word-break:break-word;
	-webkit-line-clamp:2;
	line-clamp:2;
}
/* Description clamp 4 lines, centered card rhythm + wrap anywhere */
body.product-search .offers_list .sp-card .text{
	display:-webkit-box;
	-webkit-line-clamp:4;
	line-clamp:4;
	-webkit-box-orient:vertical;
	overflow:hidden;
	overflow-wrap:anywhere;
	text-align:center;
	height:88px;
	min-height:88px;
	max-height:88px;
}
body.product-search .search_pagination{ margin:28px 0 6px; }

/* ---------- пустой результат ---------- */
body.product-search .search_empty{
	max-width:640px;
	margin:64px auto;
	text-align:center;
}
body.product-search .search_empty-title{
	font-size:28px;
	font-weight:500;
	color:var(--fg-navy,#0b2f7a);
	margin-bottom:14px;
}
body.product-search .search_empty p{
	color:var(--fg-muted,#5b6d9c);
	font-size:15px;
	line-height:1.6;
	margin-bottom:26px;
}
body.product-search .search_empty-btn{
	display:inline-flex;
	margin:0;
	background:var(--fg-blue,#0066b2);
	color:#fff;
	border:none;
	padding:0 28px;
	height:52px;
	align-items:center;
	border-radius:10px;
	font-size:15px;
	font-weight:500;
	text-decoration:none;
	width:auto;
	max-width:100%;
	box-sizing:border-box;
}
body.product-search .search_empty-btn:hover{ background:#00538f; }

/* =====================================================================
   ≤1024 / ≤860 — планшет: 2-col cards, form stays one row when possible
   (gw19 + figma-home wrap the bar — re-force nowrap with higher specificity)
   ===================================================================== */
@media (max-width:1024px){
	body.product-search .page_search .cat_hero.cat_hero.cat_hero,
	body.product-search .page_category.page_search .cat_hero.cat_hero.cat_hero{
		padding:28px 0 32px !important;
		margin-bottom:0 !important;
	}
	body.product-search .cat_hero{ padding-bottom:32px; }
	body.product-search .cat_hero.cat_hero .cat_hero__name{
		font-size:32px !important;
	}
	body.product-search .offers_list{
		grid-template-columns:repeat(2,minmax(0,1fr));
		gap:14px;
	}
	body.product-search .offers_list .item_inner.item_inner .img{
		width:140px !important;
		max-width:140px !important;
		height:140px !important;
	}
	body.product-search .cat_hero__ai-wrap{ margin-top:12px; }
	body.product-search .cat_hero__popular{ text-align:left; margin-top:20px; }
	body.product-search .cat_hero__popular-label{ text-align:left; }
	body.product-search .cat_hero__chips{ justify-content:flex-start; }
}

@media (max-width:860px){
	/* Figma mobile: single white bar — input + icon-search + gear */
	body.product-search .cat_hero.cat_hero .cat_hero__srch,
	body.product-search .cat_hero__srch{
		flex-wrap:nowrap !important;
		max-width:100%;
		width:100%;
		margin-top:16px;
		gap:8px;
		padding:6px;
		align-items:center;
	}
	body.product-search .cat_hero.cat_hero .cat_hero__field,
	body.product-search .cat_hero__field{
		flex:1 1 auto !important;
		order:1;
		min-width:0;
		padding:0 12px;
		background:transparent;
	}
	body.product-search .cat_hero__field input{
		height:44px;
		font-size:15px;
		border-bottom:none;
	}
	body.product-search .cat_hero.cat_hero .cat_hero__btn,
	body.product-search .cat_hero__btn{
		flex:0 0 auto !important;
		width:auto !important;
		min-width:72px !important;
		max-width:none !important;
		height:44px !important;
		padding:0 14px !important;
		order:2;
		gap:4px;
		font-size:14px !important;
		font-weight:600 !important;
		line-height:1 !important;
		border-radius:10px;
		justify-content:center;
	}
	body.product-search .cat_hero__btn svg{
		width:18px;
		height:18px;
		display:block;
	}
	body.product-search .cat_hero.cat_hero .cat_hero__settings,
	body.product-search .cat_hero__settings{
		flex:0 0 44px !important;
		width:44px !important;
		height:44px !important;
		order:3;
		border-radius:10px;
	}

	body.product-search .cat_hero__ai-wrap{
		margin-top:12px;
		text-align:center;
		max-width:100%;
	}
	body.product-search .cat_hero__ai{
		width:100%;
		justify-content:center;
	}

	body.product-search .offers_list{
		grid-template-columns:1fr 1fr;
		gap:12px;
	}
}

/* =====================================================================
   МОБИЛЬНАЯ ≤480 — Figma 390: title scale, chips, empty, 2-col cards
   specificity beats .cat_hero.cat_hero from gw19-cathero (+ !important on h1)
   ===================================================================== */
@media (max-width:480px){
	/* Keep compact hero on mobile (no catalog 180 bottom pad) */
	body.product-search .page_search .cat_hero.cat_hero.cat_hero,
	body.product-search .page_category.page_search .cat_hero.cat_hero.cat_hero{
		padding:20px 0 24px !important;
		margin-bottom:0 !important;
	}
	/* main display title — large white (Figma «Каталог»/hero title), not 13px */
	body.product-search .cat_hero.cat_hero .cat_hero__name,
	body.product-search .cat_hero__name{
		font-size:26px !important;
		line-height:1.2 !important;
		font-weight:300;
		margin:6px 0 8px;
		color:#fff;
		text-align:center;
	}
	body.product-search .offers_list .item_inner.item_inner .img{
		width:110px !important;
		max-width:110px !important;
		height:110px !important;
	}
	/* SEO subtitle under title */
	body.product-search .cat_hero.cat_hero h1.home-widget-title,
	body.product-search .cat_hero h1.home-widget-title{
		font-size:16px !important;
		line-height:1.3 !important;
		font-weight:400 !important;
		color:rgba(255,255,255,.9) !important;
		margin:0 auto 14px !important;
		max-width:100% !important;
	}

	body.product-search .cat_hero.cat_hero .cat_hero__srch,
	body.product-search .cat_hero__srch{
		flex-wrap:nowrap !important;
		margin-top:14px;
		gap:6px;
	}
	body.product-search .cat_hero.cat_hero .cat_hero__field,
	body.product-search .cat_hero__field{
		flex:1 1 auto !important;
		padding:0 10px;
	}
	body.product-search .cat_hero__field input{
		height:42px;
		font-size:15px;
	}
	body.product-search .cat_hero.cat_hero .cat_hero__btn,
	body.product-search .cat_hero__btn{
		flex:0 0 auto !important;
		width:auto !important;
		min-width:68px !important;
		max-width:none !important;
		height:42px !important;
		padding:0 12px !important;
		font-size:14px !important;
		font-weight:600 !important;
		border-radius:10px;
	}
	body.product-search .cat_hero.cat_hero .cat_hero__settings,
	body.product-search .cat_hero__settings{
		flex:0 0 42px !important;
		width:42px !important;
		height:42px !important;
	}

	body.product-search .cat_hero__ai-wrap{
		margin-top:12px;
		text-align:center;
	}
	body.product-search .cat_hero__ai{
		width:100%;
		justify-content:center;
		padding:8px 16px;
	}

	body.product-search .cat_hero__chips{
		display:flex;
		flex-wrap:wrap;
		gap:10px;
	}
	body.product-search .cat_hero__chips a{
		font-size:13px;
		padding:8px 14px;
		border-radius:999px;
	}

	body.product-search .search_meta{
		font-size:14px;
		color:var(--fg-muted,#5b6d9c);
		margin:18px 0 12px;
	}

	body.product-search .offers_list{
		display:grid;
		grid-template-columns:1fr 1fr;
		gap:12px;
		width:100%;
		max-width:100%;
	}
	body.product-search .offers_list .sp-card{
		padding:10px 10px 12px;
		min-width:0;
	}
	body.product-search .sp-card .img img{
		width:110px;
		height:110px;
	}
	body.product-search .sp-card .name{ font-size:15px; }

	body.product-search .search_empty{ margin:40px auto; padding:0 4px; }
	body.product-search .search_empty-title{ font-size:22px; }
	body.product-search .search_empty-btn{
		width:100%;
		justify-content:center;
		height:48px;
	}
}
