/**
 * MaxFurn Custom — site shell: announcement bar, top bar, header (sticky),
 * nav row with mega menus, mobile drawer, footer, WhatsApp button.
 * Desktop layout from 1024px. Tokens come from base.css / theme.json.
 */

:root {
	--mf-admin-bar: var(--wp-admin--admin-bar--height, 0px);
	--mf-header-height: 76px;
}

/* ---------- Shared bits ---------- */

.mf-icon {
	flex: none;
	vertical-align: middle;
}

.mf-round-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--mf-tap);
	min-width: var(--mf-tap);
	height: var(--mf-tap);
	min-height: var(--mf-tap);
	padding: 0;
	border-radius: 50%;
	background: var(--mf-tint);
	color: var(--mf-red);
	text-decoration: none;
}

.mf-round-btn:hover {
	background: var(--mf-red);
	color: var(--mf-surface);
}

/* ---------- Announcement bar ---------- */

.mf-announcement {
	background: var(--mf-ink);
	color: var(--mf-surface);
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
}

.mf-announcement p,
.mf-announcement a {
	display: block;
	margin: 0;
	padding-block: 8px;
	color: inherit;
}

.mf-announcement a:hover {
	color: var(--mf-surface);
	text-decoration-thickness: 2px;
}

.mf-announcement :focus-visible {
	outline-color: var(--mf-surface);
}

/* ---------- Top bar ---------- */

.mf-topbar {
	display: none;
	background: var(--mf-topbar);
	font-size: var(--wp--preset--font-size--small);
}

.mf-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 36px;
}

.mf-topbar__contact {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 24px;
	margin: 0;
	color: var(--mf-muted);
}

.mf-topbar a {
	color: var(--mf-ink);
	text-decoration: none;
}

.mf-topbar a:hover {
	color: var(--mf-red);
	text-decoration: underline;
}

.mf-topbar__menu {
	display: flex;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mf-topbar__menu a {
	display: inline-block;
	padding-block: 8px;
}

@media (min-width: 768px) {
	.mf-topbar {
		display: block;
	}
}

/* ---------- Main row (banner) ---------- */

.mf-header {
	z-index: 50;
	background: var(--mf-header);
	border-bottom: 1px solid var(--mf-border);
}

.mf-header__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 64px;
}

.mf-header__brand {
	flex: none;
	margin-right: auto;
}

.mf-header__brand .custom-logo-link,
.mf-header__brand picture {
	display: block;
}

.mf-header__brand .custom-logo {
	display: block;
	width: auto;
	max-height: 44px;
}

.mf-header__name {
	color: var(--mf-ink);
	font-family: var(--mf-font-heading);
	font-size: 22px;
	font-weight: 600;
	text-decoration: none;
}

.mf-header__search {
	display: none;
}

.mf-header__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.mf-header__call {
	display: none;
}

/* Product search (header and drawer) */
.mf-search {
	position: relative;
	display: flex;
	width: 100%;
	max-width: none;
	margin: 0;
}

.mf-search__input {
	padding-right: 52px;
	background: var(--mf-surface);
}

.mf-search__submit {
	position: absolute;
	top: 0;
	right: 0;
	width: var(--mf-tap);
	padding: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--mf-ink);
}

.mf-search__submit:hover {
	background: transparent;
	color: var(--mf-red);
}

/* Enquiry list pill */
.mf-enquiry-pill {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: var(--mf-tap);
	padding: 0 14px;
	border-radius: var(--mf-radius-pill);
	background: var(--mf-ink);
	color: var(--mf-surface);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.mf-enquiry-pill:hover {
	background: var(--mf-red);
	color: var(--mf-surface);
}

.mf-enquiry-pill__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: var(--mf-radius-pill);
	background: var(--mf-red);
	color: var(--mf-surface);
	font-size: 12px;
	line-height: 1;
}

.mf-enquiry-pill:hover .mf-enquiry-pill__count {
	background: var(--mf-surface);
	color: var(--mf-red);
}

