/*
 * Zaglavlje — ticker, logo red, nav, mobilni header i drawer.
 *
 * Desktop je tri reda; ispod 768px se cijela struktura mijenja u jedan
 * tamni red + off-canvas drawer (mobilni ekran 7 iz dizajna).
 */

/* — 1. Ticker —————————————————————————————————— */

.ep-ticker {
	height: 34px;
	background: var(--ep-brand-dark);
	color: var(--ep-ticker-text);
	overflow: hidden;
	display: flex;
	align-items: center;
}

.ep-ticker__track {
	display: flex;
	white-space: nowrap;
	animation: ep-tick var(--ep-ticker-duration) linear infinite;
}

.ep-ticker__set {
	display: flex;
	gap: 44px;
	padding-right: 44px;
	font-size: 10.5px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.ep-ticker__sep {
	color: var(--ep-on-dark-accent);
}

/*
 * Traka se pomiče za točno -50 %, a sadržaj je dupliciran — zato je petlja
 * bešavna. Ako se broj poruka promijeni, mora se promijeniti u OBA seta,
 * inače se pojavi vidljivi skok.
 */
@keyframes ep-tick {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
	.ep-ticker__track {
		animation: none;
	}

	/* Bez animacije drugi set je samo mrtav tekst izvan ekrana. */
	.ep-ticker__set:last-child {
		display: none;
	}
}

/* — 2. Logo red ———————————————————————————————— */

.ep-head {
	background: var(--ep-surface);
	border-bottom: 1px solid var(--ep-brand-dark);
}

.ep-head__inner {
	display: flex;
	align-items: center;
	gap: 30px;
	height: 78px;
}

.ep-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--ep-brand-dark);
}

.ep-brand:hover {
	color: var(--ep-brand-dark);
}

.ep-brand__mark {
	width: 42px;
	height: 42px;
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ep-brand);
	color: #fff;
	font-family: var(--ep-font-display);
	font-size: 23px;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.ep-brand__text {
	display: block;
	line-height: 1;
}

.ep-brand__name {
	display: block;
	font-family: var(--ep-font-display);
	font-size: 27px;
	font-weight: 700;
	letter-spacing: 0.005em;
	text-transform: uppercase;
}

.ep-brand__tag {
	display: block;
	margin-top: 4px;
	font-size: 9.5px;
	letter-spacing: 0.26em;
	text-transform: uppercase;
	color: var(--ep-muted);
}

/* Kad je u medijskoj knjižnici pravi logo, zamjenjuje mark + text. */
.ep-brand__img {
	display: block;
	height: 46px;
	width: auto;
}

/* — Pretraga ——————————————————————————————————— */

/*
 * Search je namjerno samo donja linija — bez okvira, bez podloge.
 * Zato ovdje NE vrijede globalni .ep-input stilovi.
 */
.ep-search {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 10px;
	width: 250px;
	padding: 7px 2px;
	border-bottom: 1.5px solid var(--ep-brand-dark);
}

.ep-search__input {
	width: 100%;
	border: none;
	outline: none;
	background: none;
	padding: 0;
	font-family: var(--ep-font-body);
	font-size: 11.5px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ep-ink);
}

.ep-search__input::placeholder {
	color: var(--ep-muted);
	opacity: 1;
}

.ep-search__submit {
	border: none;
	background: none;
	padding: 0;
	font-size: 13px;
	line-height: 1;
	color: var(--ep-brand);
	cursor: pointer;
}

/* — Košarica ——————————————————————————————————— */

.ep-cart {
	display: flex;
	align-items: stretch;
	height: 44px;
	color: #fff;
	flex: none;
}

.ep-cart:hover {
	color: #fff;
}

.ep-cart__label {
	display: flex;
	align-items: center;
	padding: 0 18px;
	background: var(--ep-brand-dark);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.ep-cart__count {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	background: var(--ep-brand-alt);
	font-family: var(--ep-font-display);
	font-size: 19px;
	font-weight: 700;
}

/* — 3. Nav ————————————————————————————————————— */

.ep-nav {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--ep-surface);
	border-bottom: 1px solid var(--ep-hair);
}

.ep-nav__inner {
	display: flex;
	align-items: stretch;
}

.ep-nav a {
	padding: 15px 20px 13px;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ep-muted);
	border-bottom: 3px solid transparent;
	transition: color var(--ep-ease), border-color var(--ep-ease);
}

.ep-nav a:hover {
	color: var(--ep-brand);
}

