/*
Theme Name: Blocksy Child
Theme URI: https://creativethemes.com/blocksy/
Description: Дочерняя тема для Blocksy.
Author: CreativeThemes
Author URI: https://creativethemes.com
Template: blocksy
Version: 1.0.8
Text Domain: blocksy-child
*/

/* Не увеличивать изображения товаров сверх исходного размера */
[data-products] figure .ct-media-container img {
	object-fit: scale-down;
}

/* Карточки товаров в блоке «Рекомендуемые товары» — как в каталоге */
.chl-rec .flexy-item > article {
	display: flex;
	flex-direction: column;
}

.chl-rec .chl-card {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: auto auto 1fr;
	flex: 1;
	padding: 0 20px 20px;
	overflow: hidden;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.05);
	border-radius: 15px;
	text-align: center;
}

.chl-rec .chl-card > * {
	grid-column: 1 / -1;
}

.chl-rec .chl-card .wc-block-components-product-image {
	margin: 0 -20px 25px;
}

.chl-rec .chl-card .wc-block-components-product-image a {
	display: block;
}

.chl-rec .chl-card .wc-block-components-product-image img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: scale-down !important;
}

.chl-rec .chl-card .chl-card-title {
	margin: 0 0 10px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.5;
}

.chl-rec .chl-card .chl-card-title a {
	color: #111518;
	text-decoration: none;
}

.chl-rec .chl-card .wp-block-woocommerce-product-price,
.chl-rec .chl-card .wp-block-woocommerce-product-button {
	grid-column: auto;
	align-self: end;
	display: flex;
	align-items: center;
	justify-content: center;
	/* 55px кнопки + отступы 2×5px + рамка 1px — общая высота ячеек */
	min-height: 66px;
	padding: 5px;
	border-top: 1px solid rgba(0, 0, 0, 0.05);
	font-size: 15px;
	font-weight: 600;
}

.chl-rec .chl-card .wp-block-woocommerce-product-price {
	position: relative;
	margin: 0 0 0 -20px;
}

.chl-rec .chl-card .wp-block-woocommerce-product-price::after {
	content: "";
	position: absolute;
	inset-inline-end: 0;
	top: calc(50% - 15px);
	width: 1px;
	height: 30px;
	background: rgba(0, 0, 0, 0.05);
}

.chl-rec .chl-card .wp-block-woocommerce-product-button {
	margin-right: -20px;
}

.chl-rec .chl-card .wp-block-woocommerce-product-button .wp-block-button__link {
	width: 100%;
	min-height: 55px;
	padding: 5px;
	background: transparent;
	border: none;
	border-radius: 50px;
	box-shadow: none;
	color: var(--theme-text-color);
	font-size: 15px;
	font-weight: 500;
}

.chl-rec .chl-card .wp-block-woocommerce-product-button .wp-block-button__link:hover {
	background: transparent;
	color: var(--theme-link-hover-color);
}

/* Активная товарная категория в списке категорий */
.wc-block-product-categories-list-item.is-current-category > a {
	color: var(--theme-palette-color-1);
	font-weight: 600;
}

/* Высота логотипа в шапке первого типа */
[data-header*="type-1"] .ct-header [data-id="logo"] .site-logo-container {
	--logo-max-height: 80px;
}

/* Колонка товаров «ждет» сайдбар, если она короче него */
@media (min-width: 1000px) {
	.woocommerce-archive [data-sidebar] > section {
		align-self: start;
		position: sticky;
		top: calc(var(--sidebar-offset, 50px) + var(--admin-bar, 0px) + var(--theme-frame-size, 0px) + var(--header-sticky-height, 0px) * (var(--sticky-shrink, 100) / 100));
	}
}

/* Страница «Контакты» */
.chl-contacts-main {
	padding-top: 64px;
	padding-bottom: 24px;
}

.chl-contacts-grid {
	gap: 50px;
	align-items: flex-start;
}