.mf-enquiry-pill__count[hidden] {
	display: none;
}

/* Small phones: the pill shows the icon (and count); the label stays for screen readers. */
@media (max-width: 479.98px) {
	.mf-enquiry-pill {
		padding: 0 12px;
	}

	.mf-enquiry-pill__label {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

@media (min-width: 1024px) {
	.mf-header__inner {
		gap: 24px;
		min-height: var(--mf-header-height);
	}

	.mf-header__brand {
		margin-right: 0;
	}

	.mf-header__brand .custom-logo {
		max-height: 52px;
	}

	.mf-header__search {
		display: block;
		flex: 1;
		max-width: 560px;
		margin-inline: auto;
	}

	.mf-header__call {
		display: inline-flex;
	}

	.mf-header__search-btn,
	.mf-header__menu-btn {
		display: none;
	}
}

/* Sticky main row (Settings → MaxFurn → Header & pages). No JS, no layout shift. */
@media (min-width: 1024px) {
	.mf-sticky-desktop .mf-header {
		position: sticky;
		top: var(--mf-admin-bar);
	}
}

@media (max-width: 1023.98px) {
	.mf-sticky-mobile .mf-header {
		position: sticky;
		top: var(--mf-admin-bar);
	}
}

/* The admin bar is not fixed on narrow screens. */
@media (max-width: 600px) {
	.admin-bar .mf-header {
		top: 0;
	}
}

/* ---------- Nav row and mega menus (desktop) ---------- */

.mf-nav {
	display: none;
	position: relative;
	z-index: 40;
	background: var(--mf-header);
	border-bottom: 1px solid var(--mf-border);
}

@media (min-width: 1024px) {
	.mf-nav {
		display: block;
	}
}

.mf-nav__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mf-nav__item {
	display: flex;
	align-items: center;
}

.mf-nav__item.has-sub:not(.has-mega) {
	position: relative;
}

.mf-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 52px;
	padding: 0 6px 0 12px;
	color: var(--mf-ink);
	font-weight: 500;
	text-decoration: none;
	letter-spacing: 0.01em;
}

.mf-nav__item:not(.has-sub) > .mf-nav__link {
	padding-right: 12px;
}

.mf-nav__link .mf-icon {
	color: var(--mf-red);
}

.mf-nav__link:hover,
.mf-nav__item.is-current > .mf-nav__link {
	color: var(--mf-red);
}

.mf-desktop-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	min-width: 32px;
	height: 44px;
	min-height: 44px;
	padding: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--mf-muted);
}

.mf-desktop-toggle:hover {
	background: var(--mf-tint);
	color: var(--mf-red);
}

.mf-desktop-toggle .mf-icon {
	transition: transform 0.15s ease;
}

.mf-desktop-toggle[aria-expanded="true"] .mf-icon {
	transform: rotate(180deg);
}

/* Panels: hidden until hover, the toggle, or (without JS) keyboard focus. */
.mf-mega,
.mf-dropdown {
	position: absolute;
	top: 100%;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.12s ease, visibility 0s linear 0.12s;
}

.mf-nav__item:hover:not(.is-dismissed) > .mf-mega,
.mf-nav__item:hover:not(.is-dismissed) > .mf-dropdown,
.mf-nav__item.is-open > .mf-mega,
.mf-nav__item.is-open > .mf-dropdown,
.no-js .mf-nav__item:focus-within > .mf-mega,
.no-js .mf-nav__item:focus-within > .mf-dropdown {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transition-delay: 0s;
}

.mf-mega {
	left: 0;
	right: 0;
	background: var(--mf-surface);
	border-top: 1px solid var(--mf-border);
	box-shadow: 0 12px 24px rgba(20, 20, 20, 0.08);
}

.mf-mega__inner {
	max-width: calc(var(--mf-container) + 2 * var(--mf-gutter));
	margin-inline: auto;
	padding: 28px var(--mf-gutter) 32px;
}

