/* =============================================================================
   FBH theme — основной CSS.
   Технический рефакторинг 2026: без Bootstrap, без jQuery.
   Структура: переменные → reset → WP core → layout → меню → слайдер →
   sidebar → WooCommerce → типографика → утилиты → media queries.
============================================================================= */

/* ---------- Tokens ---------- */
:root {
	/* Палитра fun-blue (Kigen.design). 600 — основной цвет логотипа. */
	--fun-blue-50:  #edf0fc;
	--fun-blue-100: #d4dcf7;
	--fun-blue-200: #adbdf1;
	--fun-blue-300: #87a3eb;
	--fun-blue-400: #608ae5;
	--fun-blue-500: #4374cf;
	--fun-blue-600: #365fac;
	--fun-blue-700: #2b4d8e;
	--fun-blue-800: #1c3666;
	--fun-blue-900: #0d1d3c;
	--fun-blue-950: #061026;

	/* Семантические токены */
	--brand:         var(--fun-blue-600);  /* лого, кнопки, ссылки */
	--brand-light:   var(--fun-blue-700);  /* hover — темнее */
	--brand-accent:  var(--fun-blue-500);  /* акцент-светлее */
	--text:          var(--fun-blue-800);  /* основной текст — тёмно-синий */
	--text-strong:   var(--fun-blue-900);  /* усиленный текст */
	--text-muted:    #6b7280;              /* нейтральный приглушённый */
	--surface:       var(--fun-blue-50);   /* светлый брендовый фон */
	--surface-card:  #ffffff;
	--border:        var(--fun-blue-100);
	--separator:     var(--fun-blue-100);
	--footer-bg:     var(--fun-blue-800);  /* тёмно-синий футер */
	--bg-light:      var(--fun-blue-50);   /* топбар, плашки */

	--container-max:     1280px;
	--container-content: 1170px;
	--gutter:            20px;
	--header-height:     76px;
	--topbar-height:     38px;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: 'Ubuntu', sans-serif;
	font-size: 15px;
	line-height: 1.55;
	color: var(--text);
	background: #ffffff;

	/* Sticky footer — body минимум во весь экран, main забирает свободное
	   пространство, чтобы футер прижимался к низу даже при коротком контенте. */
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

main,
.home-layout,
.shop-layout,
.page-layout,
.search-layout,
.error-404 {
	flex: 1 0 auto;
}

.site-footer {
	flex-shrink: 0;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
}

button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
	padding: 0;
}

ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ---------- WordPress core ---------- */
.alignnone   { margin: 5px 20px 20px 0; }
.aligncenter { display: block; margin: 5px auto; }
.alignright  { float: right; margin: 5px 0 20px 20px; }
.alignleft   { float: left; margin: 5px 20px 20px 0; }

.wp-caption {
	background: #fff;
	border: 1px solid #f0f0f0;
	max-width: 96%;
	padding: 5px 3px 10px;
	text-align: center;
}

.wp-caption img {
	border: 0;
	max-width: 98.5%;
}

.wp-caption .wp-caption-text {
	font-size: 11px;
	line-height: 17px;
	margin: 0;
	padding: 0 4px 5px;
}

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	white-space: nowrap;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

.screen-reader-text:focus {
	background-color: #f1f1f1;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	color: #21759b;
	display: block;
	font-size: 14px;
	font-weight: bold;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* ---------- Site header (sticky main + non-sticky topbar above) ---------- */

/* Topbar — отдельный блок над header, не sticky. */
.site-topbar {
	background: var(--bg-light);
	border-bottom: 1px solid var(--separator);
	font-size: 13px;
	color: var(--text-muted);
}

.site-topbar__inner {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 0 24px;
	height: var(--topbar-height);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

.site-header__contacts {
	display: flex;
	align-items: center;
	gap: 16px;
}

.site-header__phone {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--text-strong);
	text-decoration: none;
	font-weight: 500;
}

.site-header__phone svg {
	color: var(--brand);
}

.site-header__phone:hover {
	color: var(--brand);
}

.site-header__address {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-style: normal;
}

.site-header__address svg {
	color: var(--brand);
	flex-shrink: 0;
}

.site-header__address a {
	margin-left: 8px;
	color: var(--brand);
	text-decoration: none;
	border-bottom: 1px dashed currentColor;
}

.site-header__address a:hover {
	border-bottom-style: solid;
}

/* Site header — основная sticky-полоса. Прямой потомок body, поэтому
   sticky работает по всей высоте страницы. Без анимации высоты — только тень. */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: #fff;
	border-bottom: 1px solid transparent;
	transition: box-shadow .15s ease, border-color .15s ease;
}

