/* ==========================================================================
   Каталог jfgs.ru: главная магазина и страницы категорий. Без Elementor.
   ========================================================================== */

:root {
	--jf-cat-gold: #c0943e;
	--jf-cat-gold-light: #d9b45b;
	--jf-cat-cream: #ede0c4;
	--jf-cat-font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--jf-cat-display: 'JFCinzel', 'Cin', Georgia, 'Times New Roman', serif;
}

/* ------------------------------------------------- верхний блок ------- */

.jf-hero {
	position: relative;
	isolation: isolate;
	display: flex;
	align-items: flex-start;
	min-height: 288px;
	overflow: hidden;
	font-family: var(--jf-cat-font);
	background:
		radial-gradient(115% 150% at 80% 4%, rgba(192, 148, 62, .26) 0%, rgba(192, 148, 62, 0) 58%),
		radial-gradient(95% 130% at 8% 96%, rgba(16, 81, 59, .72) 0%, rgba(6, 26, 20, 0) 62%),
		linear-gradient(118deg, #04120d 0%, #0a3527 30%, #10513b 48%, #08281e 70%, #050505 100%);
}

/* На карточке товара блок только декоративный, без текста внутри. */
.jf-hero--bare {
	min-height: 250px;
}

/* Там main лежит в обёртке WooCommerce, поэтому соседний селектор ниже
   не срабатывает. Свои отступы под шапку-оверлей задают и main,
   и блок товара, их место занял герой. */
.single-product main.jf-woocommerce-page,
.single-product .jf-product-top {
	padding-top: 0;
}

.jf-hero__art {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.jf-hero__beams {
	display: block;
	width: 100%;
	height: 100%;
}

/* мягкий уход в чёрный, чтобы блок сшивался со страницей */
.jf-hero::after {
	content: '';
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: -1;
	height: 140px;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, #000 100%);
	pointer-events: none;
}

.jf-hero__fan {
	animation: jfBeamDrift 15s ease-in-out infinite;
}

.jf-hero__glow {
	animation: jfGlowPulse 9s ease-in-out infinite;
}

.jf-hero__sparks circle {
	animation: jfSpark 5.5s ease-in-out infinite;
}

.jf-hero__sparks circle:nth-child(2) { animation-delay: .8s; }
.jf-hero__sparks circle:nth-child(3) { animation-delay: 1.7s; }
.jf-hero__sparks circle:nth-child(4) { animation-delay: 2.5s; }
.jf-hero__sparks circle:nth-child(5) { animation-delay: 3.3s; }
.jf-hero__sparks circle:nth-child(6) { animation-delay: 4.1s; }

@keyframes jfBeamDrift {
	0%, 100% { transform: translateX(0); opacity: .92; }
	50%      { transform: translateX(-28px); opacity: 1; }
}

@keyframes jfGlowPulse {
	0%, 100% { opacity: .82; }
	50%      { opacity: 1; }
}

@keyframes jfSpark {
	0%, 100% { opacity: .2; }
	50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.jf-hero__fan,
	.jf-hero__glow,
	.jf-hero__sparks circle {
		animation: none;
	}
}

.jf-hero__inner {
	position: relative;
	width: 100%;
	max-width: 1520px;
	margin: 0 auto;
	/* сверху запас под шапку, она лежит поверх контента */
	padding: 148px 5% 34px;
}

.jf-hero__crumbs {
	margin-bottom: 16px;
	font-size: 14px;
	color: rgba(237, 224, 196, .7);
}

.jf-hero__crumbs a {
	color: var(--jf-cat-gold-light);
	text-decoration: none;
}

.jf-hero__crumbs a:hover {
	color: #fff;
}

.jf-hero__crumbs .woocommerce-breadcrumb {
	margin: 0;
	color: inherit;
}

.jf-hero__title {
	margin: 0;
	font-family: var(--jf-cat-display);
	font-size: clamp(2.1rem, 4.2vw, 3.7rem);
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: .02em;
	color: #fff;
	text-shadow: 0 6px 34px rgba(0, 0, 0, .55);
}

.jf-hero__desc {
	max-width: 640px;
	margin-top: 20px;
	font-size: 16px;
	line-height: 1.6;
	color: rgba(237, 224, 196, .88);
}

.jf-hero__desc p:last-child {
	margin-bottom: 0;
}

/* ----------------------------------------------------- тело каталога -- */

/* У main в теме свой отступ сверху под шапку-оверлей.
   Там, где сверху стоит герой, он лишний. */
.jf-hero ~ .jf-woocommerce-page {
	padding-top: 0;
}

.jf-shop {
	max-width: 1520px;
	margin: 0 auto;
	padding: 30px 5% 90px;
	font-family: var(--jf-cat-font);
	color: var(--jf-cat-cream);
}

/* Текстовый блок под категориями на главной магазина.
   Редактируется в Страницы, Магазин. */
.jf-shop__intro {
	max-width: 900px;
	margin: 72px auto 0;
	padding-top: 44px;
	border-top: 1px solid rgba(237, 224, 196, .14);
	font-size: 17px;
	line-height: 1.7;
	color: rgba(237, 224, 196, .88);
}

.jf-shop__intro h2,
.jf-shop__intro h3,
.jf-shop__intro h4 {
	margin: 32px 0 14px;
	font-family: var(--jf-cat-display);
	font-weight: 400;
	line-height: 1.2;
	color: var(--jf-cat-gold-light);
}

.jf-shop__intro h2 { font-size: 28px; }
.jf-shop__intro h3 { font-size: 23px; }

.jf-shop__intro > *:first-child {
	margin-top: 0;
}

.jf-shop__intro p {
	margin: 0 0 16px;
}

.jf-shop__intro a {
	color: var(--jf-cat-gold-light);
}

.jf-shop__intro ul,
.jf-shop__intro ol {
	margin: 0 0 16px;
	padding-left: 22px;
}

.jf-shop__intro li {
	margin-bottom: 8px;
}

/* Строка сортировки и счётчика над сеткой товаров. */
.jf-shop__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin: 0 0 34px;
	padding-bottom: 18px;
	border-bottom: 1px solid rgba(237, 224, 196, .14);
}

.jf-shop__controls .woocommerce-result-count {
	margin: 0;
	font-size: 15px;
	color: rgba(237, 224, 196, .75);
}

.jf-shop__controls .woocommerce-ordering {
	margin: 0;
}

.jf-shop__controls select {
	padding: 9px 14px;
	border: 1px solid rgba(237, 224, 196, .25);
	border-radius: 8px;
	background: #100d0d;
	color: var(--jf-cat-cream);
	font-family: inherit;
	font-size: 15px;
}

/* Пагинация. */
.jf-shop__pagination {
	margin-top: 54px;
	text-align: center;
}

.jf-shop__pagination .woocommerce-pagination ul {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	list-style: none;
}

.jf-shop__pagination .woocommerce-pagination li {
	margin: 0;
	border: 0;
}

.jf-shop__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border: 1px solid rgba(237, 224, 196, .22);
	border-radius: 8px;
	background: transparent;
	color: var(--jf-cat-cream);
	font-size: 15px;
	text-decoration: none;
	transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

.jf-shop__pagination .page-numbers:hover,
.jf-shop__pagination .page-numbers.current {
	border-color: var(--jf-cat-gold);
	background: var(--jf-cat-gold);
	color: #100d0d;
}

/* Отступ между блоком категорий и сеткой товаров. */
.jf-shop .jf-cats-container + .jf-shop__controls {
	margin-top: 56px;
}

/* WooCommerce вешает на ul.products клирфикс-псевдоэлементы с display:table.
   В CSS-гриде они становятся полноценными ячейками, из-за чего слева
   и в конце сетки появлялись пустые места. Касается и похожих товаров
   на карточке, поэтому правило не привязано к .jf-shop. */
.jf-woocommerce-page ul.products::before,
.jf-woocommerce-page ul.products::after,
.jf-shop ul.products::before,
.jf-shop ul.products::after {
	content: none !important;
	display: none !important;
}

/* Кнопки В корзину на одном уровне независимо от длины названия,
   наличия старой цены и числа строк в характеристиках:
   содержимое карточки растягивается, кнопка прижимается к низу. */
.jf-woocommerce-page ul.products li.product {
	display: flex;
	flex-direction: column;
}

.jf-woocommerce-page ul.products li.product > .woocommerce-LoopProduct-link {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
}

.jf-woocommerce-page ul.products li.product > .button,
.jf-woocommerce-page ul.products li.product > .added_to_cart {
	margin-top: auto;
}

/* Стрелки карусели похожих товаров тема создаёт скриптом,
   но стилей им не даёт, и они наследуют розовую кнопку Hello Elementor. */
.jf-scroll-nav {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin: 0 0 24px;
}

.jf-scroll-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(209, 161, 83, .45);
	border-radius: 50%;
	background: transparent;
	color: #d1a153;
	cursor: pointer;
	transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

.jf-scroll-btn:hover,
.jf-scroll-btn:focus {
	border-color: #d1a153;
	background: #d1a153;
	color: #000;
}

.jf-scroll-btn svg {
	display: block;
	width: 20px;
	height: 20px;
}

/* ------------------------------------------------------ адаптив ------- */

@media (max-width: 1024px) {
	.jf-hero {
		min-height: 280px;
	}

	.jf-hero--bare {
		min-height: 190px;
	}

	.jf-hero__inner {
		padding: 116px 5% 44px;
	}

	.jf-shop {
		padding: 44px 5% 64px;
	}
}

@media (max-width: 600px) {
	.jf-hero {
		min-height: 240px;
	}

	.jf-hero--bare {
		min-height: 150px;
	}

	.jf-hero__inner {
		padding: 100px 5% 36px;
	}

	.jf-hero::after {
		height: 90px;
	}

	.jf-shop {
		padding: 36px 5% 48px;
	}

	.jf-shop__intro {
		margin-top: 52px;
		padding-top: 32px;
		font-size: 16px;
	}

	.jf-shop__controls {
		justify-content: flex-start;
	}
}