.mf-mega__cols {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mf-mega__image {
	display: block;
	width: 100%;
	max-width: 280px;
	height: auto;
	aspect-ratio: 8 / 5;
	margin-bottom: 14px;
	object-fit: cover;
	border-radius: var(--mf-radius-card);
	background: var(--mf-bg);
}

/* Columns without an image get an empty space of the same size, so headings line up. */
.mf-mega__cols:has(.mf-mega__image) .mf-mega__col:not(:has(.mf-mega__image))::before {
	content: "";
	display: block;
	max-width: 280px;
	aspect-ratio: 8 / 5;
	margin-bottom: 14px;
}

.mf-mega__heading {
	display: inline-block;
	margin-bottom: 8px;
	color: var(--mf-ink);
	font-family: var(--mf-font-heading);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 500;
	text-decoration: none;
}

.mf-mega__heading:hover {
	color: var(--mf-red);
}

.mf-mega__links,
.mf-dropdown,
.mf-dropdown__sub {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mf-mega__links a,
.mf-dropdown a {
	display: block;
	padding: 6px 0;
	color: var(--mf-text);
	text-decoration: none;
}

.mf-mega__links a:hover,
.mf-dropdown a:hover,
.mf-mega__links a[aria-current="page"],
.mf-dropdown a[aria-current="page"] {
	color: var(--mf-red);
}

.mf-dropdown {
	left: 0;
	min-width: 220px;
	padding: 10px 20px;
	background: var(--mf-surface);
	border: 1px solid var(--mf-border);
	border-radius: var(--mf-radius-card);
	box-shadow: 0 12px 24px rgba(20, 20, 20, 0.08);
}

/* ---------- Mobile drawer ---------- */

.mf-drawer {
	width: min(380px, 88vw);
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0 0 24px;
	border: 0;
	background: var(--mf-surface);
	color: var(--mf-text);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.mf-drawer::backdrop {
	background: rgba(20, 20, 20, 0.5);
}

/* Without JavaScript the drawer is a plain block on small screens. */
.no-js .mf-drawer {
	display: block;
	position: static;
	width: 100%;
	height: auto;
}

@media (min-width: 1024px) {
	.no-js .mf-drawer {
		display: none;
	}
}

.mf-drawer__head {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: var(--mf-surface);
	border-bottom: 1px solid var(--mf-border);
}

.mf-drawer__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

.no-js .mf-drawer__close {
	display: none;
}

.mf-drawer__search {
	padding: 16px;
}

.mf-drawer-nav__list,
.mf-drawer-nav__sub,
.mf-drawer__links-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mf-drawer-nav__item {
	border-bottom: 1px solid var(--mf-border);
}

.mf-drawer-nav__row {
	display: flex;
	align-items: center;
}

.mf-drawer-nav__row a {
	flex: 1;
	display: block;
	padding: 12px 16px;
	color: var(--mf-ink);
	font-weight: 500;
	text-decoration: none;
}

.mf-drawer-nav__item.is-current > .mf-drawer-nav__row a,
.mf-drawer-nav__row a[aria-current="page"] {
	color: var(--mf-red);
}

.mf-drawer-toggle {
	width: var(--mf-tap);
	padding: 0;
	margin-right: 8px;
	border-radius: 8px;
	background: transparent;
	color: var(--mf-ink);
}

.mf-drawer-toggle:hover {
	background: var(--mf-tint);
	color: var(--mf-red);
}

.mf-drawer-toggle[aria-expanded="true"] .mf-icon {
	transform: rotate(180deg);
}

.js .mf-drawer-nav__sub--1:not(.is-open),
.no-js .mf-drawer-toggle {
	display: none;
}

.mf-drawer-nav__sub {
	background: var(--mf-bg);
}

.mf-drawer-nav__sub .mf-drawer-nav__item {
	border-bottom: 0;
}

.mf-drawer-nav__sub--1 > .mf-drawer-nav__item > .mf-drawer-nav__row a {
	padding-left: 28px;
}

.mf-drawer-nav__sub--2 .mf-drawer-nav__row a {
	padding-block: 8px;
	padding-left: 44px;
	font-weight: 400;
}

.mf-drawer__links-list {
	padding: 12px 16px 0;
}

.mf-drawer__links-list a {
	display: block;
	padding: 10px 0;
	color: var(--mf-text);
}

.mf-drawer__contact {
	display: grid;
	gap: 10px;
	padding: 16px;
}

.mf-drawer__whatsapp {
	background: var(--mf-whatsapp);
}

/* ---------- Footer ---------- */

.mf-footer {
	background: var(--mf-footer);
	color: #d9d9d9;
	font-size: 14px;
}

.mf-footer a {
	color: #d9d9d9;
	text-decoration: none;
}

.mf-footer a:hover {
	color: var(--mf-surface);
	text-decoration: underline;
}

.mf-footer :focus-visible {
	outline-color: var(--mf-surface);
}

.mf-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	padding-block: 56px 40px;
}

@media (min-width: 640px) {
	.mf-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.mf-footer__grid {
		grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)) 1.3fr;
	}
}

