/*
 * Solimar Mega Menu 1.2 — every selector is scoped under .smm, except the documented
 * body.smm-drawer-open rule (hides floating chat buttons while the drawer is open) and the
 * .whb-full-width rules (full-width Woodmart header) and the header live-search thumbnail rules
 * (.wd-dropdown-results) at the end.
 *
 * Layouts (root class): .smm--auto (bar ≥1025px, drawer below), .smm--desktop (bar only),
 * .smm--mobile (burger + drawer only).
 *
 * States
 *   no JS   : desktop mega-panel and dropdowns open on :hover / :focus-within,
 *             drawer opens on :target (trigger/burger are links to the panel id).
 *   .smm--js: JS manages .is-open (root: mega-panel / drawer), .is-active (desktop family),
 *             .is-open on .smm-nav__item--drop (dropdown), .is-expanded (drawer accordions),
 *             .smm-nav__item--hidden (bar item that does not fit).
 */

.smm {
	--smm-bar-bg: #edffbe;
	--smm-blue: #0770bb;
	--smm-blue-dark: #055a93;
	--smm-text: #242424;
	--smm-muted: #5a5a5a;
	--smm-border: #e7e9e1;
	--smm-soft: #f6f8f1;
	--smm-white: #fff;
	--smm-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--smm-container: 1400px;
	--smm-bar-h: 60px;
	--smm-side: 280px;
	--smm-offset: 150px; /* space above the desktop panel (header height) used for its max height */
	--smm-drawer-w: 345px;
	--smm-z: 1000;

	position: relative;
	z-index: var(--smm-z);
	font-family: var(--smm-font);
	font-size: 14px;
	line-height: 1.4;
	color: var(--smm-text);
	text-align: left;
}

.smm *,
.smm *::before,
.smm *::after {
	box-sizing: border-box;
}

.smm ul,
.smm li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.smm a {
	color: inherit;
	text-decoration: none;
}

.smm button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0;
	min-height: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
}

.smm a:focus-visible,
.smm button:focus-visible {
	outline: 2px solid var(--smm-blue);
	outline-offset: 2px;
}

.smm svg {
	display: inline-block;
	flex: 0 0 auto;
	fill: currentColor;
}

.smm .smm-chevron {
	width: 14px;
	height: 14px;
	fill: none;
}

.smm .smm-icon {
	width: 26px;
	height: 26px;
	color: var(--smm-blue);
}

.smm .smm-family__toggle,
.smm .smm-group__toggle,
.smm .smm-overlay,
.smm-panel__head {
	display: none;
}

.smm-family__label {
	flex: 1 1 auto;
}

/*
 * Desktop bar: stay below the header search results (Woodmart .wd-dropdown-results, z-index 380,
 * same stacking context) so the live-search dropdown is not hidden behind the bar.
 */
@media (min-width: 1025px) {
	.smm.smm--desktop,
	.smm.smm--auto {
		--smm-z: 370;
	}
}

/* Layout visibility */
@media (max-width: 1024px) {
	.smm.smm--desktop {
		display: none;
	}
}

@media (min-width: 1025px) {
	.smm.smm--mobile {
		display: none;
	}
}

/* ---------- Bar (auto / desktop layouts) ---------- */

.smm-bar {
	background: var(--smm-bar-bg);
}

.smm-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	max-width: var(--smm-container);
	min-height: var(--smm-bar-h);
	margin: 0 auto;
	padding: 0 15px;
}

.smm .smm-trigger {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 10px;
	min-height: 44px;
	padding: 0 16px 0 12px;
	border-radius: 5px;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	color: var(--smm-text);
	transition: background-color .15s, color .15s;
}

.smm .smm-trigger:hover,
.smm.is-open .smm-trigger {
	background: var(--smm-white);
	color: var(--smm-blue);
}

.smm-trigger__burger {
	position: relative;
	display: inline-block;
	flex: 0 0 auto;
	width: 18px;
	height: 14px;
	border-top: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
}

.smm-trigger__burger span {
	position: absolute;
	top: 4px;
	left: 0;
	right: 0;
	border-top: 2px solid currentColor;
}

.smm .smm-caret {
	width: 14px;
	height: 14px;
	fill: none;
	transition: transform .2s;
}

.smm.is-open .smm-trigger .smm-caret {
	transform: rotate(180deg);
}

