/* ─── Shell ─────────────────────────────────────────────── */

.ec-mega-menu {
    position: relative;
    z-index: 200;
    background: #ffffff;
    transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 250ms ease-in-out;

    /* Beige/dark tints used throughout the mobile menu — derived from the
       theme's cloud/dark tokens (color-mix %s match the Figma "Beige 40%",
       "Beige 60%" and "Dark blue 60%" layer names exactly) rather than
       hardcoded hex, so they stay in sync if the tokens ever change. */
    --ec-tint-cloud-40: color-mix(in srgb, var(--wp--preset--color--cloud) 40%, white);
    --ec-tint-cloud-60: color-mix(in srgb, var(--wp--preset--color--cloud) 60%, white);
    --ec-tint-dark-60: color-mix(in srgb, var(--wp--preset--color--dark) 60%, white);
}
.ec-mega-menu:hover {

}

/* Reserves the menu's height in the flow while it is pinned via position:fixed,
   so removing it from the flow doesn't jump the content underneath.
   (html,body have overflow-x:hidden in base.css, which forces overflow-y to
   `auto` per spec and breaks position:sticky here — so scroll state is
   driven by JS toggling .is-fixed instead.) */
.ec-mega-menu__spacer {
    display: block;
    height: 0;
}

/* Pages opening with the case study header or Hero block: let its gradient
   backdrop show through the nav until the nav pins itself on scroll. */
body.has-articleheader-hero .ec-mega-menu:not(.is-fixed),
body.has-rf-hero .ec-mega-menu:not(.is-fixed) {
    background: transparent;
    box-shadow: none;
}

/* Pinned overlay state, engaged by JS once the page has scrolled */
.ec-mega-menu.is-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

/* Slides fully out of view on scroll-down, slides back in on scroll-up */
.ec-mega-menu.is-fixed.is-hidden {
    transform: translateY(-100%);
    box-shadow: none;
}

/* Keep the (fixed) admin toolbar clear of the menu when logged in */
body.admin-bar .ec-mega-menu.is-fixed {
    top: 32px;
}

/* wpadminbar is hidden below 782px (see base.scss) — nothing left to clear */
@media screen and (max-width: 782px) {
    body.admin-bar .ec-mega-menu.is-fixed {
        top: 0;
    }
}

.ec-mega-menu__inner {
    /* Stacked above .ec-mega-menu__backdrop (z-index 250) so the header
       bar itself never gets dimmed/blurred by its own backdrop overlay. */
    position: relative;
    z-index: 260;

    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2.5vw, 1.5rem);
    max-width: calc(var(--wp--style--global--wide-size));
    margin: 0 auto;
    /*//padding-inline: 2rem;*/
    /*height: 76px;*/
    border-radius: 0 0 8px 8px;
    padding:2.5rem clamp(2.5rem, 4vw, 5rem) 2.5rem clamp(2.5rem, 4vw, 5rem);

    transition: box-shadow 250ms ease-in-out;
}
.ec-mega-menu__inner:hover {
    transition: box-shadow 250ms ease-in-out, background-color 250ms ease-in-out;;
    box-shadow: 0 16px 40px 0 rgba(44, 57, 83, 0.08);
    background-color:#fff;
}

/* ─── Logo ───────────────────────────────────────────────── */

.ec-mega-menu__logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--wp--preset--color--midnight, #252D3A);
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
    letter-spacing: -0.01em;

    margin-right:clamp(0.75rem, 2vw, 2rem);
}
.ec-mega-menu__logo img {
    width: clamp(120px, 10vw, 144px);
    height: auto;
}

.ec-mega-menu__logo-icon {
    width: 26px;
    height: 26px;
}

/* ─── Nav list ───────────────────────────────────────────── */

.ec-mega-menu__nav { flex: 1; }