.chl-contacts-grid h2,
.chl-sellers h2,
.chl-contacts-form h2 {
	margin-top: 0;
	margin-bottom: 24px;
	font-size: 32px;
	line-height: 1.2;
	color: #2A1C14;
}

.chl-map iframe {
	display: block;
	width: 100%;
	height: 480px;
	border: 0;
	border-radius: 18px;
}

.chl-contacts-info {
	padding: 32px 30px;
	background: #fff;
	border: 1px solid #EFE6DA;
	border-radius: 18px;
}

.chl-contact-line {
	margin: 0 0 22px;
	font-size: 16px;
	line-height: 1.55;
	color: #2A1C14;
}

.chl-contact-line:last-child {
	margin-bottom: 0;
}

.chl-contact-label {
	display: block;
	margin-bottom: 5px;
	font-size: 13px;
	line-height: 1.4;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #8A7666;
}

.chl-contact-line a {
	color: #e31018;
	font-weight: 600;
	text-decoration: none;
}

.chl-contact-line a:hover {
	text-decoration: underline;
}

.chl-sellers {
	padding-top: 40px;
	padding-bottom: 80px;
}

.chl-sellers-grid {
	gap: 30px;
}

.chl-seller-card,
.chl-production {
	padding: 28px 30px;
	background: #F7F3EE;
	border-radius: 18px;
}

.chl-seller-card h3,
.chl-production h3 {
	margin-top: 0;
	margin-bottom: 16px;
	font-size: 20px;
	line-height: 1.3;
	color: #2A1C14;
}

.chl-production {
	margin-top: 30px;
}

.chl-contacts-form {
	padding-top: 60px;
	padding-bottom: 80px;
	background: #F7F3EE;
}

.chl-contacts-form .wpcf7 {
	max-width: 760px;
}

.chl-cf7-row {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
}

.chl-cf7-col {
	flex: 1 1 0;
	min-width: 0;
}

.chl-cf7-row > .chl-cf7-col > p {
	margin: 0;
}

.chl-contacts-form .wpcf7 p {
	margin: 0 0 18px;
}

.chl-contacts-form label {
	display: block;
	font-weight: 600;
	color: #2A1C14;
}

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

.chl-contacts-form input[type="text"],
.chl-contacts-form input[type="email"],
.chl-contacts-form input[type="tel"],
.chl-contacts-form textarea {
	width: 100%;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid #E5D8CA;
	border-radius: 10px;
	font-weight: 400;
}

.chl-contacts-form input[type="text"]:focus,
.chl-contacts-form input[type="email"]:focus,
.chl-contacts-form input[type="tel"]:focus,
.chl-contacts-form textarea:focus {
	border-color: #e31018;
	outline: none;
	box-shadow: none;
}

.chl-contacts-form textarea {
	min-height: 150px;
	resize: vertical;
}

.chl-contacts-form .wpcf7-acceptance .wpcf7-list-item {
	margin: 0;
}

.chl-contacts-form .wpcf7-acceptance label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 15px;
	line-height: 1.5;
	font-weight: 400;
	cursor: pointer;
}

.chl-contacts-form .wpcf7-acceptance input[type="checkbox"] {
	margin-top: 5px;
	flex: 0 0 auto;
}

.chl-contacts-form .wpcf7-acceptance a {
	color: #e31018;
}

.chl-contacts-form .smart-captcha {
	margin-bottom: 18px;
}

.chl-contacts-form .wpcf7-submit {
	padding: 14px 38px;
	background: #e31018;
	border: 1px solid #e31018;
	border-radius: 999px;
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

.chl-contacts-form .wpcf7-submit:hover {
	background: #b80d13;
	border-color: #b80d13;
}

.chl-contacts-form .wpcf7-response-output {
	margin: 18px 0 0;
	padding: 14px 18px;
	border-radius: 10px;
}

.chl-contacts-form .wpcf7-not-valid-tip {
	font-size: 14px;
	color: #e31018;
}

@media (max-width: 1100px) {
	.chl-contacts-grid {
		flex-wrap: wrap !important;
	}

	.chl-contacts-grid > .wp-block-column {
		flex-basis: 100% !important;
	}

	.chl-map iframe {
		height: 400px;
	}
}

/* Блок «Наши бренды» на главной */
.chl-brands {
	padding-top: 48px;
	padding-bottom: 52px;
	background: #C1B398;
}

.chl-brands h2 {
	margin-bottom: 34px;
	color: #2A1C14;
}

.chl-brands-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
}

