/* Area "chrome": header, mobile menu, language switcher, footer. See DESIGN.md. Breakpoints: 640, 960 px. */

/* ---------- header ---------- */
.e-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: #fff;
	transition: box-shadow .2s;
}
.e-header.is-scrolled { box-shadow: 0 1px 0 var(--e-line), var(--e-shadow-sm); }
.admin-bar .e-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .e-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .e-header { top: 0; } }

.e-header__bar {
	display: flex;
	align-items: center;
	gap: var(--e-s3);
	height: var(--e-header-h);
}

/* logo + short title */
.e-header__brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	margin-right: auto;
	color: var(--e-ink);
	border-radius: var(--e-radius-sm);
}
.e-header__brand:hover { color: var(--e-ink); }
.e-header__logo { flex: none; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.e-header__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	max-width: 240px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.01em;
}
.e-header__brand--hub .e-header__title { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
/* phones: the title stays the link's accessible name but is not shown (the hub keeps its short wordmark) */
@media (max-width: 639.98px) {
	.e-header__brand:not(.e-header__brand--hub) .e-header__title {
		position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
		clip: rect(0 0 0 0); white-space: nowrap; border: 0;
	}
}

/* right side: test button (hub: choose your country) and burger */
.e-header__actions { display: flex; flex: none; align-items: center; gap: var(--e-s2); }
.e-header__cta { padding: 10px 18px; font-size: 15px; }
.e-header__cta.e-btn--primary { box-shadow: 0 4px 12px rgba(37, 99, 235, .2); }
.e-header__cta--short, .e-header__cta-short { display: none; }
@media (max-width: 639.98px) {
	.e-header__cta { padding: 10px 14px; }
	.e-header__cta--long, .e-header__cta-long { display: none; }
	.e-header__cta--short { display: inline-flex; }
	.e-header__cta-short { display: inline; }
}

.e-header__burger {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--e-line);
	border-radius: var(--e-radius-md);
	background: #fff;
	color: var(--e-ink);
}
.e-header__burger:hover { background: var(--e-bg-soft); }
.e-header__icon-close, .e-header.is-open .e-header__icon-open { display: none; }
.e-header.is-open .e-header__icon-close { display: block; }

/* menu links */
.e-header__menu a {
	display: flex;
	align-items: center;
	font-weight: 600;
	color: var(--e-text);
	white-space: nowrap;
}
.e-header__menu a:hover { color: var(--e-ink); }
.e-header__menu a[aria-current="page"] { color: var(--e-primary-700); }