.ec-mega-menu__list {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ec-mega-menu__item { position: static;
margin-right:1rem; }

/* ─── Shared: trigger buttons + plain links ──────────────── */

.ec-mega-menu__trigger,
.ec-mega-menu__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.5rem;
    font-family: Poppins;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--wp--preset--color--dark, #252D3A);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
    line-height: 1;
    min-height: 34px;
}

.ec-mega-menu__trigger:hover,
.ec-mega-menu__link:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Active trigger gets a warm tint, matching the screenshot */
.ec-mega-menu__trigger[aria-expanded="true"] {
    background: var(--ec-tint-cloud-60);
}

/* ─── Chevron ────────────────────────────────────────────── */

.ec-mega-menu__chevron {
    width: 8px;
    height: 5px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.ec-mega-menu__trigger[aria-expanded="true"] .ec-mega-menu__chevron {
    transform: rotate(180deg);
}

/* ─── Panel container ────────────────────────────────────────
 * One persistent, shared floating box (centred relative to the full-width
 * header, same as before). Its width/height animate to match whichever
 * panel is active, so switching between two differently-sized panels
 * morphs the box instead of it jumping/re-appearing. The individual
 * panels stack inside it (each its own natural size) and cross-fade +
 * slide horizontally — see .ec-mega-menu__panel below and menu.js.
 */
.ec-mega-menu__panel-container {
    position: absolute;
    left: 0; /* set per-trigger by menu.js so the box sits under the active item */
    top: calc(100% + 6px);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 16px 40px 0 rgba(44, 57, 83, 0.08);
    z-index: 300;
    overflow: hidden;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);

    transition:
        left 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.16s ease,
        transform 0.16s ease,
        visibility 0s linear 0.16s;
}

.ec-mega-menu__panel-container.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition:
        left 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.16s ease,
        transform 0.16s ease,
        visibility 0s linear 0s;
}

/* First open of a fully-closed menu: skip the width/height morph (there's
 * nothing to morph from) and just fade/drop the box in at its target size.
 * menu.js applies this modifier for one frame, then removes it. */
.ec-mega-menu__panel-container.is-opening {
    transition:
        opacity 0.16s ease,
        transform 0.16s ease,
        visibility 0s linear 0s;
}

/* ─── Panel ──────────────────────────────────────────────── */

.ec-mega-menu__panel {
    position: absolute;
    top: 0;
    left: 0;
    width: max-content;
    max-width: calc(100vw - 4rem);
    opacity: 0;
    transform: translateX(24px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ec-mega-menu__panel.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Inner: links + featured column. Flex (not grid) so the box only ever
   takes the width its content needs — a 1-column panel with no featured
   image should be narrow, not stretched to match a fixed track. */
.ec-mega-menu__panel-body {
    display: flex;
    gap: 64px;
}

/* ─── Link grid ──────────────────────────────────────────── */

.ec-mega-menu__panel-grid {
    display: grid;
    grid-template-columns: repeat(var(--panel-columns, 2), 224px);
    column-gap: 88px;
    row-gap: 0;
    padding: 24px;
    /* .ec-mega-menu__panel-body is a flex row, so this grid gets stretched
       to match the height of its taller sibling (the featured image column).
       Without these, grid's default stretch behavior inflates every auto row
       — and every .ec-mega-menu__panel-link cell in it — to fill that extra
       height, ballooning the hover background way past the text content. */
    align-content: start;
    align-items: start;
}

.ec-mega-menu__panel-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s;
    font-family: Poppins;
}

.ec-mega-menu__panel-link:hover {
    background: var(--ec-tint-cloud-60);
}

.ec-mega-menu__panel-link-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--wp--preset--color--dark);
    line-height: 1.6;
    font-family: Poppins;
}

.ec-mega-menu__panel-link-desc {
    font-size: 0.875rem;
    color: var(--ec-tint-dark-60);
    font-weight: 400;
    line-height: 1.4;
    font-family: Poppins;
}

/* ─── Featured column ────────────────────────────────────── */