.smm .smm-btn {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	min-height: 42px;
	padding: 0 20px;
	border-radius: 5px;
	background: var(--smm-blue);
	color: var(--smm-white);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	transition: background-color .15s;
}

.smm a.smm-btn:hover {
	background: var(--smm-blue-dark);
	color: var(--smm-white);
}

/* ---------- Burger (mobile layout) — sized like the Woodmart header icons ---------- */

.smm .smm-burger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 44px;
	min-height: 44px;
	padding: 0 4px;
	border-radius: 0;
	background: none;
	color: #333;
	font-size: 13px;
	font-weight: 600;
}

.smm .smm-burger:hover,
.smm.is-open .smm-burger {
	background: none;
	color: var(--smm-blue);
}

.smm-burger .smm-trigger__burger {
	width: 22px;
	height: 16px;
}

.smm-burger .smm-trigger__burger span {
	top: 5px;
}

/* ---------- Desktop (≥ 1025px) ---------- */

@media (min-width: 1025px) {
	.smm .smm-menu {
		display: flex;
		align-items: center;
		flex: 0 0 auto;
		align-self: stretch;
	}

	/* Page items: one line; items that do not fit are hidden by JS (.smm-nav__item--hidden). */
	.smm .smm-nav {
		display: flex;
		flex: 1 1 auto;
		align-self: stretch;
		min-width: 0;
		gap: 2px;
	}

	.smm .smm-nav__item {
		position: relative;
		display: flex;
		flex: 0 0 auto;
	}

	.smm .smm-nav__item--hidden {
		display: none;
	}

	.smm .smm-nav__link {
		display: flex;
		align-items: center;
		gap: 6px;
		height: 100%;
		padding: 0 12px;
		font-size: 14px;
		font-weight: 600;
		white-space: nowrap;
		color: var(--smm-text);
		box-shadow: inset 0 -3px 0 transparent;
		transition: color .12s, box-shadow .12s;
	}

	.smm .smm-nav__link:focus-visible {
		outline-offset: -4px;
	}

	.smm .smm-nav__link:hover,
	.smm .smm-nav__item.is-open > .smm-nav__link,
	.smm:not(.smm--js) .smm-nav__item--drop:hover > .smm-nav__link,
	.smm:not(.smm--js) .smm-nav__item--drop:focus-within > .smm-nav__link {
		color: var(--smm-blue);
		box-shadow: inset 0 -3px 0 var(--smm-blue);
	}

	.smm .smm-nav__link .smm-caret {
		width: 12px;
		height: 12px;
		opacity: .7;
		transition: transform .2s;
	}

	.smm .smm-nav__item.is-open > .smm-nav__link .smm-caret {
		transform: rotate(180deg);
	}

	/* Dropdowns: same visual language as the mega-panel, lighter */
	.smm .smm-drop {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 2;
		min-width: 250px;
		padding: 18px 20px;
		border-top: 3px solid var(--smm-blue);
		background: var(--smm-white);
		box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .25);
	}

	.smm--js .smm-nav__item.is-open > .smm-drop,
	.smm:not(.smm--js) .smm-nav__item--drop:hover > .smm-drop,
	.smm:not(.smm--js) .smm-nav__item--drop:focus-within > .smm-drop {
		display: block;
	}

	/* Keep the last dropdowns inside the bar (Service client is near the right edge). */
	.smm .smm-nav__item--drop:last-child > .smm-drop,
	.smm .smm-nav__item--service > .smm-drop {
		left: auto;
		right: 0;
	}

	.smm .smm-drop--metiers {
		width: min(780px, calc(100vw - 40px));
		padding: 22px 26px 8px;
	}

	.smm .smm-trades {
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		gap: 0 26px;
	}

	.smm .smm-trade {
		padding-bottom: 18px;
	}

	.smm .smm-trade__title {
		display: flex;
		align-items: center;
		gap: 8px;
		margin-bottom: 6px;
		font-size: 14px;
		font-weight: 700;
	}

	.smm .smm-trade__title .smm-icon {
		width: 22px;
		height: 22px;
	}

	.smm .smm-trade__links a,
	.smm .smm-drop__links a {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 3px 0;
		font-size: 13px;
		line-height: 1.45;
		color: var(--smm-muted);
	}

	.smm .smm-drop__links a {
		padding: 7px 0;
		font-size: 14px;
		color: var(--smm-text);
	}

	.smm .smm-drop__links .smm-icon {
		width: 22px;
		height: 22px;
	}

	.smm .smm-trade__links a:hover,
	.smm .smm-drop__links a:hover {
		color: var(--smm-blue);
		text-decoration: underline;
	}

	/* Drawer-only block */
	.smm .smm-extra {
		display: none;
	}

	.smm-panel {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--smm-white);
		border-top: 1px solid var(--smm-border);
		box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .25);
	}

	.smm:not(.smm--js) .smm-menu:hover .smm-panel,
	.smm:not(.smm--js) .smm-menu:focus-within .smm-panel,
	.smm--js.is-open .smm-panel {
		display: block;
	}

	.smm:not(.smm--js) .smm-menu:hover .smm-trigger,
	.smm:not(.smm--js) .smm-menu:focus-within .smm-trigger {
		background: var(--smm-white);
		color: var(--smm-blue);
	}

	.smm-panel__body {
		position: relative;
		max-width: var(--smm-container);
		height: min(600px, calc(100vh - var(--smm-offset)));
		min-height: 500px;
		margin: 0 auto;
	}

	.smm .smm-families {
		width: var(--smm-side);
		height: 100%;
		padding: 10px 0;
		overflow-y: auto;
		background: var(--smm-soft);
		border-right: 1px solid var(--smm-border);
	}

	.smm .smm-family__link {
		display: flex;
		align-items: center;
		gap: 12px;
		min-height: 44px;
		padding: 6px 16px 6px 13px;
		border-left: 3px solid transparent;
		font-size: 14px;
		font-weight: 600;
		transition: background-color .12s, color .12s;
	}

	.smm .smm-family__link .smm-chevron {
		opacity: .45;
	}

	/* Active family: JS state, or hover/focus without JS (first family by default). */
	.smm--js .smm-family.is-active > .smm-family__link,
	.smm:not(.smm--js) .smm-family:hover > .smm-family__link,
	.smm:not(.smm--js) .smm-family:focus-within > .smm-family__link,
	.smm:not(.smm--js) .smm-families:not(:hover):not(:focus-within) > .smm-family:first-child > .smm-family__link {
		background: var(--smm-bar-bg);
		border-left-color: var(--smm-blue);
		color: var(--smm-blue);
	}

	.smm-family__panel {
		display: none;
		position: absolute;
		top: 0;
		bottom: 0;
		left: var(--smm-side);
		right: 0;
		padding: 22px 30px 30px;
		overflow-y: auto;
		background: var(--smm-white);
	}

	.smm--js .smm-family.is-active > .smm-family__panel,
	.smm:not(.smm--js) .smm-family:hover > .smm-family__panel,
	.smm:not(.smm--js) .smm-family:focus-within > .smm-family__panel,
	.smm:not(.smm--js) .smm-families:not(:hover):not(:focus-within) > .smm-family:first-child > .smm-family__panel {
		display: block;
	}

	.smm-family__head {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 16px;
		margin-bottom: 18px;
		padding-bottom: 12px;
		border-bottom: 1px solid var(--smm-border);
	}

	.smm-family__title {
		font-size: 20px;
		font-weight: 700;
	}

	.smm .smm-viewall {
		color: var(--smm-blue);
		font-weight: 600;
		white-space: nowrap;
	}

	.smm .smm-viewall:hover {
		text-decoration: underline;
	}

	.smm-cols {
		column-width: 190px;
		column-count: 5;
		column-gap: 28px;
	}

	.smm .smm-group {
		break-inside: avoid;
		page-break-inside: avoid;
		padding-bottom: 20px;
	}

	.smm .smm-group__link {
		display: block;
		margin-bottom: 6px;
		font-size: 14px;
		font-weight: 700;
		color: var(--smm-text);
	}

	.smm .smm-group__list a {
		display: block;
		padding: 2px 0;
		font-size: 13px;
		line-height: 1.45;
		color: var(--smm-muted);
	}

	.smm .smm-group__link:hover,
	.smm .smm-group__list a:hover {
		color: var(--smm-blue);
		text-decoration: underline;
	}
}

