/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.2
*/

/*************** ADD CUSTOM CSS HERE.   ***************/

/* Кнопка «В каталог» на главной — текст цвета #207873 */
.home .section a.button.white.shade[href="/shop/"],
.home .section a.button.white[href="/shop/"],
body.home a.button.shade[href="/shop/"] {
	color: #207873 !important;
}
body.home a.button.shade[href="/shop/"] span {
	color: #207873 !important;
}

/* Скрыть мета-категорию «Каталог» на главной и в каталоге */
.product-category a[href*="/product-category/katalog"],
.product-category a[href*="/product-category/katalog/"] {
	display: none !important;
}
.product-category a[href*="/product-category/katalog"]::after {
	display: none !important;
}
/* Скрыть карточку «Каталог» и саму ячейку сетки (иначе остаётся пустой квадрат) */
body.home .col .product-category a[href*="katalog"],
body .product-categories .product-category:has(a[href*="katalog"]) {
	display: none !important;
}
body.home li.product-category:has(a[href*="katalog"]),
body.home li.product-category:has(a[href*="/product-category/katalog"]) {
	display: none !important;
}
/* UX Builder / сетка Flatsome: скрываем колонку целиком */
body.home .section .row .col:has(.product-category a[href*="katalog"]),
body.home .section .row .col:has(.product-category a[href*="/product-category/katalog"]) {
	display: none !important;
}


/* ── Панель «≡ ФИЛЬТРАЦИЯ»: скрыта везде, кроме каталога на мобильных ── */
.category-filtering.category-filter-row,
.category-filtering.category-filter-row.show-for-medium {
	display: none !important;
}

/* На каталоге (мобильные до 849px) — показываем кнопку ФИЛЬТРАЦИЯ */
@media screen and (max-width: 849px) {
	body.kyphy-product-listing .category-filtering.category-filter-row.show-for-medium {
		display: flex !important;
		align-items: center;
		justify-content: center;
		flex-wrap: wrap;
		gap: 0.35rem 0.75rem;
		margin-top: 0.15rem;
	}
	body.kyphy-product-listing .category-filtering .filter-button strong {
		color: #207873;
	}
}

/* Не растягивать колонки по высоте — иначе «пустота» между сортировкой и кнопкой фильтра */
body.kyphy-product-listing .shop-page-title .page-title-inner.flex-row {
	align-items: flex-start !important;
}

/* ── Панель поиска: выводится через woocommerce_before_shop_loop, перед сеткой товаров ── */
.kyphy-shop-toolbar {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	width: 100%;
	max-width: none;
	margin: 0.5rem 0 1.5rem;
	box-sizing: border-box;
}

.kyphy-shop-toolbar__search {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
}

.kyphy-shop-search-form {
	display: flex;
	align-items: stretch;
	width: 100%;
	height: 44px;
	border: 1px solid rgba(0,0,0,0.12);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}

.kyphy-shop-search-form:focus-within {
	border-color: #207873;
	box-shadow: 0 0 0 3px rgba(32, 120, 115, 0.12);
}

.kyphy-shop-search-input {
	flex: 1;
	padding: 0 1rem;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	font-size: 0.95rem;
	font-family: inherit;
	color: #333;
	background: transparent !important;
	margin: 0 !important;
	height: 100%;
	min-width: 0;
}

.kyphy-shop-search-input::placeholder {
	color: #aaa;
}

.kyphy-shop-search-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 100%;
	background: #207873 !important;
	color: #fff !important;
	border: none !important;
	margin: 0 !important;
	padding: 0;
	cursor: pointer;
	transition: background 0.15s;
	flex-shrink: 0;
}

.kyphy-shop-search-btn:hover {
	background: #1a6360 !important;
}

/* ── Кнопка «Применить фильтры» (Filter Everything) — в цвет темы ── */
a.wpc-filters-apply-button,
.wpc-filter-layout-submit-button a {
	display: inline-block;
	background: #207873 !important;
	color: #fff !important;
	padding: 0.55rem 1.25rem !important;
	border-radius: 6px !important;
	font-size: 0.875rem !important;
	font-weight: 600 !important;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-decoration: none !important;
	transition: background 0.15s !important;
	border: none !important;
	margin-top: 0.75rem;
}

a.wpc-filters-apply-button:hover,
.wpc-filter-layout-submit-button a:hover {
	background: #1a6360 !important;
	color: #fff !important;
}

/* Сброс фильтра */
a.wpc-filters-reset-button {
	color: #888 !important;
	font-size: 0.82rem !important;
	text-decoration: underline !important;
	margin-left: 0.75rem;
}

/* ── CF7 форма «Задать вопрос» — компактнее ── */
.wpcf7-form .wpcf7-textarea {
	min-height: 90px !important;
	max-height: 130px !important;
	resize: vertical;
}

/* ── Описание товара в карточках: обрезка до 1 предложения ── */
.kyphy-product-excerpt-more {
	display: inline-block;
	margin-top: 0.25rem;
	font-size: 0.82em;
	font-weight: 600;
	color: #207873 !important;
	text-decoration: none !important;
	transition: color 0.15s;
}
.kyphy-product-excerpt-more:hover {
	color: #1a6360 !important;
	text-decoration: underline !important;
}

/* ── Мобильная иконка аккаунта в хедере ── */
.kyphy-mobile-account-li {
	display: none;
}

@media screen and (max-width: 849px) {
	.kyphy-mobile-account-li {
		display: flex !important;
		align-items: center;
	}
	.kyphy-mobile-account-link {
		display: flex;
		align-items: center;
		justify-content: center;
		text-decoration: none !important;
		color: inherit;
		padding: 0 2px;
		opacity: 0.92;
		transition: opacity 0.15s, color 0.3s;
	}
	.kyphy-mobile-account-link:hover {
		opacity: 1;
	}
	.kyphy-account-icon {
		display: block;
		width: 20px;
		height: 20px;
	}

	/* Логотип всегда по центру мобильного хедера */
	.header-inner .flex-center {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
	}
}

