/* Ella Equestrian: fejléc. Méretek a Figma "Home_dekstop_01_mod" és "Home_mobile_v01_mod" frame-ek alapján. */

.ella-header {
	--ella-header-fg: var(--contrast);
	position: relative;
	z-index: 100;
	color: var(--ella-header-fg);
	background: var(--base-3);
	border-bottom: 1px solid var(--base);
}

/* Főoldal: átlátszó, a hero képre kerül. */
.ella-header--overlay {
	--ella-header-fg: #fff;
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	background: transparent;
	border-bottom: 0;
}

.admin-bar .ella-header--overlay {
	top: 32px;
}

.ella-header__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 24px;
	max-width: 1512px;
	margin: 0 auto;
	padding: 16px 60px;
}

.ella-header--overlay .ella-header__inner {
	padding-top: 33px;
	padding-bottom: 33px;
}

.ella-header a,
.ella-header button {
	color: inherit;
	text-decoration: none;
}

.ella-header a:focus-visible,
.ella-header button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

/* Főmenü */

.ella-menu {
	display: flex;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ella-menu li {
	position: relative;
}

.ella-menu > li > a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transition: opacity 0.15s;
}

.ella-menu > li > a:hover {
	opacity: 0.75;
}

.ella-menu .menu-item-has-children > a::after {
	content: "";
	width: 7px;
	height: 7px;
	border-right: 1.75px solid currentColor;
	border-bottom: 1.75px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
}

.ella-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: -16px;
	z-index: 10;
	min-width: 220px;
	margin: 0;
	padding: 12px 0;
	list-style: none;
	background: var(--base-3);
	border-radius: 8px;
	box-shadow: 0 12px 32px rgba(26, 26, 26, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s, transform 0.18s, visibility 0s 0.18s;
}

.ella-menu li:hover > .sub-menu,
.ella-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.18s, transform 0.18s;
}

.ella-menu .sub-menu a {
	display: block;
	padding: 10px 16px;
	color: var(--contrast);
	font-size: 15px;
	font-weight: 500;
}

.ella-menu .sub-menu a:hover {
	color: var(--accent);
	background: var(--accent-light);
}

/* Logó */

.ella-header__logo {
	display: block;
	line-height: 0;
}

.ella-logo svg {
	display: block;
	width: auto;
	height: 100%;
}

.ella-logo--vertical {
	display: block;
	height: 72px;
}

.ella-header--overlay .ella-logo--vertical {
	height: 108px;
}

.ella-logo--horizontal {
	display: none;
	height: 57px;
}

/* Ikonok és nyelvváltó */

.ella-header__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 20px;
}

.ella-header .ella-header__icon,
.ella-header .ella-header__icon:hover,
.ella-header .ella-header__icon:focus {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
}

.ella-header__icon svg {
	width: 24px;
	height: 24px;
}

.ella-cart__count {
	position: absolute;
	top: -6px;
	right: -9px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 17px;
	text-align: center;
	background: var(--accent);
	border-radius: 9px;
}

.ella-cart__count[hidden] {
	display: none;
}

.ella-lang {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 12px;
	background: var(--base);
	border-radius: 999px;
}

.ella-header--overlay .ella-lang {
	background: rgba(255, 255, 255, 0.25);
}

.ella-lang a {
	display: block;
	width: 24px;
	height: 24px;
	overflow: hidden;
	border-radius: 50%;
}

.ella-lang svg {
	display: block;
	width: 100%;
	height: 100%;
}