/* ---------- Drawer (< 1025px): slides in from the left, accordion inside ---------- */

@media (max-width: 1024px) {
	.smm-bar__inner {
		min-height: 54px;
		padding: 0 12px;
	}

	.smm .smm-nav {
		display: none;
	}

	.smm .smm-btn {
		min-height: 38px;
		padding: 0 14px;
		font-size: 13px;
	}

	.smm-panel {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 100001;
		display: flex;
		flex-direction: column;
		width: min(var(--smm-drawer-w), calc(100vw - 30px));
		background: var(--smm-white);
		box-shadow: 4px 0 24px rgba(0, 0, 0, .18);
		visibility: hidden;
		transform: translateX(-100%);
		transition: transform .25s ease, visibility 0s linear .25s;
	}

	.smm-panel:target,
	.smm--js.is-open .smm-panel {
		visibility: visible;
		transform: none;
		transition: transform .25s ease, visibility 0s;
	}

	.smm .smm-overlay {
		display: block;
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 100000;
		background: rgba(17, 24, 39, .5);
		opacity: 0;
		visibility: hidden;
		transition: opacity .25s, visibility 0s linear .25s;
	}

	.smm .smm-panel:target + .smm-overlay,
	.smm--js.is-open .smm-overlay {
		opacity: 1;
		visibility: visible;
		transition: opacity .25s, visibility 0s;
	}

	.smm-panel__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex: 0 0 auto;
		min-height: 56px;
		padding: 0 6px 0 16px;
		background: var(--smm-bar-bg);
		font-size: 16px;
		font-weight: 700;
	}

	.smm .smm-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
	}

	.smm .smm-close svg {
		width: 18px;
		height: 18px;
		fill: none;
	}

	.smm-panel__body {
		flex: 1 1 auto;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}

	/* Level 1: families */
	.smm .smm-family {
		display: flex;
		flex-wrap: wrap;
		border-bottom: 1px solid var(--smm-border);
	}

	.smm .smm-family__link {
		display: flex;
		align-items: center;
		flex: 1 1 0;
		gap: 12px;
		min-width: 0;
		min-height: 52px;
		padding: 8px 12px 8px 16px;
		font-size: 15px;
		font-weight: 600;
	}

	.smm .smm-family__link .smm-chevron {
		opacity: .5;
	}

	/* With JS the toggle button carries the chevron; the label stays a link to the family page. */
	.smm--js .smm-family__link .smm-chevron {
		display: none;
	}

	.smm--js .smm-family__toggle,
	.smm--js .smm-group__toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 52px;
		min-height: 48px;
		color: var(--smm-muted);
	}

	.smm .smm-family__toggle .smm-chevron,
	.smm .smm-group__toggle .smm-chevron {
		transform: rotate(90deg);
		transition: transform .2s;
	}

	.smm .is-expanded > .smm-family__toggle .smm-chevron,
	.smm .is-expanded > .smm-group__toggle .smm-chevron {
		transform: rotate(-90deg);
	}

	.smm .smm-family.is-expanded > .smm-family__link,
	.smm .smm-family.is-expanded > .smm-family__toggle {
		color: var(--smm-blue);
	}

	/* Level 2 */
	.smm-family__panel {
		display: none;
		flex: 0 0 100%;
		background: var(--smm-soft);
	}

	.smm .smm-family.is-expanded > .smm-family__panel {
		display: block;
	}

	.smm-family__title {
		display: none;
	}

	.smm .smm-viewall {
		display: block;
		padding: 12px 16px 12px 54px;
		border-top: 1px solid var(--smm-border);
		color: var(--smm-blue);
		font-size: 14px;
		font-weight: 600;
	}

	.smm .smm-group {
		display: flex;
		flex-wrap: wrap;
		border-top: 1px solid var(--smm-border);
	}

	.smm .smm-group__link {
		display: flex;
		align-items: center;
		flex: 1 1 0;
		min-width: 0;
		min-height: 48px;
		padding: 8px 12px 8px 54px;
		font-size: 14px;
		font-weight: 600;
	}

	.smm .smm-group.is-expanded > .smm-group__link,
	.smm .smm-group.is-expanded > .smm-group__toggle {
		color: var(--smm-blue);
	}

	/* Level 3 */
	.smm .smm-group__list {
		display: none;
		flex: 0 0 100%;
		padding: 4px 0 8px;
		background: var(--smm-white);
	}

	.smm .smm-group.is-expanded > .smm-group__list {
		display: block;
	}

	.smm .smm-group__list a {
		display: block;
		padding: 9px 16px 9px 70px;
		font-size: 14px;
		color: var(--smm-text);
	}

	.smm .smm-group__list .smm-group__all {
		color: var(--smm-blue);
		font-weight: 600;
	}

	.smm .smm-viewall:hover,
	.smm .smm-group__link:hover,
	.smm .smm-group__list a:hover {
		color: var(--smm-blue);
	}
}

