/* ==========================================================================
   Шапка и подвал jfgs.ru. Своя вёрстка, без Elementor.
   ========================================================================== */

@font-face {
	font-family: 'JFCinzel';
	src: url('../../Cinzel-Regular.woff2') format('woff2'),
	     url('../../Cinzel-Regular.woff') format('woff');
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--jfhf-gold: #c0943e;
	--jfhf-gold-light: #d9b45b;
	--jfhf-cream: #ede0c4;
	--jfhf-dark: #100d0d;
	--jfhf-ink: #33373d;
	--jfhf-wrap: 1520px;
	--jfhf-side: 5%;
	--jfhf-display: 'JFCinzel', 'Cin', Georgia, 'Times New Roman', serif;
	--jfhf-font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* --------------------------------------------------------------- шапка -- */

.jf-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 5;
	padding: 15px var(--jfhf-side) 0;
	font-family: var(--jfhf-font);
}

/* админ-бар не должен накрывать шапку и выезжающие панели у залогиненных */
.admin-bar .jf-header,
.admin-bar .jf-cart-panel,
.admin-bar .jf-mobile-nav {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .jf-header,
	.admin-bar .jf-cart-panel,
	.admin-bar .jf-mobile-nav {
		top: 46px;
	}
}

.jf-header__inner {
	display: flex;
	align-items: flex-start;
	gap: 32px;
	max-width: var(--jfhf-wrap);
	margin: 0 auto;
}

.jf-header__logo {
	flex: 0 0 auto;
	display: block;
	line-height: 0;
}

.jf-header__logo img {
	display: block;
	width: 110px;
	height: 110px;
	object-fit: contain;
}

.jf-header__main {
	flex: 1 1 auto;
	min-width: 0;
}

.jf-header__top {
	display: flex;
	align-items: center;
	gap: 28px;
	min-height: 56px;
}

.jf-header__addr {
	margin: 0 auto 0 0;
	font-size: 15px;
	line-height: 1.35;
	color: #fff;
}

.jf-header__contacts {
	display: flex;
	align-items: center;
	gap: 26px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.jf-header__contacts a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #fff;
	font-size: 16px;
	text-decoration: none;
	transition: color .25s ease;
}

.jf-header__contacts a:hover {
	color: var(--jfhf-gold-light);
}

.jf-header__contacts svg {
	width: 20px;
	height: 20px;
	fill: var(--jfhf-gold);
	flex: 0 0 auto;
	transition: fill .25s ease;
}

.jf-header__contacts a:hover svg {
	fill: var(--jfhf-gold-light);
}

.jf-header__phone {
	font-family: var(--jfhf-display);
	font-size: 22px;
	letter-spacing: .02em;
	color: #fff;
	text-decoration: none;
	white-space: nowrap;
	transition: color .25s ease;
}

.jf-header__phone:hover {
	color: var(--jfhf-gold-light);
}

/* ------------------------------------------------------ основное меню -- */

.jf-nav {
	margin-top: 4px;
}

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

.jf-nav__list li {
	position: relative;
	margin: 0;
}

.jf-nav__list > li > a {
	display: block;
	padding: 10px 12px;
	font-family: var(--jfhf-display);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	transition: color .25s ease, background-color .25s ease;
}

.jf-nav__list > li > a:hover {
	color: var(--jfhf-gold-light);
}

.jf-nav__list > li.current-menu-item > a {
	background: var(--jfhf-gold);
	color: var(--jfhf-dark);
}

.jf-nav__list > li.current-menu-ancestor > a,
.jf-nav__list > li.current-menu-parent > a {
	color: var(--jfhf-gold-light);
}

.jf-nav__list > li.menu-item-has-children > a::after {
	content: '';
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-left: 8px;
	vertical-align: 2px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform .25s ease;
}

.jf-nav__list > li.menu-item-has-children:hover > a::after {
	transform: rotate(225deg) translate(-2px, -2px);
}

/* выпадающее */

.jf-nav__list .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 20;
	min-width: 260px;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

.jf-nav__list > li:last-child .sub-menu,
.jf-nav__list > li:nth-last-child(2) .sub-menu {
	left: auto;
	right: 0;
}

.jf-nav__list > li:hover > .sub-menu,
.jf-nav__list > li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.jf-nav__list .sub-menu a {
	display: block;
	padding: 12px 20px;
	font-family: var(--jfhf-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--jfhf-ink);
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease;
}

.jf-nav__list .sub-menu a:hover {
	background: #f5efe2;
	color: var(--jfhf-gold);
}

/* ----------------------------------------------------- кнопка корзины -- */

.jf-cart__toggle {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: var(--jfhf-gold);
	cursor: pointer;
	transition: background-color .25s ease, transform .2s ease;
}