.ella-lang a[aria-current] {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ella-menu-toggle,
.ella-nav__close,
.ella-nav__extra {
	display: none !important;
}

/* Keresés */

.ella-search {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	padding: 20px 60px;
	background: var(--base-3);
	box-shadow: 0 12px 32px rgba(26, 26, 26, 0.12);
}

.ella-search[hidden],
.ella-backdrop[hidden] {
	display: none;
}

.ella-search form {
	display: flex;
	gap: 12px;
	max-width: 720px;
	margin: 0 auto;
}

.ella-search input[type="search"] {
	flex: 1;
	padding: 14px 16px;
	color: var(--contrast);
	border: 1px solid var(--contrast-3);
	border-radius: 8px;
}

.ella-search button {
	padding: 0 24px;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: var(--accent);
	border-radius: 8px;
}

.ella-search button:hover {
	background: var(--accent-2);
}

/* Mobil és tablet */

@media (max-width: 1024px) {
	.ella-header__inner {
		grid-template-columns: auto 1fr;
		padding: 12px 20px;
	}

	.ella-header--overlay .ella-header__inner {
		padding-top: 28px;
		padding-bottom: 28px;
	}

	.ella-logo--vertical,
	.ella-header--overlay .ella-logo--vertical {
		display: none;
	}

	.ella-logo--horizontal {
		display: block;
		height: 48px;
	}

	.ella-header--overlay .ella-logo--horizontal {
		height: 57px;
	}

	.ella-header__actions .ella-search-toggle,
	.ella-header__actions .ella-account {
		display: none;
	}

	.ella-header .ella-menu-toggle {
		display: inline-flex !important;
	}

	.ella-header__actions {
		gap: 16px;
	}

	.ella-lang {
		gap: 10px;
		padding: 9px 10px;
	}

	.ella-lang a {
		width: 20px;
		height: 20px;
	}

	/* A főmenü jobbról becsúszó panel lesz. */
	.ella-header__nav {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 102;
		width: min(360px, 88vw);
		padding: 72px 24px 32px;
		overflow-y: auto;
		color: var(--contrast);
		background: var(--base-3);
		visibility: hidden;
		transform: translateX(100%);
		transition: transform 0.25s ease, visibility 0s 0.25s;
	}

	.ella-header__nav.is-open {
		visibility: visible;
		transform: none;
		transition: transform 0.25s ease;
	}

	/* A :hover/:focus is kell, különben a fenti .ella-header__icon:focus (position: relative) felülírja
	   megnyitáskor, mert a menü fókuszt ad a gombnak. */
	.ella-header .ella-nav__close,
	.ella-header .ella-nav__close:hover,
	.ella-header .ella-nav__close:focus {
		position: absolute;
		top: 24px;
		right: 24px;
		display: inline-flex !important;
	}

	.ella-header .ella-nav__close:focus:not(:focus-visible) {
		outline: none;
	}

	.ella-menu {
		flex-direction: column;
		gap: 0;
	}

	.ella-menu > li {
		border-bottom: 1px solid var(--base);
	}

	.ella-menu > li > a {
		display: flex;
		padding: 18px 0;
		font-size: 15px;
	}

	.ella-menu .menu-item-has-children > a::after {
		display: none;
	}

	.ella-menu .sub-menu {
		position: static;
		min-width: 0;
		padding: 0 0 12px 12px;
		background: none;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.ella-menu .sub-menu a {
		padding: 8px 0;
	}

	.ella-nav__extra {
		display: grid !important;
		gap: 4px;
		margin-top: 24px;
	}

	.ella-nav__extra a,
	.ella-nav__extra button,
	.ella-nav__extra button:hover,
	.ella-nav__extra button:focus {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 12px 0;
		color: var(--contrast);
		font-size: 15px;
		font-weight: 500;
		text-align: left;
		background: none;
		border: 0;
	}

	.ella-nav__extra svg {
		width: 22px;
		height: 22px;
	}

	.ella-backdrop {
		position: fixed;
		inset: 0;
		z-index: 101;
		background: rgba(26, 26, 26, 0.45);
	}

	.ella-search {
		padding: 16px 20px;
	}

	body.ella-menu-open {
		overflow: hidden;
	}
}

@media (max-width: 782px) {
	.admin-bar .ella-header--overlay {
		top: 46px;
	}
}

/* Biztonsági háló: semmi ne tegye oldalra görgethetővé az oldalt (a clip a sticky elemeket nem rontja el). */
html,
body {
	overflow-x: clip;
}

/* Mobilon a GeneratePress a széles (alignwide) blokkokat a képernyő széléig húzza (-30px margó);
   a WooCommerce kosár és pénztár blokkja ilyen, ezért maradjon 20px szél. */
@media (max-width: 768px) {
	.entry-content .wp-block-woocommerce-cart.alignwide,
	.entry-content .wp-block-woocommerce-checkout.alignwide {
		width: calc(100% + 20px);
		max-width: calc(100% + 20px);
		margin-right: -10px;
		margin-left: -10px;
	}
}

/* VP Woo Pont (kosár, pénztár): automata kiválasztása előtt a bővítmény ::after-rel írja ki újra a díjat,
   de az eredeti árat (régi WooCommerce <strong>) nem tudja elrejteni, így kétszer jelenne meg.
   Itt van, mert ez a stíluslap minden oldalon betöltődik. */
.wc-block-components-totals-shipping[data--vp-selected-point=""] .wc-block-components-totals-item__value::after {
	content: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.ella-header *,
	.ella-header *::after {
		transition: none !important;
	}
}
