/*
 * The header menu both parts of familia.lt share (Familia_Menu, class-menu.php; client 2026-10-13: "one header menu").
 * familia.lt's look – its `.mainmenu`, `.submenu` and `.hamburgerMenu` (themes/familia-web site.css + theme.css) – for
 * one markup in both headers. Behaviour: menu.js.
 *
 *   bar      from 1025px, in the header's row: 16px brown items, 10px 18px (14px sides up to 1200px), red while their
 *            panel is open, underlined when the current page is in them
 *   panel    under the header, its full width: 90% white over an 8px blur, 10px lower corners, a soft shadow; titled
 *            columns (18px semibold) of grey 16px links, four a row, the item's photo (430px, 280px up to 1200px) on
 *            the right; a catalogue (the shop's categories): the categories on the left, the pointed one's columns –
 *            its sub-items, heading sub-categories, brands (two columns of six), Medžiaga / Kaina – and its photo
 *   burger   familia.lt's three 1px lines that spin into a cross, at every width
 *   drawer   under the header on the right, 280px (320px up to 1024px), 20px inside, 10px left corners, sliding in
 *            from the right in .6s: up to 1024px the menu (20px items, each opening its titled lists in place), then
 *            the links at every width, then the grey service lines
 * The panels and the drawer hang from the header's box (familia.lt's fixed `.header`, the shop's `.f-bar`).
 * Specificity: two classes (+ the state's) – above the shop's `.familia button` / `.familia a:hover` (familia.css).
 */

/* ------------------------------------------------------------------ bar */