.mf-footer__site-name {
	color: var(--mf-surface);
	font-family: var(--mf-font-heading);
	font-size: 24px;
	font-weight: 600;
}

.mf-footer__logo img {
	display: block;
	width: auto;
	max-width: 200px;
	height: auto;
}

.mf-footer__text {
	margin: 16px 0;
	line-height: 1.7;
}

.mf-footer__title {
	margin: 0 0 16px;
	color: var(--mf-surface);
	font-size: 16px;
	font-weight: 500;
}

.mf-footer__menu,
.mf-footer__contact-list,
.mf-footer__social {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mf-footer__menu a {
	display: inline-block;
	padding: 6px 0;
}

.mf-footer__contact-list li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 12px;
}

.mf-footer__contact-list .mf-icon {
	margin-top: 3px;
	color: var(--mf-red);
}

.mf-footer__contact-list address {
	font-style: normal;
}

.mf-footer__social {
	display: flex;
	gap: 8px;
}

.mf-footer__social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--mf-tap);
	height: var(--mf-tap);
	border-radius: 50%;
	background: #262626;
}

.mf-footer__social-link:hover {
	background: var(--mf-red);
}

.mf-footer__bottom {
	border-top: 1px solid #2a2a2a;
	font-size: 13px;
}

.mf-footer__bottom p {
	margin: 0;
	padding-block: 18px;
}

/* ---------- WhatsApp button ---------- */

.mf-whatsapp {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 45;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--mf-whatsapp);
	color: var(--mf-surface);
	box-shadow: 0 6px 16px rgba(20, 20, 20, 0.25);
}

.mf-whatsapp:hover {
	color: var(--mf-surface);
	filter: brightness(1.08);
}

.mf-whatsapp:focus-visible {
	outline: 3px solid var(--mf-ink);
	outline-offset: 3px;
}

@media print {
	.mf-topbar,
	.mf-nav,
	.mf-drawer,
	.mf-whatsapp,
	.mf-header__actions {
		display: none !important;
	}
}

/* Enquiry list confirmation toast (enquiry-store.js). */
.mf-toast {
	position: fixed;
	right: 16px;
	bottom: 16px;
	left: 16px;
	z-index: 1000;
	display: none;
	align-items: center;
	gap: 12px 16px;
	flex-wrap: wrap;
	max-width: 440px;
	margin-left: auto;
	padding: 14px 16px 14px 20px;
	border-radius: var(--mf-radius-card);
	background: var(--mf-ink);
	color: var(--mf-surface);
	box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
}

.mf-toast.is-visible {
	display: flex;
}

.mf-toast__text {
	flex: 1 1 200px;
	margin: 0;
}

.mf-toast__link {
	color: var(--mf-surface);
	font-weight: 600;
	text-decoration: underline;
}

.mf-toast__close {
	min-width: var(--mf-tap);
	padding: 0;
	background: transparent;
	color: var(--mf-surface);
	font-size: 1.5rem;
}

.mf-toast :focus-visible {
	outline-color: var(--mf-surface);
}
