/* ============================================================
 * Header "Products" and "Solutions" mega menus (inc/megamenu.php, assets/megamenu.js).
 * A copy of shelly.com's two header menus: a white rounded card under the header,
 * columns of icon links on the left, a solution list or photo cards and a promo tile
 * on the right. The panel hangs off the sticky header, centred under the header card.
 * ========================================================== */

.shelly-header .shelly-nav__item--smm { position: static; }
.shelly-nav__item--smm.is-open > .shelly-nav__link { color: #0361A7; }
.shelly-nav__item--smm.is-open > .shelly-nav__link .shelly-nav__caret { color: #0361A7; transform: rotate(180deg); }

.smm {
	--smm-ink: #121519;
	--smm-muted: #5E6770;
	--smm-line: #DCE5EE;
	--smm-blue: #4594D1;
	--smm-deep: #0E4C92;
	position: absolute;
	z-index: 95;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	width: min(1320px, calc(100% - 96px));
	margin-inline: auto;
	max-height: calc(100vh - 140px);
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid rgba(18, 21, 25, 0.06);
	border-radius: 16px;
	background: #FDFDFD;
	box-shadow: 0 28px 60px -24px rgba(9, 30, 66, 0.32);
	text-align: start;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms;
}
/* A bridge over the gap under the header, so the pointer can travel into the panel. */
.smm::before { content: ""; position: absolute; left: 0; right: 0; top: -20px; height: 20px; }
.shelly-nav__item--smm.is-open > .smm { opacity: 1; visibility: visible; transform: none; transition: opacity 160ms ease, transform 160ms ease; }

.smm__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100%; }
.smm__main { padding: 30px 24px 34px; }
.smm__main--tint { border-start-start-radius: 16px; border-end-start-radius: 16px; background: linear-gradient(135deg, #DCEBF7 0%, #EDF4FA 55%, #F6F9FC 100%); }
.smm--products .smm__main { position: relative; }
.smm--products .smm__main::after { content: ""; position: absolute; top: 30px; bottom: 30px; inset-inline-end: 0; width: 1px; background: var(--smm-blue); }
.smm__side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 30px; padding: 30px 24px 30px; }
.smm__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.smm__col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* Quick links on top of the Products menu (New / Best sellers / All). */
.smm__chips { display: flex; gap: 10px; margin: 0 0 22px; }
.smm__chips .smm__chip { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
.smm__chips .smm__label { overflow: hidden; text-overflow: ellipsis; }
.smm__chip { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 10px 10px 12px; border-radius: 12px; background: #F0F4F7; color: var(--smm-ink); font: 700 15px/1.2 'Manrope', sans-serif; text-decoration: none; transition: background 160ms ease, color 160ms ease; }
.smm__chip:hover, .smm__chip:focus-visible { background: #E2EEF8; color: var(--smm-deep); outline: 0; }
.smm__chip-ico { display: grid; place-items: center; flex: 0 0 auto; width: 24px; }
.smm__chip-ico img { display: block; max-width: 24px; height: auto; }
.smm__chip .smm__label { flex: 1 1 auto; min-width: 0; }
.smm__arrow { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border: 1px solid var(--smm-blue); border-radius: 50%; color: var(--smm-blue); transition: transform 160ms ease; }
.smm__chip:hover .smm__arrow { transform: translateX(2px); }
/*rtl:raw:
.smm__arrow svg { transform: scaleX(-1); }
*/
.smm__chip--fill { background: linear-gradient(90deg, #4594D1 0%, #0E4C92 100%); color: #FFFFFF; }
.smm__chip--fill:hover, .smm__chip--fill:focus-visible { background: linear-gradient(90deg, #3C88C4 0%, #0B3F7A 100%); color: #FFFFFF; }
.smm__chip--fill .smm__arrow { border-color: rgba(255, 255, 255, 0.7); color: #FFFFFF; }

/* Column sections */
.smm__title { margin: 0 0 10px; padding: 0 0 10px; border-bottom: 1px solid var(--smm-line); color: var(--smm-muted); font: 500 16px/1.3 'Manrope', sans-serif; }
.smm__main--tint .smm__title { border-color: rgba(69, 148, 209, 0.25); }
.smm__list { list-style: none; margin: 0; padding: 0; }
.smm__list li { margin: 0; }
.smm__link { display: flex; align-items: center; gap: 14px; min-height: 38px; padding: 4px 6px; margin-inline: -6px; border-radius: 8px; color: var(--smm-ink); font: 500 14.5px/1.3 'Manrope', sans-serif; text-decoration: none; transition: background 140ms ease, color 140ms ease; }
.smm__link:hover, .smm__link:focus-visible { background: rgba(69, 148, 209, 0.1); color: var(--smm-deep); outline: 0; }
.smm__ico { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; }
.smm__icon { display: block; width: 24px; height: 24px; object-fit: contain; }
.smm__section--tech .smm__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, auto); grid-auto-flow: column; column-gap: 18px; }
.smm__section--eco .smm__link { min-height: 48px; }
.smm__section--eco .smm__ico { width: 56px; height: 34px; justify-items: start; }
.smm__section--eco .smm__icon { width: auto; max-width: 56px; height: 32px; }
.smm__section--solution .smm__link { min-height: 52px; }
.smm__section--solution .smm__ico, .smm__section--solution .smm__icon { width: 32px; height: 32px; }
.smm--solutions .smm__link { font-size: 15.5px; }

/* "Shop all products" under the solution list */
.smm__cta { display: flex; align-items: center; justify-content: center; min-height: 48px; margin-top: auto; padding: 12px 20px; border-radius: 10px; background: linear-gradient(90deg, #4594D1 0%, #0E4C92 100%); color: #FFFFFF; font: 700 15.5px/1.2 'Manrope', sans-serif; text-align: center; text-decoration: none; }
.smm__cta:hover, .smm__cta:focus-visible { background: linear-gradient(90deg, #3C88C4 0%, #0B3F7A 100%); color: #FFFFFF; outline: 0; }

/* Smart Energy Management photo cards */
.smm__list--cards { display: flex; flex-direction: column; gap: 14px; }
.smm__card { display: flex; align-items: flex-start; gap: 14px; padding: 6px; margin-inline: -6px; border-radius: 10px; color: var(--smm-ink); text-decoration: none; transition: background 140ms ease; }
.smm__card:hover, .smm__card:focus-visible { background: rgba(69, 148, 209, 0.1); outline: 0; }
.smm__card-img { flex: 0 0 auto; width: 84px; height: 84px; border-radius: 8px; object-fit: cover; }
.smm__card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.smm__card-title { font: 600 16px/1.4 'Manrope', sans-serif; }
.smm__card:hover .smm__card-title { color: var(--smm-deep); }
.smm__card-sub { color: var(--smm-muted); font: 500 12.5px/1.6 'Manrope', sans-serif; }

/* Promo tiles */
.smm__promo { position: relative; display: block; overflow: hidden; align-self: start; border-radius: 12px; background: linear-gradient(160deg, #4594D1, #0E4C92); text-decoration: none; }
.smm__promo-img { display: block; width: 100%; height: auto; transition: transform 400ms ease; }
.smm__promo:hover .smm__promo-img { transform: scale(1.03); }
.smm__promo--gen4 { aspect-ratio: 320 / 500; max-height: 500px; }
.smm__promo--gen4 .smm__promo-img { height: 100%; object-fit: cover; }
.smm__promo-btn { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; min-width: 172px; min-height: 48px; padding: 12px 24px; border-radius: 10px; background: #FFFFFF; color: var(--smm-ink); font: 700 16px/1 'Manrope', sans-serif; white-space: nowrap; }
.smm__promo:hover .smm__promo-btn { color: var(--smm-deep); }
.smm__promo--photo { aspect-ratio: 330 / 370; }
.smm__promo--photo .smm__promo-img { height: 100%; object-fit: cover; }
.smm__promo--photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9, 30, 66, 0) 30%, rgba(9, 30, 66, 0.28) 100%); }
.smm__promo-title { position: absolute; z-index: 1; left: 18px; right: 18px; top: 50%; transform: translateY(-50%); color: #FFFFFF; font: 700 24px/1.25 'Manrope', sans-serif; text-align: center; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35); }

@media (max-width: 1380px) {
	.smm { width: calc(100% - 48px); }
	.smm__main, .smm__side { padding-inline: 20px; }
	.smm__cols { gap: 22px; }
	.smm__side { grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 22px; }
	.smm__chip { font-size: 14px; gap: 8px; }
	.smm__promo-title { font-size: 20px; }
}
@media (max-width: 1240px) {
	.smm__side { grid-template-columns: minmax(0, 1fr); }
	.smm__promo { display: none; }
	.smm__chip .smm__arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.smm, .shelly-nav__item--smm.is-open > .smm, .smm__promo-img, .smm__arrow { transition: none; }
}

/* ---------- Phone drawer: the same content as an accordion ---------- */
.shelly-drawer .smm { position: static; display: none; width: auto; max-height: none; margin: 0; overflow: visible; border: 0; border-radius: 0; background: #F7F9FB; box-shadow: none; opacity: 1; visibility: visible; transform: none; transition: none; }
.shelly-drawer .smm::before, .shelly-drawer .smm--products .smm__main::after { display: none; }
.shelly-drawer .shelly-nav__item--smm.is-expanded > .smm { display: block; }
.shelly-drawer .shelly-nav__item--smm.is-expanded > .shelly-nav__link .shelly-nav__caret { transform: rotate(180deg); }
.shelly-drawer .smm__inner, .shelly-drawer .smm__cols, .shelly-drawer .smm__side { display: block; }
.shelly-drawer .smm__main, .shelly-drawer .smm__side { padding: 0 20px; background: none; border-radius: 0; }
.shelly-drawer .smm__main { padding-top: 12px; }
.shelly-drawer .smm__side { padding-bottom: 16px; }
.shelly-drawer .smm__col { display: block; }
.shelly-drawer .smm__chips { flex-direction: column; gap: 8px; margin: 0 0 6px; }
.shelly-drawer .smm__chips .smm__chip { white-space: normal; }
.shelly-drawer .smm__chip { min-height: 46px; font-size: 14.5px; }
.shelly-drawer .smm__arrow { width: 28px; height: 28px; }
.shelly-drawer .smm__section { border-bottom: 1px solid rgba(18, 21, 25, 0.07); }
.shelly-drawer .smm__title { position: relative; display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 14px 0; border: 0; color: var(--smm-ink); font: 700 14.5px/1.3 'Manrope', sans-serif; cursor: pointer; }
/*rtl:ignore*/
.shelly-drawer .smm__title::after { content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-inline: 12px 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform 160ms ease; }
/*rtl:ignore*/
.shelly-drawer .smm__section.is-open > .smm__title::after { transform: rotate(225deg) translateY(-1px); }
.shelly-drawer .smm__title:focus-visible { outline: 2px solid var(--smm-blue); outline-offset: 2px; }
.shelly-drawer .smm__section > .smm__list { display: none; padding: 0 0 12px; }
.shelly-drawer .smm__section.is-open > .smm__list { display: block; }
.shelly-drawer .smm__section--tech.is-open .smm__list { display: grid; }
.shelly-drawer .smm__link { min-height: 40px; font-size: 14.5px; }
.shelly-drawer .smm__section--solution .smm__link { min-height: 44px; }
.shelly-drawer .smm__section--solution .smm__ico, .shelly-drawer .smm__section--solution .smm__icon { width: 26px; height: 26px; }
.shelly-drawer .smm__cta { margin: 14px 0 0; }
.shelly-drawer .smm__card-img { width: 60px; height: 60px; }
.shelly-drawer .smm__card-title { font-size: 14.5px; }
.shelly-drawer .smm__promo { display: none; }