.ec-mega-menu__panel-featured {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 40px 24px 24px;
    width: 400px;
    flex-shrink: 0;
    background: var(--ec-tint-cloud-40);
}

.ec-mega-menu__panel-featured-heading {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--wp--preset--color--dark);
}

.ec-mega-menu__panel-featured-img {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    /* Fallback gradient — same "corner glow" recipe used sitewide (rf-hero, etc.) */
    background: radial-gradient(
            140% 140% at 100% 100%,
            #FEE7BA 0%,
            #D4EEE9 48%,
            #D2DFFA 71%,
            #FCFBFA 99%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.ec-mega-menu__panel-featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* ─── Panel footer ───────────────────────────────────────── */

.ec-mega-menu__panel-footer {
    padding: 24px 24px;
    border-top: 1px solid var(--wp--preset--color--cloud);
}

.ec-mega-menu__panel-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--wp--preset--color--dark);
    text-decoration: none;
    transition: gap 0.15s;
    font-family: Poppins;

}

.ec-mega-menu__panel-cta:hover {
    color: var(--wp--preset--color--primary);
    transition: color 250ms ease-in-out;
}
.ec-mega-menu__panel-cta:hover svg path {
    fill: var(--wp--preset--color--primary);
    transition: fill 250ms ease-in-out;
}

.ec-mega-menu__panel-cta svg {
    width: 8px;
    height: 13.6px;
}

/* ─── Utilities ──────────────────────────────────────────── */

.ec-mega-menu__utils {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    flex-shrink: 0;
}

.ec-mega-menu__util-link,
.ec-mega-menu__util-btn {
    font-size: 0.9375rem;
}

/* ─── Language switcher (WPML) ───────────────────────────────
   The trigger reuses .ec-mega-menu__trigger as-is (wrapped in
   .ec-mega-menu__item, same aria-controls/data-panel-index pattern as the
   primary nav triggers) so it gets the exact same hover/expanded
   background, chevron-flip and hover-intent/click/Escape behaviour for
   free — see menu.js. Its panel lives in .ec-mega-menu__panel-container
   alongside the nav panels too, so only the icon + compact list layout
   below are specific to it. */

.ec-mega-menu__lang {
    margin-right: 0;
}

.ec-mega-menu__lang--mobile {
    display: none;
}

.ec-mega-menu__lang-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: currentColor;
}

.ec-mega-menu__lang-list {
    list-style: none;
    margin: 0;
    padding: 0.375rem;
    min-width: 148px;
}

.ec-mega-menu__lang-option {
    display: block;
    padding: 0.5rem 0.625rem;
    border-radius: 6px;
    font-family: Poppins;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--wp--preset--color--dark, #2C3953);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.ec-mega-menu__lang-option:hover,
.ec-mega-menu__lang-option:focus-visible {
    background: var(--ec-tint-cloud-60);
}

.ec-mega-menu__lang-option.is-current {
    color: var(--wp--preset--color--primary);
}

/* ─── CTA pill ───────────────────────────────────────────── */

.ec-mega-menu__cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 20px;
    margin-left: 0.5rem;
    background: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--dark);
    font-family: Poppins;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 100px;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 0.15s, transform 0.15s;
}

.ec-mega-menu__cta:hover {
    background-color:#ECC02E;
}

/* Scribble that pops out on hover — an inline SVG (see menu.php) rather than
   a CSS background-image, so each stroke is a real <path> that can be drawn
   in on its own via clip-path. Hidden by default; hover-only, per spec.
   Sequence: line 1 draws in, line 2 follows a beat later, then the whole
   mark swings from a tucked-away angle into its resting tilt with a bouncy
   overshoot — "drawn, then rotated into place". */
.ec-mega-menu__cta-scribble {
    position: absolute;
    top: -0.7rem;
    right: -0.55rem;
    width: 22px;
    height: 22px;
    color: #F14676;
    pointer-events: none;
    opacity: 0;
    transform: rotate(-80deg);
    transition: opacity 0.2s ease;
}