.jf-cart__toggle:hover {
	background: var(--jfhf-gold-light);
	transform: translateY(-1px);
}

.jf-cart__toggle svg {
	width: 24px;
	height: 24px;
	fill: var(--jfhf-dark);
}

.jf-cart__count {
	position: absolute;
	top: -7px;
	right: -7px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 100px;
	background: var(--jfhf-dark);
	color: #fff;
	font-family: var(--jfhf-font);
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
}

/* --------------------------------------------------------- бургер --- */

.jf-burger {
	display: none;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	padding: 11px 10px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	cursor: pointer;
}

.jf-burger span {
	display: block;
	height: 2px;
	background: #fff;
	border-radius: 2px;
	transition: transform .3s ease, opacity .3s ease;
}

.jf-burger span + span {
	margin-top: 5px;
}

/* ------------------------------------------------ мобильное меню --- */

.jf-mobile-nav {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 1002;
	width: min(360px, 88vw);
	padding: 20px 24px 40px;
	background: var(--jfhf-dark);
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform .35s cubic-bezier(.4, 0, .2, 1);
	font-family: var(--jfhf-font);
}

.jf-mobile-nav.is-open {
	transform: translateX(0);
}

.jf-mobile-nav__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid rgba(237, 224, 196, .18);
	font-family: var(--jfhf-display);
	font-size: 18px;
	color: var(--jfhf-gold-light);
}

.jf-close {
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	color: var(--jfhf-cream);
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	transition: color .2s ease;
}

.jf-close:hover {
	color: var(--jfhf-gold);
}

.jf-mobile-nav__list,
.jf-mobile-nav__list .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.jf-mobile-nav__list li {
	position: relative;
	border-bottom: 1px solid rgba(237, 224, 196, .1);
}

.jf-mobile-nav__list a {
	display: block;
	padding: 13px 40px 13px 0;
	color: var(--jfhf-cream);
	font-size: 16px;
	text-decoration: none;
}

.jf-mobile-nav__list .current-menu-item > a {
	color: var(--jfhf-gold-light);
}

.jf-mobile-nav__list .sub-menu {
	display: none;
	padding-left: 14px;
	border-top: 1px solid rgba(237, 224, 196, .1);
}

.jf-mobile-nav__list li.is-open > .sub-menu {
	display: block;
}

.jf-mobile-nav__list .sub-menu a {
	padding: 11px 0;
	font-size: 15px;
	color: rgba(237, 224, 196, .82);
}

.jf-sub-toggle {
	position: absolute;
	top: 4px;
	right: 0;
	width: 38px;
	height: 40px;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.jf-sub-toggle::before,
.jf-sub-toggle::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 11px;
	height: 1.5px;
	background: var(--jfhf-gold);
	transform: translate(-50%, -50%);
	transition: transform .25s ease, opacity .25s ease;
}

.jf-sub-toggle::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.jf-mobile-nav__list li.is-open > .jf-sub-toggle::after {
	opacity: 0;
	transform: translate(-50%, -50%) rotate(0);
}

.jf-mobile-nav__contacts {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 26px;
}

.jf-mobile-nav__contacts a {
	color: var(--jfhf-cream);
	font-size: 15px;
	text-decoration: none;
}

.jf-mobile-nav__contacts a:first-child {
	font-family: var(--jfhf-display);
	font-size: 20px;
	color: #fff;
}

/* ------------------------------------------------- панель корзины --- */

.jf-cart-panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 1002;
	display: flex;
	flex-direction: column;
	width: min(400px, 92vw);
	background: var(--jfhf-dark);
	color: var(--jfhf-cream);
	font-family: var(--jfhf-font);
	transform: translateX(100%);
	transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

.jf-cart-panel.is-open {
	transform: translateX(0);
}

.jf-cart-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	border-bottom: 1px solid rgba(237, 224, 196, .18);
	font-family: var(--jfhf-display);
	font-size: 20px;
	color: var(--jfhf-gold-light);
}

.jf-cart-panel__body {
	flex: 1 1 auto;
	padding: 20px 24px 28px;
	overflow-y: auto;
}

/* Содержимое мини-корзины рисует WooCommerce, но пока стоит Elementor Pro,
   он подменяет разметку на свою. Поддерживаем оба набора классов,
   чтобы панель не поехала после отключения плагина. */

.jf-cart-panel .woocommerce-mini-cart,
.jf-cart-panel .elementor-menu-cart__products {
	margin: 0;
	padding: 0;
	list-style: none;
}

.jf-cart-panel .elementor-menu-cart__product {
	display: grid;
	grid-template-columns: 64px 1fr 26px;
	grid-template-areas:
		'img name remove'
		'img price remove';
	align-items: center;
	column-gap: 14px;
	row-gap: 4px;
	padding: 16px 0;
	border-bottom: 1px solid rgba(237, 224, 196, .12);
}