.ep-nav .current-menu-item > a,
.ep-nav .current-menu-ancestor > a,
.ep-nav a[aria-current="page"] {
	color: var(--ep-ink);
	border-bottom-color: var(--ep-brand);
}

.ep-nav ul {
	display: flex;
	align-items: stretch;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ep-nav li {
	display: flex;
}

/* — Mobilno ———————————————————————————————————— */

.ep-head-mobile {
	display: none;
	background: var(--ep-brand-dark);
	color: #fff;
}

.ep-head-mobile__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 58px;
}

.ep-head-mobile .ep-brand,
.ep-head-mobile .ep-brand:hover {
	color: #fff;
}

.ep-head-mobile .ep-brand__tag {
	color: var(--ep-on-dark);
}

.ep-head-mobile .ep-brand__name {
	font-size: 21px;
}

.ep-head-mobile .ep-brand__mark {
	width: 34px;
	height: 34px;
	font-size: 19px;
	background: var(--ep-brand-alt);
}

.ep-burger {
	width: var(--ep-tap);
	height: var(--ep-tap);
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	border: none;
	background: none;
	cursor: pointer;
	padding: 0;
}

.ep-burger span {
	display: block;
	width: 20px;
	height: 1.5px;
	background: #fff;
}

.ep-cart-mobile {
	margin-left: auto;
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: var(--ep-tap);
	height: 34px;
	padding: 0 12px;
	background: var(--ep-brand-alt);
	color: #fff;
	font-family: var(--ep-font-display);
	font-size: 17px;
	font-weight: 700;
}

.ep-cart-mobile:hover {
	color: #fff;
}

/* Mikro-traka ispod mobilnog headera. */
.ep-microbar {
	display: none;
	background: var(--ep-brand);
	color: #fff;
	text-align: center;
	padding: 7px var(--ep-gutter);
	font-size: 9.5px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

/* — Drawer ————————————————————————————————————— */

.ep-drawer {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	flex-direction: column;
	background: var(--ep-brand);
	color: #fff;
	transform: translateX(-100%);
	transition: transform var(--ep-ease);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.ep-drawer[data-open="true"] {
	transform: translateX(0);
}

.ep-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px var(--ep-gutter);
	border-bottom: 1px solid var(--ep-brand-line);
}

.ep-drawer__close {
	width: var(--ep-tap);
	height: var(--ep-tap);
	border: none;
	background: none;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.ep-drawer__nav {
	display: flex;
	flex-direction: column;
	padding: 0 var(--ep-gutter);
}

.ep-drawer__nav a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 62px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
	color: #fff;
	font-family: var(--ep-font-display);
	font-size: 28px;
	font-weight: 700;
	text-transform: uppercase;
	line-height: 1;
}

.ep-drawer__nav a::after {
	content: "→";
	font-family: var(--ep-font-body);
	font-size: 18px;
	color: var(--ep-brand-line);
}

.ep-drawer__foot {
	margin-top: auto;
	padding: 26px var(--ep-gutter) 34px;
}

.ep-drawer__phone {
	display: block;
	font-family: var(--ep-font-display);
	font-size: 30px;
	font-weight: 700;
	color: #fff;
}

.ep-drawer__hours {
	margin-top: 4px;
	font-size: 12.5px;
	color: var(--ep-brand-line);
}

.ep-drawer__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 18px;
}

.ep-drawer__chip {
	padding: 8px 12px;
	border: 1px solid var(--ep-brand-line);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

/* Kad je drawer otvoren, pozadina se ne smije skrolati ispod njega. */
body.ep-drawer-open {
	overflow: hidden;
}

/* — Breakpoint ————————————————————————————————— */

@media (max-width: 767px) {
	.ep-head,
	.ep-nav {
		display: none;
	}

	.ep-head-mobile,
	.ep-microbar {
		display: block;
	}

	/* Statična jednolinijska traka — bez animacije, kao u dizajnu. */
	.ep-ticker {
		height: auto;
		padding: 8px var(--ep-gutter);
	}

	.ep-ticker__track {
		animation: none;
		white-space: normal;
		justify-content: center;
	}

	.ep-ticker__set:last-child {
		display: none;
	}

	.ep-ticker__set {
		gap: 10px;
		flex-wrap: wrap;
		justify-content: center;
		padding-right: 0;
		font-size: 9.5px;
		letter-spacing: 0.14em;
	}
}

@media (min-width: 768px) {
	.ep-drawer {
		display: none;
	}
}
