/**
 * enpapa.gr — Header v2 (namespace .epp-header only)
 */

:root {
	--epp-h-bg: #ffffff;
	--epp-h-border: rgba(15, 23, 42, 0.09);
	--epp-h-text: #0f172a;
	--epp-h-muted: #64748b;
	--epp-h-accent: #e53935;
	--epp-h-shell: min(1440px, calc(100vw - 2 * clamp(16px, 4vw, 40px)));
	--epp-h-z: 10050;
	--epp-drawer-z: 100060;
}

/* Reset scope: logo block from WP */
.epp-header__brand figure,
.epp-header__mobbrand figure {
	margin: 0;
}

.epp-header .custom-logo-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.epp-header .custom-logo-link img,
.epp-header__mobbrand .custom-logo-link img {
	display: block;
	height: auto;
	max-height: 48px;
	width: auto;
	max-width: min(220px, 44vw);
	object-fit: contain;
}

.epp-header__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.epp-header {
	position: sticky;
	top: 0;
	z-index: var(--epp-h-z);
	background: var(--epp-h-bg);
	box-shadow: 0 1px 0 var(--epp-h-border);
}

body.admin-bar .epp-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .epp-header {
		top: 46px;
	}
}

.epp-header__shell {
	width: 100%;
	max-width: var(--epp-h-shell);
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
	padding-left: clamp(12px, 2.5vw, 20px);
	padding-right: clamp(12px, 2.5vw, 20px);
}

/* Main row desktop */
.epp-header__shell--main {
	padding-top: 0.65rem;
	padding-bottom: 0.65rem;
}

.epp-header__desktop {
	display: none;
	align-items: center;
	gap: clamp(16px, 2.5vw, 28px);
	min-height: 64px;
}

.epp-header__brand {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	min-width: 0;
}

.epp-header__homelink {
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--epp-h-text);
	text-decoration: none;
}

.epp-header__search {
	flex: 1 1 auto;
	min-width: 0;
	max-width: none;
	display: flex;
	align-items: center;
	justify-content: stretch;
}

.epp-header__search .stewe-header-search-wrap,
.epp-header__search .stewe-header-search,
.epp-header__mobsearch .stewe-header-search-wrap,
.epp-header__mobsearch .stewe-header-search {
	width: 100%;
	max-width: none;
	margin: 0;
}

.epp-header__search .stewe-header-search,
.epp-header__mobsearch .stewe-header-search {
	height: 46px;
	border-radius: 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.epp-header__search .stewe-header-search:focus-within,
.epp-header__mobsearch .stewe-header-search:focus-within {
	border-color: rgba(229, 57, 53, 0.45);
	box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

.epp-header__actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 6px;
}

.epp-header__iconbtn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--epp-h-text);
	text-decoration: none;
	cursor: pointer;
	box-sizing: border-box;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.epp-header__iconbtn:hover {
	background: rgba(15, 23, 42, 0.05);
}

.epp-header__svg {
	display: block;
	flex-shrink: 0;
}

.epp-header__badge {
	position: absolute;
	top: 4px;
	right: 2px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--epp-h-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	box-sizing: border-box;
}

.epp-header__badge[data-empty="1"] {
	background: #94a3b8;
}

/* Mobile bar */
.epp-header__mobilebar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-height: 56px;
}

.epp-header__mobbrand {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.epp-header__mobbrand .custom-logo-link {
	justify-content: center;
}

.epp-header__menubtn {
	border: 1px solid var(--epp-h-border);
}

.epp-header__mobsearch {
	padding-bottom: 12px;
}

.epp-header__mobsearch[hidden] {
	display: none !important;
}

.epp-header__mobsearch:not([hidden]) {
	display: block;
}

/* Nav row (desktop) */
.epp-header__navrow {
	border-top: 1px solid var(--epp-h-border);
	background: #fafafa;
}

.epp-header__shell--nav {
	padding-top: 0;
	padding-bottom: 0;
}

.epp-header__primary {
	width: 100%;
}

.epp-header__menu {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.epp-header__menu > li {
	position: relative;
	margin: 0;
}

.epp-header__menu > li > a {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 0 14px;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--epp-h-text);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	box-sizing: border-box;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.epp-header__menu > li > a:hover,
.epp-header__menu > li.current-menu-item > a,
.epp-header__menu > li.current_page_item > a {
	color: var(--epp-h-accent);
	border-bottom-color: rgba(229, 57, 53, 0.45);
	background: rgba(255, 255, 255, 0.6);
}

.epp-header__menu .sub-menu {
	position: absolute;
	left: 0;
	top: 100%;
	min-width: 220px;
	margin: 0;
	padding: 0.35rem 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--epp-h-border);
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
	z-index: calc(var(--epp-h-z) + 2);
}

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

.epp-header__menu .sub-menu li a {
	display: block;
	padding: 0.5rem 1rem;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--epp-h-text);
	text-decoration: none;
}

.epp-header__menu .sub-menu li a:hover {
	background: rgba(15, 23, 42, 0.04);
	color: var(--epp-h-accent);
}

.epp-header__menu .sub-menu .sub-menu {
	top: 0;
	left: 100%;
	margin-left: 4px;
}

/* Drawer */
.epp-header__drawer[hidden] {
	display: none !important;
}

.epp-header__drawer:not([hidden]) {
	display: block;
}

.epp-header__drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
	z-index: var(--epp-drawer-z);
}

.epp-header__drawer-panel {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: min(400px, 92vw);
	background: #fff;
	z-index: calc(var(--epp-drawer-z) + 1);
	box-shadow: 8px 0 32px rgba(15, 23, 42, 0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-sizing: border-box;
}

.epp-header__drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid var(--epp-h-border);
	flex-shrink: 0;
}

.epp-header__drawer-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--epp-h-text);
}

.epp-header__drawer-x {
	border: 0;
	background: transparent;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	color: var(--epp-h-muted);
	padding: 4px 8px;
	border-radius: 8px;
}

.epp-header__drawer-x:hover {
	background: rgba(15, 23, 42, 0.06);
	color: var(--epp-h-text);
}

.epp-header__drawer-body {
	overflow-y: auto;
	padding: 12px 0 24px;
	-webkit-overflow-scrolling: touch;
}

.epp-header__drawer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.epp-header__drawer-menu > li > a {
	display: block;
	padding: 12px 18px;
	font-weight: 600;
	color: var(--epp-h-text);
	text-decoration: none;
	border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.epp-header__drawer-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0 0 8px 12px;
}

.epp-header__drawer-menu .sub-menu a {
	display: block;
	padding: 8px 18px;
	font-size: 0.92rem;
	color: var(--epp-h-muted);
	text-decoration: none;
}

.epp-header__drawer-account {
	margin: 16px 18px 0;
	padding-top: 12px;
	border-top: 1px solid var(--epp-h-border);
}

.epp-header__drawer-account a {
	font-weight: 600;
	color: var(--epp-h-accent);
	text-decoration: none;
}

body.epp-header-v2.epp-drawer-open {
	overflow: hidden;
}

/* Desktop / mobile visibility */
@media (min-width: 1024px) {
	.epp-header__desktop {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr) auto;
		align-items: center;
		column-gap: clamp(16px, 2.5vw, 28px);
	}

	.epp-header__mobilebar {
		display: none;
	}

	.epp-header__mobsearch {
		display: none !important;
	}

	.epp-header__navrow {
		display: block;
	}
}

@media (max-width: 1023px) {
	.epp-header__desktop {
		display: none;
	}

	.epp-header__navrow {
		display: none;
	}

	.epp-header__shell--main {
		padding-bottom: 0.35rem;
	}
}