/* ---------- language switcher: segmented "RU | UZ" ---------- */
.e-lang__label {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.e-lang__list {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border: 1px solid var(--e-line);
	border-radius: var(--e-radius-md);
	background: var(--e-bg-soft);
}
.e-lang__link {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 36px;
	padding: 0 10px;
	border-radius: 9px;
	color: var(--e-text);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .03em;
}
.e-lang__link:hover { color: var(--e-ink); background: #fff; }
.e-lang__link[aria-current] { background: #fff; color: var(--e-ink); box-shadow: var(--e-shadow-sm); }
.e-lang__name {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- desktop: menu in the bar ---------- */
@media (min-width: 960px) {
	.e-header__bar { gap: var(--e-s4); }
	.e-header__brand { margin-right: 0; }
	.e-header__nav {
		display: flex;
		flex: 1 1 auto;
		align-items: center;
		justify-content: flex-end;
		gap: var(--e-s4);
		min-width: 0;
	}
	.e-header__menu { display: flex; align-items: center; gap: 2px; margin: 0 auto; }
	.e-header__menu a { min-height: 44px; padding: 0 12px; border-radius: var(--e-radius-sm); font-size: 16px; }
	.e-header__menu a:hover { background: var(--e-bg-soft); }
	.e-header__menu a[aria-current="page"] { background: var(--e-primary-50); }
	.e-header__burger, .e-header__backdrop { display: none; }
}

@media (min-width: 960px) and (max-width: 1199.98px) { .e-header__title { max-width: 190px; } }

/* ---------- phones and tablets: menu in a full-width panel under the bar ---------- */
@media (max-width: 959.98px) {
	.e-header__nav {
		position: fixed;
		top: var(--e-panel-top, var(--e-header-h));
		left: 0;
		right: 0;
		z-index: 1;
		max-height: calc(100vh - var(--e-panel-top, var(--e-header-h)));
		max-height: calc(100dvh - var(--e-panel-top, var(--e-header-h)));
		overflow-y: auto;
		overscroll-behavior: contain;
		padding: var(--e-s2) var(--e-s5) var(--e-s6);
		background: #fff;
		border-top: 1px solid var(--e-line);
		box-shadow: var(--e-shadow-md);
		visibility: hidden;
		opacity: 0;
		transform: translateY(-8px);
		transition: opacity .2s, transform .2s, visibility 0s linear .2s;
	}
	.e-header.is-open .e-header__nav { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
	.e-header__menu a {
		min-height: 52px;
		padding: 0 var(--e-s1);
		border-bottom: 1px solid var(--e-line);
		font-size: 18px;
		color: var(--e-ink);
		white-space: normal;
	}

	.e-header__backdrop {
		position: fixed;
		inset: var(--e-panel-top, var(--e-header-h)) 0 0 0;
		background: rgba(15, 23, 42, .45);
		visibility: hidden;
		opacity: 0;
		transition: opacity .2s, visibility 0s linear .2s;
	}
	.e-header.is-open .e-header__backdrop { visibility: visible; opacity: 1; transition-delay: 0s; }

	.e-header__nav .e-lang { margin-top: var(--e-s5); }
	.e-header__nav .e-lang__label {
		position: static; width: auto; height: auto; margin: 0 0 var(--e-s2); overflow: visible; clip: auto;
		display: block; font-size: 14px; font-weight: 600; color: var(--e-muted);
	}
	.e-header__nav .e-lang__list { display: flex; width: 100%; }
	.e-header__nav .e-lang__list > li { flex: 1 1 0; min-width: 0; }
	.e-header__nav .e-lang__link { min-height: 44px; font-size: 16px; font-weight: 600; letter-spacing: 0; }
	.e-header__nav .e-lang__code { display: none; }
	.e-header__nav .e-lang__name {
		position: static; width: auto; height: auto; margin: 0; overflow: hidden; clip: auto;
		text-overflow: ellipsis;
	}
}
body.e-nav-open { overflow: hidden; }

/* no JavaScript: the menu is shown as a second row of the header */
@media (max-width: 959.98px) and (scripting: none) {
	.e-header__bar { flex-wrap: wrap; height: auto; min-height: var(--e-header-h); padding-top: var(--e-s2); padding-bottom: var(--e-s2); }
	.e-header__burger { display: none; }
	.e-header__nav {
		position: static; order: 3; flex: 1 0 100%; max-height: none; padding: 0; border: 0; box-shadow: none;
		visibility: visible; opacity: 1; transform: none;
		display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-s2) var(--e-s4);
	}
	.e-header__menu { display: flex; flex-wrap: wrap; gap: 0 var(--e-s4); }
	.e-header__menu a { min-height: 44px; border: 0; font-size: 16px; }
	.e-header__nav .e-lang { margin: 0; }
	.e-header__nav .e-lang__label { display: none; }
}

/* ---------- footer ---------- */
.e-footer {
	padding: var(--e-s12) 0 var(--e-s6);
	background: var(--e-dark);
	color: #cbd5e1;
	font-size: 15px;
	line-height: 1.5;
}
@media (min-width: 960px) { .e-footer { padding-top: var(--e-s16); } }
.e-footer a { color: #e2e8f0; }
.e-footer a:hover { color: #fff; }
.e-footer :focus-visible { outline-color: #93c5fd; }

.e-footer__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--e-s10) var(--e-s8);
}
@media (min-width: 640px) { .e-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) {
	/* one row: the brand column is wider, the others share the rest (3 or 4 columns) */
	.e-footer__grid { grid-auto-flow: column; grid-template-columns: minmax(0, 1.5fr); grid-auto-columns: minmax(0, 1fr); }
}

.e-footer__about { display: flex; flex-direction: column; align-items: flex-start; gap: var(--e-s4); }
.e-footer__brand { display: inline-flex; align-items: center; gap: var(--e-s3); max-width: 100%; color: #fff; border-radius: var(--e-radius-sm); }
.e-footer__brand:hover { color: #fff; }
.e-footer__logo { flex: none; width: 48px; height: 48px; border-radius: var(--e-radius-md); object-fit: cover; }
.e-footer__name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	font-size: 17px;
	font-weight: 750;
	line-height: 1.3;
	letter-spacing: -.01em;
}
.e-footer__title { max-width: 38ch; color: #fff; font-size: 17px; font-weight: 650; line-height: 1.4; }
.e-footer__text { max-width: 46ch; color: #94a3b8; }
.e-footer__stores { margin-top: var(--e-s1); }

.e-footer__heading { margin: 0 0 var(--e-s3); color: #fff; font-size: 15px; font-weight: 700; line-height: 1.4; letter-spacing: .01em; }
.e-footer__links { display: flex; flex-direction: column; }
.e-footer__links a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	max-width: 100%;
	min-height: 40px;
	padding: 4px 0;
	color: #cbd5e1;
}
.e-footer__links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.e-footer__links a > span { min-width: 0; overflow-wrap: anywhere; }
.e-footer__links svg { flex: none; color: #93c5fd; }

.e-footer__countries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--e-s4); }
@media (min-width: 960px) { .e-footer__countries { grid-template-columns: minmax(0, 1fr); } }
.e-footer__flag { flex: none; width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

.e-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--e-s2) var(--e-s6);
	margin-top: var(--e-s10);
	padding-top: var(--e-s5);
	border-top: 1px solid rgba(255, 255, 255, .12);
	color: #94a3b8;
	font-size: 14px;
}
.e-footer__copy { min-width: 0; overflow-wrap: anywhere; }
.e-footer__legal-links { display: flex; flex-wrap: wrap; gap: 0 var(--e-s5); }
.e-footer__legal-links a { display: inline-flex; align-items: center; min-height: 40px; color: #94a3b8; }
.e-footer__legal-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

@media print {
	.e-header { position: static; box-shadow: none; }
	.e-header__nav, .e-header__actions, .e-header__backdrop, .e-footer__grid, .e-footer__legal { display: none; }
	.e-footer { padding: var(--e-s4) 0; background: none; color: #000; }
	.e-footer__bottom { margin: 0; border: 0; color: #000; }
}