/* ── Подписки: порядок от дешёвой к дорогой ── */
.page-konfigurator-podpiski .kyphy-sub__pack-grid {
	display: flex !important;
	flex-wrap: wrap;
}
/* Текущий порядок: 1=Жизнь, 2=Красота, 3=Здоровье, 4=Природа */
/* Нужный порядок:  Природа(1), Здоровье(2), Красота(3), Жизнь(4) */
.page-konfigurator-podpiski .kyphy-sub__pack-grid > .kyphy-sub__pack-card:nth-child(1) { order: 4; }
.page-konfigurator-podpiski .kyphy-sub__pack-grid > .kyphy-sub__pack-card:nth-child(2) { order: 3; }
.page-konfigurator-podpiski .kyphy-sub__pack-grid > .kyphy-sub__pack-card:nth-child(3) { order: 2; }
.page-konfigurator-podpiski .kyphy-sub__pack-grid > .kyphy-sub__pack-card:nth-child(4) { order: 1; }

/* ── Бренд KYPHY: подсветка и бейдж «наш бренд» в левом фильтре каталога ── */
/* Делаем тело блока flex-column, чтобы KYPHY можно было поднять через order */
.tt-wc-pf__block .tt-wc-pf__body {
	display: flex;
	flex-direction: column;
}

/* Скрываем чисто визуальные <br /> между лейблами в flex-контейнере */
.tt-wc-pf__block .tt-wc-pf__body > br {
	display: none;
}

/* JS дополнительно навешивает класс .kyphy-our-brand на лейбл с KYPHY,
   :has() — fallback на случай, если JS не успел отработать.
   Сам лейбл — flex-row, чтобы можно было упорядочить чекбокс / название /
   бейдж / счётчик через `order` без правки HTML плагина.                  */
.tt-wc-pf__check.kyphy-our-brand,
.tt-wc-pf__check:has(input.tt-wc-pf-brand[value="kyphy"]) {
	order: -1 !important;
	display: flex !important;
	align-items: center;
	gap: 6px;
	background: rgba(32, 120, 115, 0.08);
	box-shadow: inset 0 0 0 1px rgba(32, 120, 115, 0.20),
	            0 1px 2px rgba(32, 120, 115, 0.06);
	border-radius: 6px;
	padding: 5px 8px !important;
	/* Отрицательные горизонтальные margin компенсируют padding,
	   чтобы чекбокс KYPHY стоял на той же x-координате, что и у других. */
	margin: 0 -8px 8px -8px !important;
}

/* Чекбокс — без сдвига; ту же ширину/выравнивание, как у обычных лейблов */
.tt-wc-pf__check.kyphy-our-brand input[type="checkbox"],
.tt-wc-pf__check:has(input.tt-wc-pf-brand[value="kyphy"]) input[type="checkbox"] {
	margin: 0;
	flex: 0 0 auto;
}

.tt-wc-pf__check.kyphy-our-brand .tt-wc-pf__check-name,
.tt-wc-pf__check:has(input.tt-wc-pf-brand[value="kyphy"]) .tt-wc-pf__check-name {
	font-weight: 600;
	color: #207873;
	flex: 0 0 auto;
}

/* Бейдж «наш бренд» — между названием и количеством (order: 1) */
.tt-wc-pf__check.kyphy-our-brand::after,
.tt-wc-pf__check:has(input.tt-wc-pf-brand[value="kyphy"])::after {
	content: "наш бренд";
	order: 1;
	padding: 2px 7px;
	font-size: 0.65rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.02em;
	color: #fff;
	background: #207873;
	border-radius: 3px;
	white-space: nowrap;
	flex: 0 0 auto;
}

/* Счётчик товаров — в самом конце (order: 2), уезжает к правому краю */
.tt-wc-pf__check.kyphy-our-brand .tt-wc-pf__count,
.tt-wc-pf__check:has(input.tt-wc-pf-brand[value="kyphy"]) .tt-wc-pf__count {
	order: 2;
	margin-left: auto;
	flex: 0 0 auto;
}

/* ── Кнопка «В корзину» в каталоге: фон #c05530 в начальном состоянии,
   на hover/focus возвращаем фирменный зелёный #217974 + белый текст. ── */
.add-to-cart-button a.button.is-outline.add_to_cart_button,
.add-to-cart-button a.button.is-outline.add_to_cart_button:visited {
	background-color: #c05530 !important;
	color: #fff !important;
	border-color: #c05530 !important;
	transition: background-color 0.15s ease, border-color 0.15s ease,
	            color 0.15s ease;
}

.add-to-cart-button a.button.is-outline.add_to_cart_button:hover,
.add-to-cart-button a.button.is-outline.add_to_cart_button:focus,
.add-to-cart-button a.button.is-outline.add_to_cart_button:active {
	background-color: #217974 !important;
	color: #fff !important;
	border-color: #217974 !important;
}

/* ── Адаптив ── */
@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/
}

/* Скрытие иконок Facebook, Twitter (X) и Threads везде на сайте */
.share-icons a.facebook,
.share-icons a.twitter,
.share-icons a.x,
.share-icons a.threads,
.social-icons a.facebook,
.social-icons a.twitter,
.social-icons a.x,
.social-icons a.threads,
a.icon.facebook,
a.icon.twitter,
a.icon.x,
a.icon.threads,
a[href*="facebook.com/sharer"],
a[href*="twitter.com/share"],
a[href*="x.com/share"],
a[href*="threads.net"] {
	display: none !important;
}