/* ---------- Drawer extras: page items + Destockage (below the product tree) ---------- */

@media (max-width: 1024px) {
	.smm .smm-extra {
		padding: 8px 0 24px;
		border-top: 6px solid var(--smm-soft);
	}

	.smm .smm-extra__row {
		display: flex;
		align-items: center;
		gap: 12px;
		width: 100%;
		min-height: 50px;
		padding: 8px 16px;
		border-bottom: 1px solid var(--smm-border);
		font-size: 15px;
		font-weight: 600;
		text-align: left;
		color: var(--smm-text);
	}

	.smm .smm-extra__row > span {
		flex: 1 1 auto;
	}

	.smm .smm-extra__row--sub {
		min-height: 46px;
		padding-left: 28px;
		font-size: 14px;
	}

	.smm .smm-extra__row .smm-icon {
		width: 22px;
		height: 22px;
	}

	.smm .smm-extra__heading {
		display: block;
		padding: 16px 16px 6px;
		color: var(--smm-muted);
		font-size: 12px;
		font-weight: 700;
		letter-spacing: .06em;
		text-transform: uppercase;
	}

	.smm .smm-acc__toggle .smm-chevron {
		opacity: .6;
		transform: rotate(90deg);
		transition: transform .2s;
	}

	.smm .smm-acc.is-expanded > .smm-acc__toggle {
		color: var(--smm-blue);
	}

	.smm .smm-acc.is-expanded > .smm-acc__toggle .smm-chevron {
		transform: rotate(-90deg);
	}

	/* Accordion bodies are open without JS (the buttons then act as headings). */
	.smm--js .smm-acc > .smm-acc__body {
		display: none;
	}

	.smm--js .smm-acc.is-expanded > .smm-acc__body {
		display: block;
	}

	.smm:not(.smm--js) .smm-acc__toggle .smm-chevron {
		display: none;
	}

	.smm .smm-acc__body {
		background: var(--smm-soft);
	}

	.smm .smm-extra__leaf {
		display: block;
		padding: 10px 16px 10px 44px;
		border-bottom: 1px solid var(--smm-border);
		background: var(--smm-white);
		font-size: 14px;
	}

	.smm .smm-extra__row:hover,
	.smm .smm-extra__leaf:hover {
		color: var(--smm-blue);
	}

	.smm .smm-extra__cta {
		padding: 20px 16px 0;
	}

	.smm .smm-extra__cta .smm-btn {
		justify-content: center;
		width: 100%;
		min-height: 46px;
		font-size: 15px;
	}
}