.site-header.is-stuck {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
	border-bottom-color: var(--separator);
}

.site-header__inner {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 0 24px;
	height: var(--header-height);
	display: flex;
	align-items: center;
	gap: 32px;
}

/* Logo — vector mark + text, separated */
.site-logo {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--brand);
	flex-shrink: 0;
}

.site-logo__mark {
	display: inline-flex;
	flex-shrink: 0;
}

.site-logo__mark .site-logo__img {
	display: block;
	height: 56px;
	width: auto;
	max-width: 100%;
}

.site-logo__text {
	display: inline-flex;
	flex-direction: column;
	font-family: 'Ubuntu', sans-serif;
	font-weight: 700;
	color: var(--brand);
	letter-spacing: 0.02em;
	line-height: 1.05;
	text-transform: uppercase;
}

.site-logo__line {
	font-size: 13px;
	font-weight: 700;
}

/* Main menu — desktop, horizontal, underline-on-hover */
.main-menu {
	flex: 1;
	min-width: 0;
}

.main-menu .menu {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-menu .menu > li {
	position: relative;
}

.main-menu .menu > li > a,
.main-menu__link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 10px 14px;
	color: var(--text-strong);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	border-radius: 6px;
	position: relative;
	transition: color .15s ease;
}

.main-menu .menu > li > a::after {
	content: "";
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 4px;
	height: 2px;
	background: var(--brand);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform .2s ease;
}

.main-menu .menu > li:hover > a,
.main-menu .menu > li.current-menu-item > a {
	color: var(--brand);
}

.main-menu .menu > li:hover > a::after,
.main-menu .menu > li.current-menu-item > a::after {
	transform: scaleX(1);
}

.main-menu__caret {
	transition: transform .2s ease;
}

/* Catalog item — primary visual highlight */
.main-menu .menu-item--catalog > .main-menu__link {
	background: var(--brand);
	color: #fff;
	padding: 10px 18px;
}

.main-menu .menu-item--catalog > .main-menu__link::after {
	display: none;
}

.main-menu .menu-item--catalog:hover > .main-menu__link {
	background: var(--brand-light);
	color: #fff;
}

.main-menu .menu-item--catalog:hover .main-menu__caret {
	transform: rotate(180deg);
}

/* Mega-menu — appears under «Каталог» on hover */
.mega-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	min-width: 320px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	padding: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
	z-index: 110;
}

.has-mega:hover > .mega-menu,
.has-mega:focus-within > .mega-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.mega-menu__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.mega-menu__list li a {
	display: block;
	padding: 10px 14px;
	color: var(--text-strong);
	text-decoration: none;
	font-size: 14px;
	border-radius: 6px;
	transition: background-color .15s ease, color .15s ease;
}

.mega-menu__list li a:hover {
	background: var(--bg-light);
	color: var(--brand);
}

/* Site actions (search, hamburger) */
.site-header__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	margin-left: auto;
}

.search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: var(--text-strong);
	transition: background-color .15s ease, color .15s ease;
}

.search-toggle:hover,
.search-toggle[aria-expanded="true"] {
	background: var(--bg-light);
	color: var(--brand);
}

/* Search overlay — bar that drops under main */
.site-search {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: #fff;
	border-top: 1px solid var(--border);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	padding: 16px 24px;
	z-index: 105;
}

.site-search[hidden] {
	display: none;
}

.site-search__form {
	max-width: var(--container-max);
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 12px;
}

.site-search__form svg {
	color: var(--text-muted);
	flex-shrink: 0;
}

.site-search__input {
	flex: 1;
	border: 0;
	font-size: 18px;
	padding: 8px 0;
	background: transparent;
	outline: none;
	color: var(--text-strong);
	font-family: inherit;
}

.site-search__input::placeholder {
	color: var(--text-muted);
}