.ec-mega-menu__cta-scribble svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.ec-mega-menu__cta-scribble-line {
    clip-path: inset(0 100% 0 0);
}

.ec-mega-menu__cta:hover .ec-mega-menu__cta-scribble {
    opacity: 1;
    animation: ec-cta-scribble-rotate 0.5s cubic-bezier(.34, 1.56, .64, 1) 0.22s forwards;
}

.ec-mega-menu__cta:hover .ec-mega-menu__cta-scribble-line {
    animation: ec-cta-scribble-draw 0.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.ec-mega-menu__cta:hover .ec-mega-menu__cta-scribble-line--2 {
    animation-delay: 0.16s;
}

@keyframes ec-cta-scribble-draw {
    to { clip-path: inset(0 0% 0 0); }
}

@keyframes ec-cta-scribble-rotate {
    from { transform: rotate(-80deg); }
    to   { transform: rotate(-80deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ec-mega-menu__cta-scribble,
    .ec-mega-menu__cta-scribble-line {
        animation: none !important;
        transition: opacity 0.15s ease;
    }
    .ec-mega-menu__cta:hover .ec-mega-menu__cta-scribble {
        opacity: 1;
        transform: none;
    }
    .ec-mega-menu__cta:hover .ec-mega-menu__cta-scribble-line {
        clip-path: inset(0 0% 0 0);
    }
}

/* ─── Active nav item — scribble underline ──────────────────
   Same shared pattern as .ec-scribble-underline elsewhere in the theme
   (see CLAUDE.md / effectory_scribble_underline()) — every consumer keeps
   its own copy of the base rules and just sets --ec-scribble-color plus its
   own reveal trigger. The header is visible immediately on load (no scroll
   involved), so this reveals via a plain @keyframes animation on load
   instead of the usual IntersectionObserver + .is-inview toggle. */
.ec-mega-menu__link.is-current,
.ec-mega-menu__trigger.is-current {
    --ec-scribble-color: #A469F5;
}

.ec-mega-menu__link .ec-scribble-underline,
.ec-mega-menu__trigger .ec-scribble-underline {
    position: relative;
    display: inline-block;
    color: inherit;
}

.ec-mega-menu__link .ec-scribble-underline__text,
.ec-mega-menu__trigger .ec-scribble-underline__text {
    position: relative;
    z-index: 1;
}

.ec-mega-menu__link .ec-scribble,
.ec-mega-menu__trigger .ec-scribble {
    position: absolute;
    left: -4%;
    right: -4%;
    bottom: -0.4em;
    width: 108%;
    height: 0.4em;
    color: var(--ec-scribble-color, currentColor);
    overflow: visible;
    clip-path: inset(0 100% 0 0);
    animation: ec-nav-scribble-reveal 0.6s cubic-bezier(0.65, 0, 0.35, 1) 0.5s forwards;
}

@keyframes ec-nav-scribble-reveal {
    to { clip-path: inset(0 0% 0 0); }
}

@media (prefers-reduced-motion: reduce) {
    .ec-mega-menu__link .ec-scribble,
    .ec-mega-menu__trigger .ec-scribble {
        animation: none;
        clip-path: inset(0 0% 0 0);
    }
}

/* ─── Backdrop ───────────────────────────────────────────── */

.ec-mega-menu__backdrop {
    /* Always covers the full viewport top-to-bottom. It sits behind both
       the header bar (.ec-mega-menu__inner, z-index 260) and the dropdown
       (.ec-mega-menu__panel-container, z-index 300) via stacking order,
       not by leaving a gap at the top — so it never has to guess the
       header's height. */
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 250;

    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    visibility: hidden;
    pointer-events: none;
    transition:
        backdrop-filter 0.25s ease,
        -webkit-backdrop-filter 0.25s ease,
        visibility 0s linear 0.25s;
}

.ec-mega-menu__backdrop.is-visible {
    visibility: visible;
    pointer-events: auto;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition:
        backdrop-filter 0.25s ease,
        -webkit-backdrop-filter 0.25s ease,
        visibility 0s linear 0s;
}

/* ─── Mobile hamburger toggle ────────────────────────────── */

.ec-mega-menu__mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin-left: 0.25rem;
    background: var(--ec-tint-cloud-60);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.ec-mega-menu__mobile-toggle .hamburger {
    padding: 0;
}

.ec-mega-menu__mobile-toggle .hamburger-box {
    width: 18px;
    height: 14px;
}

.ec-mega-menu__mobile-toggle .hamburger-inner,
.ec-mega-menu__mobile-toggle .hamburger-inner::before,
.ec-mega-menu__mobile-toggle .hamburger-inner::after {
    width: 18px;
    height: 2px;
    border-radius: 1px;
    background-color: var(--wp--preset--color--dark, #2C3953);
}

/* Vendor default spacing (±10px) is too wide for our slimmer 14px-tall box —
   tighten to a 6px gap between bars, matching the Figma glyph proportions. */
.ec-mega-menu__mobile-toggle .hamburger-inner {
    margin-top: -1px;
}

.ec-mega-menu__mobile-toggle .hamburger-inner::before {
    top: -6px;
}

.ec-mega-menu__mobile-toggle .hamburger-inner::after {
    bottom: -6px;
}

/* the vendor "Hamburgers" CSS turns bars white on .is-active — override back to dark */
.ec-mega-menu__mobile-toggle .hamburger.is-active .hamburger-inner,
.ec-mega-menu__mobile-toggle .hamburger.is-active .hamburger-inner::before,
.ec-mega-menu__mobile-toggle .hamburger.is-active .hamburger-inner::after {
    background-color: var(--wp--preset--color--dark, #2C3953);
}

/* ─── Mobile drawer ──────────────────────────────────────── */

.ec-mega-menu__mobile {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    flex-direction: column;
    background: #ffffff;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.ec-mega-menu__mobile.is-open {
    opacity: 1;
}

.ec-mega-menu__mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 1.75rem 1rem;
}

.ec-mega-menu__mobile-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--ec-tint-cloud-40);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.ec-mega-menu__mobile-viewport {
    position: relative;
    flex: 1;
    overflow: hidden;
    /* Only the menu content slides/scales in. The top bar (logo + close)
       just fades, so its logo stays exactly on top of the header logo
       and appears not to move. */
    transform: translateY(12px) scale(0.98);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.ec-mega-menu__mobile.is-open .ec-mega-menu__mobile-viewport {
    transform: none;
}

.ec-mega-menu__mobile-panels {
    position: relative;
    height: 100%;
}

/* Every panel fills the viewport and starts parked off-screen to the right,
   ready to slide in. The root list is the one exception — it's visible by
   default and instead gets pushed left (.is-exited) when a submenu opens. */
.ec-mega-menu__mobile-panel {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 1.5rem 2rem;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    background: #ffffff;
}

.ec-mega-menu__mobile-panel[data-mobile-panel="root"] {
    transform: translateX(0);
}

.ec-mega-menu__mobile-panel[data-mobile-panel="root"].is-exited {
    transform: translateX(-100%);
}

.ec-mega-menu__mobile-panel.is-active {
    transform: translateX(0);
}

/* ─── Root list ──────────────────────────────────────────── */

.ec-mega-menu__mobile-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ec-mega-menu__mobile-item + .ec-mega-menu__mobile-item {
    margin-top: 0.25rem;
}

.ec-mega-menu__mobile-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.375rem;
    width: calc(100% + 2rem);
    margin: 0 -1rem;
    padding: 1rem;
    background: transparent;
    border: 0;
    border-radius: 4px;
    font-family: Poppins;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--wp--preset--color--dark, #2C3953);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.ec-mega-menu__mobile-link:hover,
.ec-mega-menu__mobile-link:active {
    background: var(--ec-tint-cloud-40);
}

.ec-mega-menu__mobile-arrow {
    flex-shrink: 0;
    opacity: 1;
}

/* ─── Submenu: back button + title/description list ─────────── */

.ec-mega-menu__mobile-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
    padding: 0.5rem 0.25rem;
    background: transparent;
    border: 0;
    font-family: Poppins;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--wp--preset--color--dark, #2C3953);
    cursor: pointer;
}

.ec-mega-menu__mobile-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ec-mega-menu__mobile-sublink {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 1rem;
    margin: 0 -1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.ec-mega-menu__mobile-sublink:hover,
.ec-mega-menu__mobile-sublink:active {
    background: var(--ec-tint-cloud-40);
}

.ec-mega-menu__mobile-sublink-title {
    font-family: Poppins;
    font-size: 1rem;
    font-weight: 600;
    color: var(--wp--preset--color--dark, #2C3953);
}

.ec-mega-menu__mobile-sublink-desc {
    font-family: Poppins;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--ec-tint-dark-60);
}

/* ─── Submenu: "see all" CTA ─────────────────────────────────── */

.ec-mega-menu__mobile-subcta {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    padding: 1rem;
    font-family: Poppins;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--wp--preset--color--dark, #2C3953);
    text-decoration: none;
}

.ec-mega-menu__mobile-subcta svg {
    flex-shrink: 0;
}

/* ─── Fixed footer: CTA + utility links (e.g. Login) ─────────── */

.ec-mega-menu__mobile-footer {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-shrink: 0;
    padding: 1.5rem 1.5rem 2rem;
    border-top: 1px solid var(--wp--preset--color--cloud);
}

.ec-mega-menu__mobile-footer .ec-mega-menu__cta {
    margin-left: 0;
}

.ec-mega-menu__mobile-util {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: Poppins;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--wp--preset--color--dark, #2C3953);
    text-decoration: none;
}

/* Locks page scroll behind the open drawer */
html.ec-mobile-menu-open,
html.ec-mobile-menu-open body {
    overflow: hidden;
}

@media (max-width: 900px) {
    .ec-mega-menu__nav,
    .ec-mega-menu__utils .ec-mega-menu__util-link,
    .ec-mega-menu__utils .ec-mega-menu__cta {
        display: none;
    }

    .ec-mega-menu__lang--desktop {
        display: none;
    }

    .ec-mega-menu__lang--mobile {
        display: inline-flex;
    }

    .ec-mega-menu__lang--mobile .ec-mega-menu__lang-icon {
        width: 14px;
        height: 14px;
    }

    .ec-mega-menu__lang--mobile .ec-mega-menu__lang-trigger {
        gap: 0.375rem;
        font-size: 0.875rem;
    }

    .ec-mega-menu__mobile-toggle {
        display: inline-flex;
    }

    .ec-mega-menu__mobile {
        display: flex;
    }

    .ec-mega-menu__inner {
        padding: 1.75rem 1rem;
    }

    .ec-mega-menu__lang--mobile .ec-mega-menu__lang-trigger {
        border-radius: 2px;
    }
}

/* ─── Reduced motion ─────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .ec-mega-menu { transition: none; }
    .ec-mega-menu__panel-container,
    .ec-mega-menu__panel-container.is-open,
    .ec-mega-menu__panel-container.is-opening { transition: opacity 0.01s linear, visibility 0s linear; }
    .ec-mega-menu__panel { transition: opacity 0.01s linear; transform: none !important; }
    .ec-mega-menu__backdrop,
    .ec-mega-menu__backdrop.is-visible { transition: visibility 0s linear; }
    .ec-mega-menu__chevron,
    .ec-mega-menu__cta,
    .ec-mega-menu__panel-cta { transition: none; }
    .ec-mega-menu__mobile,
    .ec-mega-menu__mobile-viewport,
    .ec-mega-menu__mobile-panel { transition: none !important; }
}