/*
 * The one global rule: while the drawer is open, hide floating chat buttons that sit above
 * everything (solimarchr.com: a#wa-s, z-index 99999; OneClick WhatsApp: .floating_button).
 */
body.smm-drawer-open #wa-s,
body.smm-drawer-open .floating_button {
	display: none !important;
}

/*
 * Full-width header: when the Woodmart header has "Full width" on (.whb-full-width), the header
 * rows go edge to edge (Woodmart alone stops at 95%) and the bar and mega-panel follow them.
 */
.whb-header.whb-full-width .whb-row > .container {
	width: 100%;
}

.whb-full-width .smm {
	--smm-container: none;
}

/*
 * Header live search (Woodmart): same thumbnail box for every suggestion, whatever the photo ratio.
 */
.wd-dropdown-results .wd-suggestion-thumb {
	display: flex;
	flex: 0 0 64px;
	align-items: center;
	justify-content: center;
	width: 64px;
	max-width: 64px;
	height: 64px;
}

.wd-dropdown-results .wd-suggestion-thumb img {
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: contain;
}

/* Header live search on desktop: show every suggestion, no inner scrollbar (theme caps it at 450px). */
@media (min-width: 1025px) {
	.wd-dropdown-results .wd-scroll-content {
		max-height: none;
		overflow: visible;
	}
}

@media (prefers-reduced-motion: reduce) {
	.smm *,
	.smm *::before,
	.smm *::after {
		transition-duration: 0s !important;
		transition-delay: 0s !important;
	}
}