.site-search__close {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	color: var(--text-muted);
	font-size: 24px;
	line-height: 1;
}

.site-search__close:hover {
	background: var(--bg-light);
	color: var(--text-strong);
}

/* Hamburger toggle — only on mobile */
.menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: transparent;
	color: var(--text-strong);
}

.menu-toggle:hover {
	background: var(--bg-light);
}

.menu-toggle__icon {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 20px;
	height: 16px;
}

.menu-toggle__icon span {
	display: block;
	width: 100%;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform .2s ease, opacity .2s ease;
}

body.mobile-menu-open .menu-toggle__icon span:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}
body.mobile-menu-open .menu-toggle__icon span:nth-child(2) {
	opacity: 0;
}
body.mobile-menu-open .menu-toggle__icon span:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Mobile drawer + overlay ---------- */
.site-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease;
	z-index: 998;
}

.mobile-menu {
	position: fixed;
	top: 0;
	left: 0;
	width: 320px;
	max-width: 85vw;
	height: 100vh;
	background: #fff;
	color: var(--text-strong);
	transform: translateX(-100%);
	transition: transform .25s ease;
	overflow-y: auto;
	padding: 30px 24px;
	z-index: 999;
	box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.mobile-menu__section {
	margin-bottom: 24px;
}

.mobile-menu__title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--text-muted);
	margin: 0 0 8px;
}

.mobile-menu .menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mobile-menu .menu li {
	border-bottom: 1px solid var(--separator);
}

.mobile-menu .menu li:last-child {
	border-bottom: 0;
}

.mobile-menu .menu a {
	display: block;
	padding: 12px 0;
	color: var(--text-strong);
	text-decoration: none;
	font-size: 15px;
}

.mobile-menu .menu a:hover {
	color: var(--brand);
}

body.mobile-menu-open .mobile-menu {
	transform: translateX(0);
}

body.mobile-menu-open .site-overlay {
	opacity: 1;
	pointer-events: auto;
}

/* ---------- Slider ---------- */
.slider {
	position: relative;
	margin-bottom: 40px;
	padding-top: 23px;
}

.slider-track {
	display: grid;
	grid-template-areas: "stack";
	min-height: 200px;
}

.slide {
	grid-area: stack;
	margin: 0;
	opacity: 0;
	transition: opacity .6s ease;
}

.slide.is-active {
	opacity: 1;
}

.slide img {
	width: 100%;
	height: auto;
}

.slider-dots {
	position: absolute;
	left: 50%;
	bottom: 20px;
	transform: translateX(-50%);
	display: flex;
	gap: 10px;
	z-index: 2;
}

.dot {
	width: 15px;
	height: 15px;
	border-radius: 50%;
	border: 2px solid #fff;
	background: transparent;
	transition: background-color .15s ease;
}

.dot.is-active,
.dot:hover,
.dot:focus-visible {
	background: #fff;
}

/* ---------- Page layouts (одна колонка во всю ширину контейнера) ---------- */
.home-layout,
.shop-layout,
.page-layout,
.search-layout {
	width: 100%;
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 24px;
}

.error-404 {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 60px 24px;
	text-align: center;
}

.error-404__inner {
	display: inline-block;
	max-width: 600px;
}

/* ---------- Headings & content ---------- */
.home-main,
.shop-main,
.page-main {
	min-width: 0;
	width: 100%;
	max-width: 100%;
}

.page-main > article,
.home-main > article {
	width: 100%;
	max-width: 100%;
}

h1 {
	overflow: hidden;
	font-family: 'Ubuntu', sans-serif;
	font-weight: bold;
	font-size: 30px;
	line-height: 35px;
}

h1::after {
	content: "";
	display: inline-block;
	height: 13.5px;
	width: 100%;
	margin-right: -100%;
	margin-left: 10px;
	border-top: 1px solid var(--separator);
	vertical-align: bottom;
}

/* Контент страниц/постов — на всю ширину layout, прижат влево.
   Поддержка alignwide/alignfull/alignleft/alignright/aligncenter — на случай
   если в редакторе понадобится точечно вытолкнуть блок шире, ́уже или плавать. */
.entry-content {
	width: 100%;
	max-width: 100%;
}

