/* ==========================================================================
   header-v2.css — full header redesign (Ozon-inspired: white bg, big search,
   icon-stack account/wishlist/cart, pill "Категории" button).
   v2_hdr_* classes only — does not touch/override the megamenu's own
   functional classes (so-megamenu, vertical-wrapper, navbar-toggle etc.),
   those keep their existing behavior untouched; this file only hides the
   now-redundant duplicate toggle triggers and skins the secondary link row.
   ========================================================================== */

.v2_hdr {
	background: #fff;
	border-bottom: 1px solid #e7eaf0;
	font-family: 'Manrope', 'Open Sans', sans-serif;
}
.v2_hdr__row1 {
	max-width: 1400px;
	margin: 0 auto;
	padding: 16px 20px;
	display: flex;
	align-items: center;
	gap: 18px;
}
.v2_hdr__logo { flex: none; display: flex; align-items: center; }
.v2_hdr__logo img { max-height: 44px; display: block; filter: brightness(0); }

/* ---------- brand-new categories panel: fully self-contained, no
   dependency on the legacy so-megamenu/vertical-wrapper JS at all ---------- */
.v2_cat_wrap { position: relative; flex: none; }
.v2_cat_panel {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	width: 340px;
	max-height: 70vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 12px;
	border: 1px solid #e7eaf0;
	box-shadow: 0 16px 40px rgba(20,24,31,.16);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
	z-index: 500;
}
.v2_cat_panel.v2_cat_panel--open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.v2_cat_panel__inner { padding: 8px; }
.v2_cat_panel__item {
	display: block;
	padding: 11px 14px;
	border-radius: 8px;
	color: #1b2430;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.3;
}
.v2_cat_panel__item:hover { background: #f2f4f8; color: #0d6efd; text-decoration: none; }

.v2_hdr__catalog_btn {
	flex: none;
	display: flex;
	align-items: center;
	gap: 8px;
	height: 46px;
	padding: 0 18px;
	background: #0d6efd;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	white-space: nowrap;
	transition: background .15s ease;
}
.v2_hdr__catalog_btn:hover { background: #0b5ed7; }
.v2_hdr__catalog_btn i { font-size: 15px; }

.v2_hdr__search { flex: 1; min-width: 0; }
.v2_hdr__search #search {
	display: flex;
	height: 46px;
	border: 1.5px solid #0d6efd;
	border-radius: 8px;
	overflow: hidden;
}
.v2_hdr__search .autosearch-input {
	flex: 1;
	border: none;
	box-shadow: none;
	height: 100%;
	padding: 0 16px;
	font-size: 14px;
	border-radius: 0;
}
.v2_hdr__search .autosearch-input:focus { outline: none; box-shadow: none; }
.v2_hdr__search .button-search {
	border: none;
	border-radius: 0;
	background: #0d6efd;
	color: #fff;
	width: 52px;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
}
.v2_hdr__search .button-search:hover { background: #0b5ed7; }

.v2_hdr__icons { flex: none; display: flex; align-items: center; gap: 6px; }
.v2_hdr__icon_stack {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 8px 14px;
	min-width: 64px;
	text-decoration: none;
	color: #1b2430;
	border-radius: 8px;
	position: relative;
}
.v2_hdr__icon_stack:hover { background: #f2f4f8; color: #1b2430; text-decoration: none; }
.v2_hdr__icon_stack i { font-size: 23px; color: #6b7785; }
.v2_hdr__icon_stack:hover i { color: #0d6efd; }
.v2_hdr__icon_stack span {
	font-size: 12px;
	font-weight: 600;
	color: #6b7785;
	white-space: nowrap;
	max-width: 100px;
	overflow: hidden;
	text-overflow: ellipsis;
}
.v2_hdr__icon_stack.dropdown { cursor: pointer; }
/* the account trigger is a nested <a class="dropdown-toggle"> inside the
   .v2_hdr__icon_stack div, so it never inherited the icon-stack's own
   flex/color rules - it was falling back to bootstrap's default blue
   underlined link + block layout instead of matching the other stacks */
.v2_hdr__icon_stack.dropdown > a.dropdown-toggle {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 100%;
	color: #1b2430;
	text-decoration: none;
}
.v2_hdr__icon_stack.dropdown > a.dropdown-toggle:hover,
.v2_hdr__icon_stack.dropdown > a.dropdown-toggle:focus { color: #1b2430; text-decoration: none; }
.v2_hdr__icon_stack.dropdown > a.dropdown-toggle span {
	font-size: 12px;
	font-weight: 600;
	color: #6b7785;
}
.v2_hdr__icon_stack.dropdown:hover > a.dropdown-toggle i { color: var(--v2-accent, #0d6efd); }
.v2_hdr__icon_stack .dropdown-menu {
	border-radius: 10px;
	border: 1px solid #e7eaf0;
	box-shadow: 0 10px 28px rgba(20,24,31,.14);
	margin-top: 8px;
}
/* remove bootstrap's caret triangles - the stack icons are self-explanatory
   without a dropdown arrow cluttering the single-row layout */
.v2_hdr__icon_stack .dropdown-toggle::after { display: none; }

/* phone + email, stacked as two compact rows instead of a single icon-stack */
.v2_hdr__contact_stack { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; }
.v2_hdr__contact_row {
	display: flex;
	align-items: center;
	gap: 7px;
	text-decoration: none;
	color: #1b2430;
	line-height: 1.2;
}
.v2_hdr__contact_row:hover { color: #0d6efd; text-decoration: none; }
.v2_hdr__contact_row i { font-size: 14px; color: #6b7785; width: 15px; text-align: center; flex: none; }
.v2_hdr__contact_row:hover i { color: #0d6efd; }
.v2_hdr__contact_row span { font-size: 12px; font-weight: 600; white-space: nowrap; }
.v2_hdr__contact_row:first-child span { font-size: 13.5px; font-weight: 700; }

/* the cart widget ($cart) renders its own bootstrap button+dropdown markup we
   don't control directly - reshape it to sit visually like the other icon
   stacks instead of the old wide pill button */
.v2_hdr__cart_stack { padding: 0; min-width: auto; }
.v2_hdr__cart_stack #cart { display: block; }
.v2_hdr__cart_stack #cart > .btn {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	min-width: 64px;
	height: auto;
	background: transparent;
	border: none;
	border-radius: 8px;
	color: #1b2430;
	font-size: 12px;
	font-weight: 600;
	box-shadow: none;
}
.v2_hdr__cart_stack #cart > .btn:hover { background: #f2f4f8; }
.v2_hdr__cart_stack #cart > .btn i,
.v2_hdr__cart_stack #cart > .btn .fa { font-size: 23px; color: #6b7785; display: block; }
.v2_hdr__cart_stack #cart .dropdown-menu {
	border-radius: 10px;
	border: 1px solid #e7eaf0;
	box-shadow: 0 10px 28px rgba(20,24,31,.14);
}

/* ---------- secondary row: hide the now-redundant desktop/mobile category
   toggle triggers (proxied from the new pill button above) and skin the
   remaining horizontal static links (Доставка/Дилерам/Скидки/...) as a
   clean underline row, matching Ozon's secondary link strip ---------- */
/* only hide/collapse the old desktop toggle chrome at desktop widths (>=992px)
   — the new pill button in row1 is desktop-only (hidden-md/sm/xs), so at
   mobile widths the ORIGINAL #show-verticalmenu hamburger inside
   .navbar-header must stay visible, it's still the only mobile trigger */
@media (min-width: 992px) {
	#menuHeading,
	.navbar-header { display: none !important; }
	/* the sidebar-menu column only exists to host the (now-hidden) toggle
	   buttons - collapse its grid width to 0 so the horizontal link row can
	   use the full header width, but do NOT display:none it: its descendant
	   .vertical-wrapper is position:fixed and must stay in the
	   DOM/renderable for the proxied "Категории" button in row1 to open it */
	.sidebar-menu {
		width: 0 !important;
		max-width: 0 !important;
		flex: 0 0 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: visible !important;
	}
	.megamenu-hori {
		width: 100% !important;
		max-width: 100% !important;
		flex: 1 1 100% !important;
	}
}

.header-bottom {
	background: #fff;
	border-bottom: 1px solid #e7eaf0;
	padding: 0;
}
.header-bottom .container { max-width: 1400px; }
.megamenu-hori ul.megamenu {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
}
.megamenu-hori ul.megamenu > li > a {
	color: #4a5568;
	font-size: 13.5px;
	font-weight: 600;
	padding: 12px 14px;
	text-shadow: none;
}
.megamenu-hori ul.megamenu > li > a:hover,
.megamenu-hori ul.megamenu > li.active > a {
	background: #f2f4f8;
	color: #0d6efd;
}
.megamenu-hori ul.megamenu > li > a strong { font-weight: 600; }
.megamenu-hori .megamenu .sub-menu .content {
	border-radius: 10px;
	box-shadow: 0 10px 28px rgba(20,24,31,.14);
	border: 1px solid #e7eaf0;
}

/* vertical categories slide-out panel (opened via the new pill button) —
   keep dark/industrial for contrast against the now-white header, just
   modernize spacing/typography */
.vertical-wrapper {
	background: #fff !important;
	border-right: 1px solid #e7eaf0 !important;
	width: 320px !important;
	max-width: 320px !important;
	left: 0 !important;
}
.vertical-wrapper.so-vertical-active {
	transform: translate3d(0,0,0) !important;
}
.vertical ul.megamenu > li > a { color: #1b2430; font-weight: 600; }
.vertical ul.megamenu > li { border-top-color: #e7eaf0 !important; }

/* ---------- mobile/tablet top bar (<992px) — was previously just a bare
   white-text link with a broken tel:"" phone icon on the old dark bg;
   replaced with a real top bar (logo, hamburger proxy, phone, cart link) ---------- */
.v2_hdr_mobile {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	background: #fff;
	border-bottom: 1px solid #e7eaf0;
	padding: 10px 14px;
	font-family: 'Manrope', 'Open Sans', sans-serif;
}
.v2_hdr_mobile__hamburger {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: #f2f4f8;
	border: none;
	border-radius: 8px;
	color: #1b2430;
	font-size: 17px;
	cursor: pointer;
}
.v2_hdr_mobile__logo { flex: 1; min-width: 0; display: flex; justify-content: center; }
.v2_hdr_mobile__logo img { max-height: 34px; display: block; filter: brightness(0); }
.v2_hdr_mobile__logo a { display: block; color: #1b2430; font-weight: 700; text-decoration: none; }
.v2_hdr_mobile__actions { flex: none; display: flex; align-items: center; gap: 4px; }
.v2_hdr_mobile__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	color: #1b2430;
	font-size: 17px;
	text-decoration: none;
}
.v2_hdr_mobile__icon:hover { background: #f2f4f8; color: #0d6efd; text-decoration: none; }

/* the legacy mobile-reflow script clones #cart directly into #meni_mob_slide
   (outside the collapsed vertical-wrapper drawer) - it's now redundant with
   the cart icon in the new .v2_hdr_mobile bar above and renders as an
   unstyled floating pill against the dark drawer-column background */
@media (max-width: 991px) {
	#meni_mob_slide > #cart { display: none !important; }
	/* .sidebar-menu still carries legacy col-md-3 col-sm-6 col-12 grid classes;
	   at sm (768-991px) col-sm-6 squeezes it to 50% width, compressing the new
	   .v2_hdr_mobile bar into a narrow column instead of the full header width */
	.sidebar-menu { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; }
}

/* prd_cart.tpl fallback text (product description) shown when a product has
   no quick_attrs set in admin - avoids a large blank gap from the reserved
   .v2_related_card__attrs min-height (105px) that was showing on cards with
   zero attributes */
.v2_related_card__attrs li.v2_related_card__attrs_fallback {
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
	border-top: none;
	padding: 0;
	font-size: 11.5px;
	line-height: 1.5;
}

/* breadcrumb: a legacy rule (stylesheet.css) forces white-space:nowrap on
   every <li>, so a long product-name crumb never wraps and just gets clipped
   at the viewport edge on narrow phones (320-375px) instead of wrapping */
@media (max-width: 767px) {
	.breadcrumb { flex-wrap: wrap; overflow: visible; }
	.breadcrumb > li { white-space: normal; }
}