.jf-cart-panel .elementor-menu-cart__product-image {
	grid-area: img;
}

.jf-cart-panel .elementor-menu-cart__product-name {
	grid-area: name;
	align-self: end;
}

.jf-cart-panel .elementor-menu-cart__product-price {
	grid-area: price;
	align-self: start;
}

.jf-cart-panel .elementor-menu-cart__product-remove {
	grid-area: remove;
	position: static;
}

/* Elementor рисует свой крестик двумя повёрнутыми псевдоэлементами,
   ширина которых берётся из переменных его же шаблона. Переменных нет,
   полосы растягиваются во всю строку. Гасим и рисуем крестик сами. */
.jf-cart-panel .elementor-menu-cart__product-remove::before,
.jf-cart-panel .elementor-menu-cart__product-remove::after {
	content: none !important;
}

.jf-cart-panel .elementor-menu-cart__product-remove a {
	position: static !important;
}

.jf-cart-panel .woocommerce-mini-cart-item {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px 32px 16px 0;
	border-bottom: 1px solid rgba(237, 224, 196, .12);
}

.jf-cart-panel .elementor-menu-cart__product-image img,
.jf-cart-panel .woocommerce-mini-cart-item img {
	display: block;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 6px;
	flex: 0 0 auto;
}

.jf-cart-panel .woocommerce-mini-cart-item img {
	order: -1;
}

.jf-cart-panel .elementor-menu-cart__product-name a,
.jf-cart-panel .woocommerce-mini-cart-item a:not(.remove):not(.remove_from_cart_button) {
	color: var(--jfhf-cream);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
	transition: color .2s ease;
}

.jf-cart-panel .elementor-menu-cart__product-name a:hover,
.jf-cart-panel .woocommerce-mini-cart-item a:not(.remove):not(.remove_from_cart_button):hover {
	color: var(--jfhf-gold-light);
}

.jf-cart-panel .elementor-menu-cart__product-price,
.jf-cart-panel .quantity {
	display: block;
	font-size: 14px;
	color: rgba(237, 224, 196, .78);
}

/* Elementor кладёт две одинаковые ссылки удаления, показываем штатную. */
.jf-cart-panel .elementor_remove_from_cart_button {
	display: none !important;
}

.jf-cart-panel .elementor-menu-cart__product-remove a.remove_from_cart_button,
.jf-cart-panel .remove_from_cart_button,
.jf-cart-panel a.remove {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(237, 224, 196, .12);
	color: var(--jfhf-cream) !important;
	font-size: 0;
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease;
}

.jf-cart-panel .woocommerce-mini-cart-item a.remove {
	position: absolute;
	top: 16px;
	right: 0;
}

.jf-cart-panel .remove_from_cart_button::before,
.jf-cart-panel a.remove::before {
	content: '\00d7';
	font-size: 19px;
	line-height: 1;
}

.jf-cart-panel .remove_from_cart_button:hover,
.jf-cart-panel a.remove:hover {
	background: var(--jfhf-gold);
	color: var(--jfhf-dark) !important;
}

.jf-cart-panel .woocommerce-mini-cart__empty-message {
	margin: 28px 0;
	text-align: center;
	color: rgba(237, 224, 196, .75);
}

.jf-cart-panel .elementor-menu-cart__subtotal,
.jf-cart-panel .woocommerce-mini-cart__total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 20px 0;
	padding-top: 18px;
	border: 0;
	border-top: 1px solid rgba(237, 224, 196, .18);
	font-size: 17px;
	color: #fff;
	text-align: left;
}

.jf-cart-panel .elementor-menu-cart__subtotal strong,
.jf-cart-panel .woocommerce-mini-cart__total strong {
	font-weight: 500;
}

.jf-cart-panel .elementor-menu-cart__subtotal .amount,
.jf-cart-panel .woocommerce-mini-cart__total .amount {
	color: var(--jfhf-gold-light);
	font-size: 19px;
	font-weight: 600;
	white-space: nowrap;
}

.jf-cart-panel .elementor-menu-cart__footer-buttons,
.jf-cart-panel .woocommerce-mini-cart__buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
}

.jf-cart-panel .elementor-menu-cart__footer-buttons a,
.jf-cart-panel .woocommerce-mini-cart__buttons a {
	display: block;
	padding: 13px 18px;
	border-radius: 8px;
	border: 1px solid var(--jfhf-gold);
	background: transparent;
	color: var(--jfhf-gold-light);
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: background-color .25s ease, color .25s ease;
}

.jf-cart-panel .elementor-button--checkout,
.jf-cart-panel .woocommerce-mini-cart__buttons a.checkout {
	background: var(--jfhf-gold);
	color: var(--jfhf-dark);
}