.chl-brands-row img {
	display: block;
	width: auto;
	max-width: 100%;
}

.chl-brand-1 {
	height: clamp(46px, 9.4vw, 135px);
}

.chl-brand-2 {
	height: clamp(56px, 8.3vw, 120px);
}

.chl-brand-3 {
	height: clamp(32px, 6.7vw, 96px);
}

.chl-brand-4 {
	height: clamp(31px, 6.6vw, 95px);
}

@media (max-width: 640px) {
	.chl-brands {
		padding-top: 32px;
		padding-bottom: 36px;
	}

	.chl-brands h2 {
		margin-bottom: 24px;
	}

	.chl-brands-row {
		display: grid;
		grid-template-columns: 1fr 1fr;
		justify-items: center;
		gap: 26px 20px;
	}

	.chl-brand-1 {
		height: clamp(56px, 15vw, 74px);
	}

	.chl-brand-2 {
		height: clamp(60px, 16vw, 84px);
	}

	.chl-brand-3 {
		height: clamp(40px, 10.7vw, 53px);
	}

	.chl-brand-4 {
		height: clamp(39px, 10.5vw, 52px);
	}
}

@media (max-width: 767px) {
	.chl-contacts-main {
		padding-top: 36px;
		padding-bottom: 16px;
	}

	.chl-contacts-grid {
		gap: 30px;
	}

	.chl-contacts-grid h2,
	.chl-sellers h2,
	.chl-contacts-form h2 {
		margin-bottom: 18px;
		font-size: 24px;
		line-height: 1.25;
	}

	.chl-map iframe {
		height: 320px;
	}

	.chl-contacts-info,
	.chl-seller-card,
	.chl-production {
		padding: 24px 20px;
	}

	.chl-sellers {
		padding-top: 24px;
		padding-bottom: 56px;
	}

	.chl-sellers-grid {
		gap: 20px;
	}

	.chl-contacts-form {
		padding-top: 40px;
		padding-bottom: 56px;
	}

	.chl-cf7-row {
		flex-direction: column;
		gap: 0;
	}
}

/* Блок «Новости» на главной — по шаблону из демо Book Store */
.chl-news-head {
	align-items: center;
	margin-bottom: 30px;
}

.chl-news-head h2 {
	margin: 0;
}

.chl-news-grid {
	gap: 35px;
}

.chl-news .wp-block-post {
	margin-bottom: 35px;
}

.chl-news-thumb {
	margin: 0;
}

.chl-news-thumb img {
	width: 100%;
	height: auto;
	border-radius: 10px;
}

.chl-news-date {
	margin: 0 0 5px;
	font-size: 12px;
	line-height: 1.5;
	text-transform: uppercase;
}

.chl-news-title {
	margin: 0;
	font-size: clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.156), 16px);
	line-height: 1.5;
}

.chl-news-title a {
	color: inherit;
	text-decoration: none;
}

.chl-news-hero {
	position: relative;
	display: grid;
	padding: 0;
	overflow: hidden;
	border-radius: 10px;
}

.chl-news .chl-news-hero {
	min-height: 0;
}

.chl-news-hero .wp-block-cover__image-background,
.chl-news-hero .wp-block-cover__background,
.chl-news-hero .wp-block-cover__inner-container {
	grid-area: 1 / 1;
}

.chl-news-hero .wp-block-cover__image-background {
	position: static;
	align-self: start;
	width: 100%;
	height: auto;
	object-fit: contain;
}

.chl-news-hero .wp-block-cover__inner-container {
	align-self: end;
	padding: 20px;
}

.chl-news-hero .wp-block-cover__background {
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.75) 100%);
}