.f-menu { display: none; }
@media (min-width: 1025px) {
	.f-menu { display: flex; min-width: 0; }
}
.f-menu .f-menu__list { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; }
.f-menu .f-menu__item { position: static; display: block; margin: 0 10px 0 0; padding: 0; list-style: none; }
.f-menu .f-menu__link {
	display: block;
	width: auto;
	min-height: 0;
	margin: 0;
	padding: 10px 18px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #3d291d;
	font: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: none;
	-webkit-tap-highlight-color: transparent;
}
/* hovering changes nothing (familia.lt); the item whose panel is open is red, the current section underlined */
.f-menu .f-menu__link:is(:hover, :focus, :active) { background: transparent; color: #3d291d; transform: none; box-shadow: none; text-decoration: none; }
.f-menu .f-menu__item.is-current > .f-menu__link { text-decoration: underline; }
.f-menu .f-menu__item.is-open > .f-menu__link,
.f-menu:not(.is-ready) .f-menu__item--mega:is(:hover, :focus-within) > .f-menu__link { color: #f00f00; }
.f-menu .f-menu__link:focus-visible { outline: 3px solid #007c91; outline-offset: -3px; }
@media (max-width: 1200px) {
	.f-menu .f-menu__item { margin-right: 0; }
	.f-menu .f-menu__link { padding: 10px 14px; }
}

/* ------------------------------------------------------------------ panel */

.f-menu .f-menu__panel {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	z-index: 3;
	max-height: calc(100vh - 76px);
	max-height: calc(100dvh - 76px);
	overflow: auto;
	overscroll-behavior: contain;
	border-radius: 0 0 10px 10px;
	background: rgb(255 255 255 / .9);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	box-shadow: 0 0 10px rgb(102 105 107 / .1);
	color: #3d291d;
	text-align: left;
	cursor: auto;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	pointer-events: none;
	transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.f-menu .f-menu__item.is-open > .f-menu__panel,
.f-menu:not(.is-ready) .f-menu__item--mega:is(:hover, :focus-within) > .f-menu__panel {   /* without the script: hover and keyboard focus */
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
	transition-delay: 0s;
}
.f-menu .f-menu__in {
	box-sizing: border-box;
	display: flex;
	gap: 20px;
	width: 100%;
	max-width: 1920px;
	margin: 0 auto;
	padding: 20px 30px;
}
@media (max-width: 1200px) {
	.f-menu .f-menu__panel { max-height: calc(100vh - 68px); max-height: calc(100dvh - 68px); }
	.f-menu .f-menu__in { padding-inline: 20px; }
}

/* titled columns, four a row (familia.lt: 25% − 15px with 20px between, 20px between the rows) */
.f-menu .f-menu__groups { display: grid; flex: 1 1 auto; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; min-width: 0; align-content: start; }
.f-menu .f-menu__title { margin: 0; color: #3d291d; font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: 0; text-transform: none; }
.f-menu .f-menu__title-link { color: inherit; text-decoration: none; transition: none; }
.f-menu .f-menu__title-link:is(:hover, [aria-current="page"]) { color: #f00f00; text-decoration: none; }
.f-menu .f-menu__links { margin: 12px 0 0; padding: 0; list-style: none; }
.f-menu .f-menu__links > li { margin: 0 0 10px; padding: 0; list-style: none; }
.f-menu .f-menu__links > li:last-child { margin-bottom: 0; }
.f-menu .f-menu__sublink { display: block; color: #676767; font-size: 16px; font-weight: 400; line-height: 1.2; text-decoration: none; transition: none; }
.f-menu .f-menu__sublink:is(:hover, [aria-current="page"]) { color: #f00f00; text-decoration: none; }
.f-menu .f-menu__all {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 16px;
	color: #3d291d;
	font-size: 14px;
	font-weight: 600;
	line-height: 20px;
	text-decoration: none;
	transition: none;
}
.f-menu .f-menu__all:hover { color: #f00f00; text-decoration: none; }
.f-menu .f-menu-ico { display: block; flex: none; }
.f-menu :is(.f-menu__title-link, .f-menu__sublink, .f-menu__all, .f-menu__cat-link, .f-menu__photo):focus-visible { outline: 3px solid #007c91; outline-offset: 2px; }

/* the item's photo: as tall as the columns, never cropped (familia.lt: contain, 10px corners) */
.f-menu .f-menu__photo {
	position: relative;
	display: block;
	flex: 0 0 430px;
	align-self: stretch;
	min-height: 200px;
	overflow: hidden;
	border-radius: 10px;
}
.f-menu .f-menu__photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; }
@media (max-width: 1200px) {
	.f-menu .f-menu__photo { flex-basis: 280px; }
}

/* the shop's catalogue: categories on the left, the pointed one's columns on the right (one pane at a time; the others
   stay in the reading and tab order, out of sight – focus in one shows it) */
.f-menu .f-menu__cats { display: grid; flex: 1 1 auto; grid-auto-rows: min-content; grid-template-columns: 230px minmax(0, 1fr); column-gap: 40px; min-width: 0; }
.f-menu .f-menu__cat { display: contents; }
.f-menu .f-menu__cat-link {
	grid-column: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 9px 0;
	border: 0;
	border-bottom: 1px solid rgb(61 41 29 / .1);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #3d291d;
	font: inherit;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.35;
	text-align: left;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	transition: none;
}
.f-menu .f-menu__cat-link:is(:hover, :focus, :active) { background: transparent; color: #3d291d; transform: none; box-shadow: none; text-decoration: none; }
.f-menu .f-menu__cat.is-active > .f-menu__cat-link,
.f-menu .f-menu__cat > .f-menu__cat-link[aria-current="page"] { color: #f00f00; }
.f-menu .f-menu__cat-link .f-menu-ico { opacity: .6; }
.f-menu .f-menu__all--cats { grid-column: 1; justify-self: start; margin-top: 14px; }
.f-menu .f-menu__pane { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: flex-start; gap: 24px 0; min-width: 0; }
.f-menu .f-menu__cat > .f-menu__pane { grid-column: 2; grid-row: 1 / span 40; }
.f-menu .f-menu__cat:not(.is-active) > .f-menu__pane {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.f-menu .f-menu__col { flex: 0 0 auto; box-sizing: border-box; width: 220px; padding-right: 20px; }
.f-menu .f-menu__col--brands { width: 340px; }
.f-menu .f-menu__col--brands .f-menu__links { display: grid; grid-auto-flow: column; grid-template-rows: repeat(6, auto); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.f-menu .f-menu__col--brands .f-menu__links > li { margin: 0; }
.f-menu .f-menu__col--shortcuts { width: 180px; }
.f-menu .f-menu__subgroup + .f-menu__subgroup { margin-top: 22px; }
.f-menu .f-menu__pane .f-menu__photo { flex: 1 1 240px; max-width: 340px; min-height: 240px; margin-left: auto; background: #f6f6f6; }
@media (max-width: 1279px) {
	.f-menu .f-menu__cats { grid-template-columns: 200px minmax(0, 1fr); column-gap: 30px; }
	.f-menu .f-menu__pane .f-menu__photo { display: none; }
}

/* ------------------------------------------------------------------ burger */

.f-menu-burger[data-f-menu-burger],
.f-menu-burger[data-f-menu-burger]:is(:hover, :focus, :active) {
	position: relative;
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 38px;
	min-width: 38px;
	height: 38px;
	min-height: 38px;
	margin: 0;
	padding: 8px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #3d291d;
	cursor: pointer;
	transform: none;
	-webkit-tap-highlight-color: transparent;
}
.f-menu-burger[data-f-menu-burger]:focus-visible { outline: 3px solid #007c91; outline-offset: 2px; }
.f-menu-burger .f-menu-burger__in { position: relative; display: block; width: 100%; height: 1px; margin-top: -.5px; transition: transform .5s cubic-bezier(.645, .045, .355, 1); }
.f-menu-burger .f-menu-burger__bar {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 1px;
	background: #3d291d;
	transform-origin: 40% 50%;
	transition: transform .4s cubic-bezier(.645, .045, .355, 1), opacity .2s cubic-bezier(.645, .045, .355, 1) .2s;
}
.f-menu-burger .f-menu-burger__bar:nth-child(1) { transform: translate3d(0, -6px, 0); }
.f-menu-burger .f-menu-burger__bar:nth-child(3) { transform: translate3d(0, 6px, 0); }
.f-menu-burger[aria-expanded="true"] .f-menu-burger__in { transform: rotate(180deg) translate3d(0, -1px, 0); }
.f-menu-burger[aria-expanded="true"] .f-menu-burger__bar { transition: transform .3s cubic-bezier(.645, .045, .355, 1) .1s, opacity .2s cubic-bezier(.645, .045, .355, 1); }
.f-menu-burger[aria-expanded="true"] .f-menu-burger__bar:nth-child(1) { transform: rotate(135deg) translate3d(-3.7556px, -1.5556px, 0); }
.f-menu-burger[aria-expanded="true"] .f-menu-burger__bar:nth-child(2) { opacity: 0; transform: rotate(45deg); }
.f-menu-burger[aria-expanded="true"] .f-menu-burger__bar:nth-child(3) { transform: rotate(45deg) translate3d(-.6444px, -1.5556px, 0); }

/* ------------------------------------------------------------------ drawer */

.f-menu-drawer {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 4;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 280px;
	max-height: calc(100vh - 80px);
	max-height: calc(100dvh - 80px);
	padding: 20px;
	overflow: auto;
	overscroll-behavior: contain;
	border-radius: 10px 0 0 10px;
	background: #fff;
	box-shadow: 0 0 10px rgb(102 105 107 / .1);
	color: #3d291d;
	text-align: left;
	transform: translateX(100%);
	transition: transform .6s;
}
.f-menu-drawer[hidden] { display: none; }
.f-menu-drawer.is-open { transform: none; }
@media (max-width: 1024px) {
	.f-menu-drawer { max-width: 320px; }
}
.f-menu-drawer .f-menu-drawer__nav { display: block; margin: 0; padding: 0; }
.f-menu-drawer .f-menu-drawer__list { margin: 0; padding: 0; list-style: none; }
.f-menu-drawer .f-menu-drawer__list > li { margin: 0; padding: 0; list-style: none; }
.f-menu-drawer .f-menu-drawer__item--top { display: none; }
@media (max-width: 1024px) {
	.f-menu-drawer .f-menu-drawer__item--top { display: block; }
}
.f-menu-drawer .f-menu-drawer__link {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 10px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #3d291d;
	font: inherit;
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: -.8px;
	text-align: left;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	transition: none;
	-webkit-tap-highlight-color: transparent;
}
.f-menu-drawer .f-menu-drawer__link:is(:hover, :focus, :active) { background: transparent; color: #3d291d; transform: none; box-shadow: none; text-decoration: none; }
.f-menu-drawer :is(.f-menu-drawer__item.is-current > .f-menu-drawer__link, .f-menu-drawer__item.is-current > .f-menu-drawer__row > .f-menu-drawer__link, .f-menu-drawer__link[aria-current="page"]) { color: #f00f00; }
.f-menu-drawer .f-menu-drawer__row { display: flex; align-items: center; }
.f-menu-drawer .f-menu-drawer__toggle .f-menu-ico { width: 18px; height: auto; margin-left: 10px; color: #3d291d; transition: transform .3s; }
.f-menu-drawer .f-menu-drawer__toggle[aria-expanded="true"] .f-menu-ico { transform: rotate(180deg); }
.f-menu-drawer .f-menu-drawer__row > .f-menu-drawer__toggle,
.f-menu-drawer .f-menu-drawer__row > .f-menu-drawer__toggle:is(:hover, :focus, :active) {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 44px;
	min-height: 40px;
	margin: 0;
	padding: 0 0 0 16px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #3d291d;
	cursor: pointer;
	transform: none;
	justify-content: flex-end;
}
.f-menu-drawer :is(.f-menu-drawer__link, .f-menu-drawer__toggle, .f-menu-drawer__title, .f-menu-drawer__sublink, .f-menu-drawer__info-link):focus-visible { outline: 3px solid #007c91; outline-offset: 2px; }
.f-menu-drawer .f-menu-drawer__panel[hidden] { display: none; }
.f-menu-drawer .f-menu-drawer__group { margin: 0 0 20px 10px; padding: 4px 0 10px; }
.f-menu-drawer .f-menu-drawer__group:last-child { margin-bottom: 0; }
.f-menu-drawer .f-menu-drawer__title { display: block; margin: 0; color: #3d291d; font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: 0; text-decoration: none; }
.f-menu-drawer a.f-menu-drawer__title:is(:hover, :focus) { color: #3d291d; text-decoration: none; }
.f-menu-drawer a.f-menu-drawer__title[aria-current="page"] { color: #f00f00; }
.f-menu-drawer .f-menu-drawer__sub { margin: 0 0 0 20px; padding: 10px 0 0; list-style: none; }
.f-menu-drawer .f-menu-drawer__panel > .f-menu-drawer__sub { margin-left: 10px; padding-bottom: 10px; }
.f-menu-drawer .f-menu-drawer__sub > li { margin: 0; padding: 0; list-style: none; }
.f-menu-drawer .f-menu-drawer__sublink { display: block; padding: 4px 0; color: #676767; font-size: 16px; font-weight: 400; line-height: 1.4; letter-spacing: 0; text-decoration: none; transition: none; }
.f-menu-drawer .f-menu-drawer__sublink:is(:hover, :focus) { color: #676767; text-decoration: none; }
.f-menu-drawer .f-menu-drawer__sublink[aria-current="page"] { color: #f00f00; }
.f-menu-drawer .f-menu-drawer__sublink.f-menu-drawer__all { color: #3d291d; font-weight: 600; }

/* the service lines (the shop's drawer since 2026-09-26): full-width rows on a light grey band at the end */
.f-menu-drawer .f-menu-drawer__info { flex: none; margin: 16px -20px -20px; padding: 6px 20px 12px; list-style: none; background: #f6f6f6; }
.f-menu-drawer .f-menu-drawer__info > li { margin: 0; padding: 0; list-style: none; }
.f-menu-drawer .f-menu-drawer__info > li + li { border-top: 1px solid #e5e5e5; }
.f-menu-drawer .f-menu-drawer__info-link {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 8px 0;
	color: #3d291d;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.35;
	letter-spacing: 0;
	text-decoration: none;
}
.f-menu-drawer a.f-menu-drawer__info-link:is(:hover, :focus) { color: #3d291d; text-decoration: none; }
.f-menu-drawer .f-menu-drawer__info-ico { display: inline-flex; flex: none; }
.f-menu-drawer .f-menu-drawer__info-ico .f-menu-ico { width: 20px; height: 20px; }
.f-menu-drawer .f-menu-drawer__info-text { flex: 1 1 auto; min-width: 0; }

/* ------------------------------------------------------------------ motion, colours, print */

@media (prefers-reduced-motion: reduce) {
	.f-menu .f-menu__panel,
	.f-menu-drawer,
	.f-menu-burger .f-menu-burger__in,
	.f-menu-burger .f-menu-burger__bar,
	.f-menu-drawer .f-menu-drawer__toggle .f-menu-ico { transition: none; }
	.f-menu .f-menu__panel { transform: none; }
}
@media (forced-colors: active) {
	.f-menu .f-menu__panel,
	.f-menu-drawer { border: 1px solid CanvasText; }
	.f-menu-burger .f-menu-burger__bar { background: CanvasText; }
}
@media print {
	.f-menu, .f-menu-burger, .f-menu-drawer { display: none !important; }
}