.jf-cart-panel .elementor-menu-cart__footer-buttons a:hover,
.jf-cart-panel .woocommerce-mini-cart__buttons a:hover {
	background: var(--jfhf-gold-light);
	color: var(--jfhf-dark);
}

/* ---------------------------------------------------------- оверлей -- */

.jf-overlay {
	position: fixed;
	inset: 0;
	z-index: 1001;
	background: rgba(0, 0, 0, .6);
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility .3s;
}

.jf-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

body.jf-locked {
	overflow: hidden;
}

/* Закрытые выезжающие панели стоят за правым краем окна и создавали
   горизонтальную прокрутку. Раньше это гасил инлайновый стиль
   в подвале Elementor. Clip вместо hidden, чтобы не ломать sticky. */
html {
	overflow-x: clip;
}

@supports not (overflow-x: clip) {
	body {
		overflow-x: hidden;
	}
}

/* --------------------------------------------------------- подвал --- */

.jf-footer {
	font-family: var(--jfhf-font);
	color: var(--jfhf-cream);
	background: #000;
	border-top: 1px solid rgba(237, 224, 196, .14);
}

.jf-footer__inner {
	display: grid;
	grid-template-columns: 1.35fr 1fr 1.1fr 1.1fr;
	gap: 40px;
	max-width: var(--jfhf-wrap);
	margin: 0 auto;
	padding: 64px var(--jfhf-side) 48px;
}

.jf-footer__col > *:last-child {
	margin-bottom: 0;
}

.jf-footer__logo {
	display: inline-block;
	margin-bottom: 18px;
	line-height: 0;
}

.jf-footer__logo img {
	width: 130px;
	height: 130px;
	object-fit: contain;
}

.jf-footer h3 {
	margin: 0 0 16px;
	font-family: var(--jfhf-font);
	font-size: 26px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--jfhf-gold-light);
}

.jf-footer p {
	margin: 0 0 14px;
	font-size: 16px;
	line-height: 1.55;
	color: var(--jfhf-cream);
}

.jf-footer__slogan {
	font-weight: 700;
	color: #fff !important;
}

.jf-footer a {
	color: var(--jfhf-cream);
	text-decoration: none;
	transition: color .25s ease;
}

.jf-footer a:hover {
	color: var(--jfhf-gold-light);
}

.jf-footer__links {
	margin: 0;
	padding: 0;
	list-style: none;
}

.jf-footer__links li {
	margin-bottom: 10px;
}

.jf-footer__links a {
	font-size: 16px;
}

.jf-footer__hours {
	color: rgba(237, 224, 196, .75) !important;
}

.jf-footer__bottom {
	border-top: 1px solid rgba(237, 224, 196, .14);
}

.jf-footer__bottom p {
	max-width: var(--jfhf-wrap);
	margin: 0 auto;
	padding: 20px var(--jfhf-side);
	font-size: 14px;
	color: rgba(255, 255, 255, .8);
	text-align: center;
}

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

@media (max-width: 1400px) {
	.jf-header__addr {
		font-size: 14px;
	}

	.jf-header__top {
		gap: 20px;
	}

	.jf-nav__list > li > a {
		padding: 10px 9px;
		font-size: 15px;
	}
}

@media (max-width: 1200px) {
	.jf-header__contacts a span {
		display: none;
	}

	.jf-header__contacts {
		gap: 16px;
	}
}

@media (max-width: 1024px) {
	.jf-header {
		padding-top: 12px;
	}

	.jf-header__inner {
		align-items: center;
		gap: 16px;
	}

	.jf-header__logo img {
		width: 74px;
		height: 74px;
	}

	.jf-header__addr,
	.jf-header__contacts,
	.jf-nav {
		display: none;
	}

	.jf-header__top {
		justify-content: flex-end;
		gap: 14px;
		min-height: 0;
	}

	.jf-header__phone {
		margin-right: auto;
		font-size: 19px;
	}

	.jf-burger {
		display: block;
	}

	.jf-footer__inner {
		grid-template-columns: 1fr 1fr;
		gap: 36px;
		padding-top: 48px;
	}

	.jf-footer__col--brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 600px) {
	.jf-header__phone {
		font-size: 0;
	}

	.jf-header__phone::before {
		content: '+7 495 143-19-19';
		font-size: 15px;
	}

	.jf-header__logo img {
		width: 62px;
		height: 62px;
	}

	.jf-cart__toggle {
		width: 52px;
		height: 40px;
	}

	.jf-footer__inner {
		grid-template-columns: 1fr;
		gap: 32px;
		padding-top: 40px;
	}

	.jf-footer h3 {
		font-size: 22px;
	}

	.jf-footer__logo img {
		width: 104px;
		height: 104px;
	}
}