.chl-news-hero .chl-news-date,
.chl-news-hero-title,
.chl-news-terms {
	color: #fff;
}

.chl-news-hero-title {
	margin: 0 0 10px;
	font-size: 20px;
	line-height: 1.3;
}

.chl-news-hero-title a,
.chl-news-terms a {
	color: inherit;
	text-decoration: none;
}

.chl-news-terms {
	font-size: 12px;
	line-height: 1.5;
	text-transform: uppercase;
}

/* Высота слайдов главной идёт за шириной, картинка заполняет блок без обрезки */
@media (min-width: 768px) {
	body .chl-slider .swiper-slide-inner {
		aspect-ratio: 1290 / 377;
		min-height: 0 !important;
	}
}

/* На мобильных слайд заполняется картинкой с обрезкой по краям */
@media (max-width: 767px) {
	body .chl-slider .swiper-slide-inner {
		aspect-ratio: 16 / 9;
		min-height: 0 !important;
		background-size: cover !important;
	}

	body .chl-slider .slider-image-wrapper img {
		object-fit: cover !important;
	}
}

/* Стрелки Swiper — как листалки в карусели товаров */
.gs-swiper .swiper-button-prev,
.gs-swiper .swiper-button-next {
	top: calc(50% - 20px);
	width: 40px;
	height: 40px;
	margin-top: 0;
	border-radius: 100%;
	background: #fff;
	box-shadow: 0 25px 40px rgba(0, 0, 0, 0.03);
	color: var(--theme-text-color);
	transition: all 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.gs-swiper .swiper-button-prev {
	left: 20px;
}

.gs-swiper .swiper-button-next {
	right: 20px;
}

.gs-swiper .swiper-button-prev:hover,
.gs-swiper .swiper-button-next:hover {
	background: var(--theme-palette-color-1);
	color: #fff;
}

.gs-swiper .swiper-button-prev::after,
.gs-swiper .swiper-button-next::after {
	content: "";
	width: 16px;
	height: 10px;
	background: currentColor;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}

.gs-swiper .swiper-button-prev::after {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='M15.3 4.3h-13l2.8-3c.3-.3.3-.7 0-1-.3-.3-.6-.3-.9 0l-4 4.2-.2.2v.6c0 .1.1.2.2.2l4 4.2c.3.4.6.4.9 0 .3-.3.3-.7 0-1l-2.8-3h13c.2 0 .4-.1.5-.2s.2-.3.2-.5-.1-.4-.2-.5c-.1-.1-.3-.2-.5-.2z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='M15.3 4.3h-13l2.8-3c.3-.3.3-.7 0-1-.3-.3-.6-.3-.9 0l-4 4.2-.2.2v.6c0 .1.1.2.2.2l4 4.2c.3.4.6.4.9 0 .3-.3.3-.7 0-1l-2.8-3h13c.2 0 .4-.1.5-.2s.2-.3.2-.5-.1-.4-.2-.5c-.1-.1-.3-.2-.5-.2z'/%3E%3C/svg%3E");
}

.gs-swiper .swiper-button-next::after {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='M.2 4.5c-.1.1-.2.3-.2.5s.1.4.2.5c.1.1.3.2.5.2h13l-2.8 3c-.3.3-.3.7 0 1 .3.3.6.3.9 0l4-4.2.2-.2V5v-.3c0-.1-.1-.2-.2-.2l-4-4.2c-.3-.4-.6-.4-.9 0-.3.3-.3.7 0 1l2.8 3H.7c-.2 0-.4.1-.5.2z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='M.2 4.5c-.1.1-.2.3-.2.5s.1.4.2.5c.1.1.3.2.5.2h13l-2.8 3c-.3.3-.3.7 0 1 .3.3.6.3.9 0l4-4.2.2-.2V5v-.3c0-.1-.1-.2-.2-.2l-4-4.2c-.3-.4-.6-.4-.9 0-.3.3-.3.7 0 1l2.8 3H.7c-.2 0-.4.1-.5.2z'/%3E%3C/svg%3E");
}