.entry-content > * {
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

.entry-content > .alignwide {
	max-width: 100%;
}

.entry-content > .alignfull {
	max-width: 100vw;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.entry-content > .aligncenter {
	margin-left: auto;
	margin-right: auto;
	display: block;
}

.entry-content > .alignleft {
	float: left;
	margin: 0 1.5rem 1rem 0;
}

.entry-content > .alignright {
	float: right;
	margin: 0 0 1rem 1.5rem;
}

.entry-content::after {
	content: "";
	display: block;
	clear: both;
}

.entry-content table,
.content table {
	width: 100%;
	border-collapse: collapse;
}

.entry-content table th,
.content table th {
	background-color: var(--brand);
	color: #fff;
	font-weight: bold;
	text-align: center;
	padding: 5px 3px;
	border-bottom: 1px solid var(--brand-light);
}

.entry-content table td,
.content table td {
	padding: 5px 3px;
	border-bottom: 1px solid var(--brand-light);
}

.hr-in {
	text-align: center;
	padding: 15px 0;
	background-color: var(--brand-light);
	color: #fff;
}

.td-cntr {
	text-align: center;
}

/* ---------- WooCommerce ---------- */
.woocommerce-breadcrumb {
	margin: 14px 0 32px;
}

.woocommerce-result-count {
	display: inline-block;
}

.woocommerce-ordering {
	display: none;
}

/* Сетка товаров — универсальная: shop-страница, шорткоды и блок «Похожие».
   Префикс .woocommerce / .woocommerce-page нужен чтобы перебить дефолтные
   стили плагина (там specificity 2, у нас иначе побеждает их float-вёрстка). */
.woocommerce ul.products,
.woocommerce-page ul.products,
ul.products {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--gutter);
	margin: 20px 0;
	padding: 0;
}

/* Гасим clearfix-псевдоэлементы Woo (они для float-вёрстки и в grid'е
   попадают в сетку как самостоятельные ячейки) */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after,
ul.products::before,
ul.products::after {
	content: none;
	display: none;
}

.woocommerce ul.products.columns-1,
.woocommerce-page ul.products.columns-1,
ul.products.columns-1 { grid-template-columns: 1fr; }

.woocommerce ul.products.columns-2,
.woocommerce-page ul.products.columns-2,
ul.products.columns-2 { grid-template-columns: repeat(2, 1fr); }

.woocommerce ul.products.columns-3,
.woocommerce-page ul.products.columns-3,
ul.products.columns-3 { grid-template-columns: repeat(3, 1fr); }

.woocommerce ul.products.columns-4,
.woocommerce-page ul.products.columns-4,
ul.products.columns-4 { grid-template-columns: repeat(4, 1fr); }

.woocommerce ul.products.columns-5,
.woocommerce-page ul.products.columns-5,
ul.products.columns-5 { grid-template-columns: repeat(5, 1fr); }

.woocommerce ul.products.columns-6,
.woocommerce-page ul.products.columns-6,
ul.products.columns-6 { grid-template-columns: repeat(6, 1fr); }

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
ul.products li.product {
	background: var(--surface-card);
	border: 1px solid var(--border);
	padding: 9px;
	width: auto;
	margin: 0;
	float: none;
	list-style: none;
	display: flex;
	flex-direction: column;
	text-align: center;
}

.woocommerce ul.products li.product a,
.woocommerce-page ul.products li.product a,
ul.products li.product a {
	color: inherit;
	text-decoration: none;
}

.woocommerce ul.products li.product img,
.woocommerce-page ul.products li.product img,
ul.products li.product img {
	max-width: 100%;
	height: auto;
	margin: 0 auto 10px;
	object-fit: contain;
}

/* Внутренняя ссылка-обёртка вокруг img + title + price.
   Делаем её flex-column на всю высоту карточки, чтобы цена прижалась к низу
   обёртки, а кнопка — к низу карточки независимо от длины названия. */
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link,
.woocommerce-page ul.products li.product > a.woocommerce-LoopProduct-link,
ul.products li.product > a.woocommerce-LoopProduct-link {
	display: flex;
	flex-direction: column;
	flex: 1;
	color: inherit;
	text-decoration: none;
}

.woocommerce ul.products li.product h3,
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce-page ul.products li.product h3,
.woocommerce-page ul.products li.product h2,
.woocommerce-page ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h3,
ul.products li.product h2,
ul.products li.product .woocommerce-loop-product__title {
	font-family: 'Ubuntu', sans-serif;
	font-size: 16px;
	line-height: 20px;
	color: var(--text-strong);
	margin: 0 0 8px;
	text-align: left;

	/* Заголовок прижат к низу карточки (margin-top: auto в flex-column).
	   Картинка + пустое пространство сверху → title → price → button. */
	margin-top: auto;
	min-height: 75px;

	/* До 3 строк, дальше многоточие */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.woocommerce ul.products li.product .price,
.woocommerce-page ul.products li.product .price,
ul.products li.product .price {
	color: var(--brand);
	font-weight: bold;
	text-align: center;
}

/* Кнопка «Подробнее» / «В корзину» — последний child карточки, на всю ширину */
.woocommerce ul.products li.product .button,
.woocommerce-page ul.products li.product .button,
ul.products li.product .button {
	margin: 12px 0 0;
	padding: 8px 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: #fff;
	background: var(--brand);
	border: 0;
	border-radius: 4px;
	text-align: center;
	text-decoration: none;
	display: block;
	width: 100%;
	box-sizing: border-box;
	flex-shrink: 0;
	transition: background-color .15s ease;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce-page ul.products li.product .button:hover,
ul.products li.product .button:hover {
	background: var(--brand-light);
	color: #fff;
}

.woocommerce-pagination {
	clear: both;
	display: flex;
	justify-content: center;
	margin: 20px 0;
}

.woocommerce-pagination ul {
	display: flex;
	gap: 15px;
	list-style: none;
	flex-wrap: wrap;
}

/* Single product layout — два равных столбца, всё что после summary
   (вкладки, описание, related, upsells) идёт во всю ширину. */
.shop-main {
	min-width: 0;
}

.shop-main .product {
	display: grid;
	/* minmax(0, 1fr) — колонки строго 50%, не раздуваются под FlexSlider
	   inline-width (он ставит wrapper'у ширину = сумма всех слайдов). */
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 40px;
	align-items: start;
}

/* Перебиваем дефолтные width/float у Woo (через !important — у плагина
   такая же специфичность но он каскадно ниже, поэтому выигрывает).
   overflow: hidden обрезает FlexSlider track справа. */
.shop-main .product .woocommerce-product-gallery,
.shop-main .product .images {
	width: 100% !important;
	max-width: 100%;
	min-width: 0;
	float: none !important;
	margin: 0 !important;
	grid-column: 1;
	overflow: hidden;
	position: relative;
}

.shop-main .product .summary,
.shop-main .product .summary.entry-summary {
	width: 100% !important;
	float: none !important;
	margin: 0 !important;
	max-width: none !important;
	grid-column: 2;
}

.shop-main .product .product_title,
.shop-main .product .product_meta,
.shop-main .product .woocommerce-product-details__short-description {
	width: 100%;
	max-width: none;
	float: none;
}

.shop-main .product .woocommerce-tabs,
.shop-main .product .related,
.shop-main .product .upsells {
	grid-column: 1 / -1;
	width: 100%;
	float: none;
}

/* Галерея товара: НЕ трогаем aspect-ratio/overflow на wrapper, потому что
   FlexSlider ставит на него inline width = ширина всех слайдов суммарно.
   Ограничиваем высоту самой картинки через max-height. */
.shop-main .product .woocommerce-product-gallery__wrapper {
	background: #fff;
	border: 1px solid var(--border);
	box-sizing: border-box;
	padding: 1em;
	margin: 0;
	position: relative;
}

.shop-main .product .woocommerce-product-gallery__image > a {
	display: block;
}

.shop-main .product .woocommerce-product-gallery__image img,
.shop-main .product .images img {
	max-width: 100% !important;
	max-height: 500px !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	margin: 0 auto;
	display: block;
}

/* Миниатюры — ряд под основной картинкой */
.shop-main .product ol.flex-control-nav.flex-control-thumbs,
.shop-main .product .flex-control-thumbs {
	display: flex !important;
	flex-wrap: wrap;
	gap: 8px;
	margin: 20px 0 0 !important;
	padding: 0 !important;
	list-style: none;
	clear: both;
}

.shop-main .product .flex-control-thumbs li {
	width: calc((100% - 24px) / 4);
	flex-shrink: 0;
	margin: 0;
}

.shop-main .product .flex-control-thumbs img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	cursor: pointer;
	border: 2px solid transparent;
	background: #fff;
	padding: 4px;
	box-sizing: border-box;
	opacity: .6;
	transition: opacity .15s ease, border-color .15s ease;
}

.shop-main .product .flex-control-thumbs img:hover,
.shop-main .product .flex-control-thumbs img.flex-active {
	opacity: 1;
	border-color: var(--brand);
}

/* Иконка-триггер «лупа» — скрыта, лайтбокс открывается прямо по клику на картинку.
   Заодно ставим cursor: zoom-in на картинку, чтобы было понятно. */
.shop-main .product .woocommerce-product-gallery__trigger {
	display: none;
}

.shop-main .product .woocommerce-product-gallery__image > a {
	cursor: zoom-in;
}

.shop-main .woocommerce-tabs ul.tabs {
	display: none;
}

.shop-main .panel,
.shop-main .woocommerce-Tabs-panel {
	background: transparent;
}

.shop-main .woocommerce-tabs {
	margin-bottom: 0;
}

.shop-main .related,
.shop-main .upsells {
	margin-top: 16px;
	padding: 0;
	clear: both;
}

.shop-main .related h2,
.shop-main .upsells h2 {
	margin: 0 0 16px;
}

#tab-reviews,
.ajax_add_to_cart {
	display: none;
}

/* Сетка товаров «Топ продаж» / шорткодов на главной (контент внутри .entry-content) */
.entry-content ul.products {
	margin: 30px 0;
}

/* ---------- Footer ---------- */
.site-footer {
	background-color: var(--footer-bg);
	min-height: 110px;
	margin-top: 60px;
	padding: 25px 0 15px;
	color: var(--fun-blue-100);
}

.site-footer__inner {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 0 15px;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 20px;
	align-items: center;
}

.site-footer__copyright {
	margin: 0;
}

.site-footer__credit {
	display: inline-block;
	background-image: url("../images/5il-logo.png");
	background-position: left center;
	background-repeat: no-repeat;
	padding-left: 75px;
	color: var(--fun-blue-100);
	text-decoration: none;
	min-height: 50px;
	display: flex;
	align-items: center;
}

/* ---------- Utilities ---------- */
.hide-tablet-down { display: block; }
.hide-mobile      { display: block; }

/* ---------- Lightbox (нативный <dialog> + JS-инициализация) ---------- */
.lightbox {
	border: 0;
	padding: 0;
	background: transparent;
	max-width: 100vw;
	max-height: 100vh;
	width: 100vw;
	height: 100vh;
	margin: 0;
	color: #fff;
}

.lightbox::backdrop {
	background: rgba(0, 0, 0, 0.85);
}

.lightbox__inner {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px;
	box-sizing: border-box;
}

.lightbox__img {
	max-width: 95vw;
	max-height: 90vh;
	display: block;
	margin: 0 auto;
	object-fit: contain;
}

.lightbox__close {
	position: fixed;
	top: 20px;
	right: 25px;
	font-size: 36px;
	line-height: 1;
	color: #fff;
	background: transparent;
	cursor: pointer;
	z-index: 2;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
	color: var(--brand-accent);
}

/* ---------- Contact Form 7 ---------- */
.wpcf7 {
	width: 100%;
	margin: 24px 0;
}

/* Структура: <form> > <div class="fabh-form-row"> > 2 колонки;
   правая колонка — только textarea, растянута на высоту левой. */
.fabh-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	align-items: stretch;
}

.fabh-form-col {
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}

/* Правая колонка — textarea на всю высоту */
.fabh-form-col--message,
.fabh-form-col--message .fabh-field--message {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.fabh-form-col--message .fabh-field--message {
	margin: 0;
}

.fabh-form-col--message .wpcf7-form-control-wrap {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.fabh-form-col--message textarea.fabh-field__input {
	flex: 1;
	min-height: 200px;
	height: 100%;
}

.fabh-field {
	margin: 0;
	font-weight: 500;
	color: var(--text-strong);
}

.fabh-field--submit {
	margin-top: 18px;
}

/* Если submit внутри колонки (flex-column) — прижимаем его к низу */
.fabh-form-col .fabh-field--submit {
	margin-top: auto;
}

.wpcf7-response-output {
	margin-top: 16px;
}

/* Поле — единый стиль для всех типов кроме file и submit */
.fabh-field__input:not(.fabh-field__input--file) {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 11px 14px;
	border: 1px solid var(--border);
	border-radius: 6px;
	font: inherit;
	font-size: 15px;
	font-weight: 400;
	color: var(--text-strong);
	background: #fff;
	box-sizing: border-box;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.fabh-field__input:not(.fabh-field__input--file):focus {
	outline: 0;
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(54, 95, 172, 0.18);
}

textarea.fabh-field__input {
	resize: vertical;
}

/* File input — кастомное оформление */
.fabh-field__input--file {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 10px 14px;
	border: 1px dashed var(--border);
	border-radius: 6px;
	font: inherit;
	font-size: 14px;
	background: var(--bg-light);
	cursor: pointer;
	box-sizing: border-box;
}

.fabh-field__input--file::file-selector-button {
	margin-right: 12px;
	padding: 6px 14px;
	border: 0;
	border-radius: 4px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: var(--brand);
	cursor: pointer;
	transition: background-color .15s ease;
}

.fabh-field__input--file::file-selector-button:hover {
	background: var(--brand-light);
}

/* Submit */
.fabh-field__submit {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 32px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: var(--brand);
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color .15s ease;
}

.fabh-field__submit:hover:not(:disabled) {
	background: var(--brand-light);
}

.fabh-field__submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

@media (max-width: 768px) {
	.fabh-form-row {
		grid-template-columns: 1fr;
	}
}

.wpcf7-form label {
	display: block;
	font-weight: 500;
	color: var(--text-strong);
	margin-bottom: 6px;
}

.wpcf7-form-control-wrap {
	display: block;
}

.wpcf7-form-control:not(.wpcf7-submit):not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--border);
	border-radius: 6px;
	font: inherit;
	font-size: 15px;
	color: var(--text-strong);
	background: #fff;
	box-sizing: border-box;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.wpcf7-form-control:not(.wpcf7-submit):focus {
	outline: 0;
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(54, 95, 172, 0.18);
}

.wpcf7-form-control::placeholder {
	color: var(--text-muted);
}

.wpcf7-textarea {
	min-height: 200px;
	resize: vertical;
}

.wpcf7-list-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 16px 8px 0;
}

.wpcf7-list-item-label {
	font-weight: 400;
}

input[type="checkbox"].wpcf7-form-control,
input[type="radio"].wpcf7-form-control {
	accent-color: var(--brand);
	width: 18px;
	height: 18px;
}

.wpcf7-submit {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 32px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: var(--brand);
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color .15s ease;
}

.wpcf7-submit:hover:not(:disabled) {
	background: var(--brand-light);
}

.wpcf7-submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.wpcf7-spinner {
	margin: 0 0 0 8px;
}

/* Ошибки валидации */
.wpcf7-not-valid-tip {
	display: block;
	color: #d63031;
	font-size: 13px;
	margin-top: 4px;
}

.wpcf7-form-control.wpcf7-not-valid {
	border-color: #d63031 !important;
}

.wpcf7-form-control.wpcf7-not-valid:focus {
	box-shadow: 0 0 0 3px rgba(214, 48, 49, 0.12) !important;
}

/* Общий ответ формы (вверху или внизу) */
.wpcf7-response-output {
	margin: 16px 0 0 !important;
	padding: 12px 16px !important;
	border: 1px solid var(--border) !important;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
}

.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.unaccepted .wpcf7-response-output {
	border-color: #d63031 !important;
	background: #fff5f5;
	color: #b32a2b;
}

.wpcf7-form.sent .wpcf7-response-output {
	border-color: #2bb673 !important;
	background: #f0faf5;
	color: #1f8a55;
}

/* Кликабельные картинки получают курсор-зум */
.entry-content a[href$=".jpg"],
.entry-content a[href$=".jpeg"],
.entry-content a[href$=".png"],
.entry-content a[href$=".webp"],
.entry-content a[href$=".gif"] {
	cursor: zoom-in;
	display: inline-block;
}

/* ---------- Media queries ---------- */
@media (max-width: 991px) {
	.hide-tablet-down { display: none !important; }

	/* Topbar — компактнее, адрес скрываем */
	.site-topbar__inner {
		padding: 0 16px;
	}

	.site-header__address {
		display: none;
	}

	/* Main bar — лого + actions, меню скрыто (заменяется на hamburger drawer) */
	.site-header__inner {
		padding: 0 16px;
		gap: 16px;
	}

	.main-menu {
		display: none;
	}

	.menu-toggle {
		display: inline-flex;
	}

	.site-logo__mark .site-logo__img {
		height: 44px;
	}

	.site-logo__line {
		font-size: 12px;
	}

	.home-layout,
	.shop-layout,
	.page-layout {
		padding: 16px;
	}

	.slider {
		display: none;
	}

	.woocommerce ul.products,
	.woocommerce-page ul.products,
	ul.products {
		grid-template-columns: repeat(2, 1fr);
	}

	.woocommerce ul.products.columns-3,
	.woocommerce ul.products.columns-4,
	.woocommerce ul.products.columns-5,
	.woocommerce ul.products.columns-6,
	.woocommerce-page ul.products.columns-3,
	.woocommerce-page ul.products.columns-4,
	.woocommerce-page ul.products.columns-5,
	.woocommerce-page ul.products.columns-6,
	ul.products.columns-3,
	ul.products.columns-4,
	ul.products.columns-5,
	ul.products.columns-6 {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Сбрасываем дефолтные width/margin/float у li.product, которые WC
	   ставит через свои media queries (48% и 3.8% margin). !important
	   нужен потому что WC enqueue может попадать в каскад позже нас. */
	.woocommerce ul.products li.product,
	.woocommerce-page ul.products li.product,
	ul.products li.product {
		width: auto !important;
		margin: 0 !important;
		float: none !important;
	}

	/* Topbar — телефоны по углам, когда адрес скрыт */
	.site-header__contacts {
		flex: 1;
		justify-content: space-between;
	}

	.shop-main .product {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.shop-main .product .woocommerce-product-gallery,
	.shop-main .product .images,
	.shop-main .product .summary {
		width: 100%;
		float: none;
		grid-column: 1;
	}
}

@media (max-width: 768px) {
	.hide-mobile { display: none !important; }

	/* Топбар на узких — компактные одни телефоны */
	.site-topbar {
		font-size: 12px;
	}

	.site-header__contacts {
		gap: 12px;
		flex-wrap: wrap;
	}

	/* Лого — только графика, текст прячем */
	.site-logo__text {
		display: none;
	}

	.woocommerce ul.products,
	.woocommerce ul.products.columns-2,
	.woocommerce ul.products.columns-3,
	.woocommerce ul.products.columns-4,
	.woocommerce ul.products.columns-5,
	.woocommerce ul.products.columns-6,
	.woocommerce-page ul.products,
	.woocommerce-page ul.products.columns-2,
	.woocommerce-page ul.products.columns-3,
	.woocommerce-page ul.products.columns-4,
	.woocommerce-page ul.products.columns-5,
	.woocommerce-page ul.products.columns-6,
	ul.products,
	ul.products.columns-2,
	ul.products.columns-3,
	ul.products.columns-4,
	ul.products.columns-5,
	ul.products.columns-6 {
		grid-template-columns: 1fr;
	}

	/* Сбрасываем 48% width который WC ставит на mobile breakpoint */
	.woocommerce ul.products li.product,
	.woocommerce-page ul.products li.product,
	ul.products li.product {
		width: auto !important;
		margin: 0 !important;
		float: none !important;
	}

	.site-footer__inner {
		grid-template-columns: 1fr;
		text-align: center;
		justify-items: center;
	}

	.site-footer__credit {
		margin: 0 auto;
	}

	h1 {
		font-size: 22px;
		line-height: 28px;
	}

	.lightbox__close {
		top: 10px;
		right: 15px;
	}
}
