/* ═══════════════════════════════════════════════════════════════
   NEXUS PRIME | ECOSYSTEM UI ENGINE (v67.12-OPERATIONAL)
   Fully semantic: uses theme var() tokens from main.css
   Supports both [data-theme="dark"] (default) and [data-theme="light"]
═══════════════════════════════════════════════════════════════ */

/* ─── Header layout tokens ─── */
:root {
    --eco-header-h: 68px;
    --eco-mega-z: 2100;
    --eco-header-z: 2000;
    --eco-nav-z: 1900;
}

/* ═══════════════════════════════════
   1. ECO HEADER
═══════════════════════════════════ */
.eco-header {
    display: flex !important;
    height: var(--eco-header-h);
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--eco-header-z);
    transition: transform 0.35s var(--ease-in-out-smooth),
        background 0.3s ease,
        box-shadow 0.3s ease;
}

.eco-header.is-hidden {
    transform: translateY(-100%);
}

.eco-header.is-scrolled {
    background: var(--bg-primary);
    box-shadow: var(--shadow-premium);
}

.eco-header-inner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    max-width: 1600px;
    margin: 0 auto;
    height: 100%;
    width: 100%;
    padding: 0 1.5rem;
    gap: 1rem;
}

/* Main-navigation: sticks below the eco-header.
   Targets <nav role="navigation" class="main-navigation"> in header.php
   When eco-header slides away, CSS :has() promotes nav to top:0
   via sticky — no JS needed, no conflicts. */
nav[role="navigation"].main-navigation {
    position: sticky;
    top: var(--eco-header-h);
    z-index: var(--eco-nav-z);
    transition: top 0.35s var(--ease-in-out-smooth);
}

/* When eco-header is hidden, nav slides up to take its place */
:has(.eco-header.is-hidden) nav[role="navigation"].main-navigation {
    top: 0;
}

/* ═══════════════════════════════════
   2. LEFT SECTION
═══════════════════════════════════ */
.eco-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.eco-brand {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    text-decoration: none !important;
}

.eco-brand i {
    width: 20px;
    height: 20px;
    color: var(--accent-gold);
}

.eco-brand span {
    color: var(--accent-gold);
}

.eco-module-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--module-color) 10%, transparent);
    color: var(--module-color);
    border: 1px solid color-mix(in srgb, var(--module-color) 25%, transparent);
}

/* ═══════════════════════════════════
   3. RIGHT SECTION
═══════════════════════════════════ */
.eco-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.eco-divider {
    width: 1px;
    height: 28px;
    background: var(--border-subtle);
    flex-shrink: 0;
    margin: 0 0.25rem;
}

/* ═══════════════════════════════════
   4. ECO BUTTONS (base)
═══════════════════════════════════ */
.eco-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--bg-glass-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    height: 36px;
    width: 36px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none !important;
    transition: background var(--transition-base),
        color var(--transition-base),
        border-color var(--transition-base),
        transform var(--transition-fast);
    flex-shrink: 0;
    position: relative;
}

.eco-btn i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.eco-btn:hover {
    background: var(--bg-hover-primary);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    transform: translateY(-1px);
}

/* TUTTO button — wider, gold accent */
.eco-btn-tutto {
    width: auto;
    padding: 0 14px;
    gap: 0.5rem;
    background: var(--bg-accent);
    border-color: var(--border-vibrant);
    color: var(--accent-gold);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 1.2px;
}

.eco-btn-tutto i {
    transition: transform var(--transition-base);
}

.eco-btn-tutto {
    animation: eco-tutto-bloom 4s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes eco-tutto-bloom {

    0%,
    80%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 transparent;
        border-color: var(--border-vibrant);
    }

    85% {
        transform: scale(1.08);
        box-shadow: 0 0 20px hsla(38, 90%, 55%, 0.4);
        border-color: var(--accent-gold);
        background: var(--bg-hover-primary);
    }

    90% {
        transform: scale(0.96);
    }

    95% {
        transform: scale(1.04);
        box-shadow: 0 0 15px hsla(38, 90%, 55%, 0.3);
    }
}

.eco-btn-tutto:hover i {
    transform: scale(1.1) rotate(90deg);
}

.eco-btn-tutto:hover,
.eco-btn-tutto.is-open {
    animation-play-state: paused;
    background: var(--bg-hover-primary);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* Galia button */
.eco-btn-galia {
    color: var(--accent-gold);
    background: var(--bg-accent);
    border-color: var(--border-vibrant);
}

.eco-btn-galia:hover {
    box-shadow: var(--glow-accent);
}

/* Danger (sync/reset) */
.eco-btn-danger {
    color: var(--accent-crimson);
    border-color: color-mix(in srgb, var(--accent-crimson) 25%, transparent);
}

.eco-btn-danger:hover {
    background: var(--area-danger-bg);
    border-color: var(--accent-crimson);
    color: var(--accent-crimson);
}

/* Login button */
.eco-btn-login {
    width: auto;
    padding: 0 14px;
    background: var(--bg-hover-primary);
    border-color: var(--border-vibrant);
    color: var(--accent-primary);
}

.eco-btn-label {
    font-size: 0.8rem;
    font-weight: 700;
}

/* Lang code text */
.eco-btn-lang {
    width: auto;
    padding: 0 12px;
}

.eco-lang-code {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
}

/* ═══════════════════════════════════
   5. SEARCH BAR
═══════════════════════════════════ */
.eco-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0 0.75rem;
    height: 36px;
    width: 180px;
    transition: width 0.3s ease, border-color 0.2s ease;
}

.eco-search i {
    width: 15px;
    height: 15px;
    color: var(--text-dim);
    flex-shrink: 0;
}

.eco-search-input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
    width: 100%;
}

.eco-search-input::placeholder {
    color: var(--text-dim);
}

.eco-search:focus-within {
    width: 240px;
    border-color: var(--accent-primary);
}

/* ═══════════════════════════════════
   6. AVATAR
═══════════════════════════════════ */
.eco-profile-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.eco-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gold);
    color: var(--text-on-accent);
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-subtle);
    overflow: hidden;
    transition: border-color var(--transition-base), transform var(--transition-fast);
}

.eco-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eco-profile-trigger:hover .eco-avatar {
    border-color: var(--accent-gold);
    transform: scale(1.05);
}

.eco-avatar-lg {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
}

.eco-profile-dropdown {
    min-width: 240px;
}

.eco-profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.eco-profile-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.eco-profile-role {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent-gold);
    letter-spacing: 1px;
    opacity: 0.9;
}

.eco-logout {
    color: var(--accent-crimson) !important;
}

/* ═══════════════════════════════════
   7. PULSE INDICATOR
═══════════════════════════════════ */
.eco-pulse {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 9px;
    height: 9px;
    background: var(--accent-crimson);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.eco-pulse:not(.is-hidden) {
    animation: eco-pulse-anim 1.5s infinite;
}

@keyframes eco-pulse-anim {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-crimson) 70%, transparent);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px transparent;
    }

    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 transparent;
    }
}

/* ═══════════════════════════════════
   8. MEGA MENU
═══════════════════════════════════ */
.eco-mega-menu {
    display: none !important;
    /* Critical Layout Guard */
    position: fixed;
    top: var(--eco-header-h);
    left: 0;
    width: 100%;
    z-index: var(--eco-mega-z);
    /* animate from top */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s var(--ease-in-out-smooth);
}

.eco-mega-menu.is-open {
    display: block !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.eco-mega-inner {
    background: var(--bg-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    border-left: none;
    border-right: none;
    max-width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    box-shadow: var(--shadow-premium);
}

/* Backdrop */
.eco-mega-backdrop {
    display: none !important;
    position: fixed;
    inset: 0;
    z-index: calc(var(--eco-mega-z) - 1);
    background: var(--modal-overlay-bg);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: var(--modal-overlay-blur);
    -webkit-backdrop-filter: var(--modal-overlay-blur);
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.eco-mega-backdrop.is-visible {
    display: block !important;
    opacity: 1;
    visibility: visible;
}

/* ─── Mega columns ─── */
.eco-mega-col {
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--border-subtle);
}

.eco-mega-col:last-child {
    border-right: none;
}

.eco-col-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

.eco-col-title i {
    width: 14px;
    height: 14px;
}

/* ─── World cards (Col 1) ─── */
.eco-world-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.eco-world-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    text-decoration: none !important;
    transition: background var(--transition-base),
        border-color var(--transition-base),
        transform var(--transition-fast);
}

.eco-world-card:hover {
    background: var(--bg-hover-primary);
    border-color: var(--accent-gold);
    transform: translateX(4px);
}

.eco-world-card.is-active {
    background: var(--bg-hover-primary);
    border-color: var(--border-active);
}

.eco-world-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--world-color) 12%, transparent);
    color: var(--world-color);
    flex-shrink: 0;
}

.eco-world-icon i {
    width: 18px;
    height: 18px;
}

.eco-world-card>div:last-child strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.eco-world-card>div:last-child span {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* ─── Nav link list (Cols 2-4) ─── */
.eco-link-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.eco-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    font-size: 0.83rem;
    color: var(--text-secondary);
    text-decoration: none !important;
    transition: background var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

.eco-nav-link i {
    width: 15px;
    height: 15px;
    opacity: 0.7;
    flex-shrink: 0;
}

.eco-nav-link:hover {
    background: var(--bg-hover-primary);
    color: var(--text-primary);
    transform: translateX(3px);
}

.eco-nav-link:hover i {
    opacity: 1;
}

.eco-nav-link-highlight {
    color: var(--accent-secondary);
    font-weight: 600;
}

.eco-nav-link-cta {
    color: var(--accent-gold);
    font-weight: 700;
    background: var(--bg-accent);
    border: 1px solid var(--border-vibrant);
    border-radius: 8px;
    margin-top: 0.15rem;
}

.eco-nav-link-cta:hover {
    background: var(--bg-hover-primary);
    border-color: var(--accent-gold);
}

/* ─── Shimmer Shine Effect (NPSP v67.12.M - Refined) ─── */
.eco-shimmer-btn {
    position: relative;
    overflow: hidden;
}

.eco-shimmer-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 40%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 30%,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0.1) 70%,
            rgba(255, 255, 255, 0) 100%);
    filter: blur(4px);
    /* Professional edge softening */
    transform: skewX(-30deg);
    animation: eco-shimmer-shine 6s infinite cubic-bezier(0.4, 0, 0.6, 1);
    pointer-events: none;
}

@keyframes eco-shimmer-shine {
    0% {
        left: -150%;
    }

    15% {
        left: 150%;
    }

    100% {
        left: 150%;
    }

    /* Cinematic pause */
}

/* ─── Domino Illumination Protocol (NPSP v67.12.M) ─── */
.eco-mega-menu.is-open .eco-nav-link,
.eco-mega-menu.is-open .eco-world-card,
body.nx-is-ready .eco-header-left>*,
body.nx-is-ready .eco-header-right>*,
body.nx-is-ready .main-navigation .nav-links li {
    animation: eco-domino-glow 0.8s both;
}

@keyframes eco-domino-glow {
    0% {
        opacity: 0;
        transform: translateY(-4px);
        filter: brightness(1);
    }

    20% {
        opacity: 1;
        filter: brightness(1.8);
        color: var(--accent-gold);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: brightness(1);
    }
}

/* ─── Global Header Awakening (Page Load) ─── */
.eco-header-inner {
    position: relative;
    /* overflow: visible to allow dropdowns */
}

.eco-header-sweep-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

body.nx-is-ready .eco-header-sweep-layer::after {
    content: "";
    position: absolute;
    top: 5%;
    left: -150%;
    width: 100%;
    /* Wider for a soft wrap */
    height: 90%;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.45) 0%,
            rgba(255, 255, 255, 0.1) 40%,
            rgba(255, 255, 255, 0) 70%);
    filter: blur(50px);
    transform: skewX(-15deg);
    animation: eco-header-sweep 2.2s 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes eco-header-sweep {
    0% {
        left: -120%;
    }

    100% {
        left: 220%;
    }
}

/* Page Load Domino Delays (Header Left) */
body.nx-is-ready .eco-header-left> :nth-child(1) {
    animation-delay: 0.1s;
}

/* Switcher */
body.nx-is-ready .eco-header-left> :nth-child(2) {
    animation-delay: 0.2s;
}

/* Brand */
body.nx-is-ready .eco-header-left> :nth-child(3) {
    animation-delay: 0.3s;
}

/* Badge */

/* Page Load Domino Delays (Header Right) */
body.nx-is-ready .eco-header-right> :nth-child(1) {
    animation-delay: 0.4s;
}

/* Search */
body.nx-is-ready .eco-header-right> :nth-child(2) {
    animation-delay: 0.45s;
}

/* Divider */
body.nx-is-ready .eco-header-right> :nth-child(3) {
    animation-delay: 0.5s;
}

/* Sound */
body.nx-is-ready .eco-header-right> :nth-child(4) {
    animation-delay: 0.55s;
}

/* Notif */
body.nx-is-ready .eco-header-right> :nth-child(5) {
    animation-delay: 0.6s;
}

/* Theme */
body.nx-is-ready .eco-header-right> :nth-child(6) {
    animation-delay: 0.65s;
}

/* Sync */
body.nx-is-ready .eco-header-right> :nth-child(7) {
    animation-delay: 0.7s;
}

/* Cart */
body.nx-is-ready .eco-header-right> :nth-child(8) {
    animation-delay: 0.75s;
}

/* Galia */
body.nx-is-ready .eco-header-right> :nth-child(9) {
    animation-delay: 0.8s;
}

/* Divider */
body.nx-is-ready .eco-header-right> :nth-child(10) {
    animation-delay: 0.85s;
}

/* Lang */
body.nx-is-ready .eco-header-right> :nth-child(11) {
    animation-delay: 0.9s;
}

/* Profile */

/* Mega Menu Domino Delays (Cascading) */
.eco-mega-menu.is-open .eco-world-card:nth-child(1) {
    animation-delay: 0.1s;
}

.eco-mega-menu.is-open .eco-world-card:nth-child(2) {
    animation-delay: 0.2s;
}

.eco-mega-menu.is-open .eco-world-card:nth-child(3) {
    animation-delay: 0.3s;
}

.eco-mega-menu.is-open .eco-nav-link:nth-child(1) {
    animation-delay: 0.4s;
}

.eco-mega-menu.is-open .eco-nav-link:nth-child(2) {
    animation-delay: 0.45s;
}

.eco-mega-menu.is-open .eco-nav-link:nth-child(3) {
    animation-delay: 0.5s;
}

.eco-mega-menu.is-open .eco-nav-link:nth-child(4) {
    animation-delay: 0.55s;
}

.eco-mega-menu.is-open .eco-nav-link:nth-child(5) {
    animation-delay: 0.6s;
}

.eco-mega-menu.is-open .eco-nav-link:nth-child(6) {
    animation-delay: 0.65s;
}

.eco-mega-menu.is-open .eco-nav-link:nth-child(7) {
    animation-delay: 0.7s;
}

.eco-mega-menu.is-open .eco-nav-link:nth-child(8) {
    animation-delay: 0.75s;
}

.eco-mega-menu.is-open .eco-nav-link:nth-child(9) {
    animation-delay: 0.8s;
}

.eco-mega-menu.is-open .eco-nav-link:nth-child(10) {
    animation-delay: 0.85s;
}

.eco-nav-link-danger {
    color: var(--accent-crimson);
}

.eco-nav-link-galia {
    color: var(--accent-gold);
    font-weight: 700;
    letter-spacing: 0.3px;
}

.eco-nav-link-galia img {
    filter: drop-shadow(0 0 3px var(--accent-gold));
}

.eco-link-separator {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.5rem 0;
}

/* ─── System info block ─── */
.eco-system-info {
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

.eco-status-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.eco-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 6px var(--accent-emerald);
    animation: eco-status-pulse 2s infinite;
}

@keyframes eco-status-pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.eco-build-row {
    opacity: 0.6;
}

/* body lock when mega menu is open */
body.eco-menu-open {
    overflow: hidden;
}

/* ═══════════════════════════════════
   9. RESPONSIVE
═══════════════════════════════════ */
@media (max-width: 1200px) {
    .eco-mega-inner {
        grid-template-columns: repeat(2, 1fr);
    }

    .eco-mega-col {
        border-bottom: 1px solid var(--border-subtle);
    }
}

/* ═══════════════════════════════════════
   MOBILE TOOLBAR (inside mega menu)
   Hidden on desktop, shown on mobile
═══════════════════════════════════════ */
.eco-mobile-toolbar {
    display: none;
    /* hidden on desktop */
}

/* ═══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
═══════════════════════════════════════ */

/* Tablet: hide search bar only */
@media (max-width: 1024px) {
    .eco-search {
        display: none;
    }
}

/* Mobile: minimal header + tools in mega menu */
@media (max-width: 768px) {

    /* Fix page overflow */
    .eco-header {
        max-width: 100vw;
    }

    .eco-header-inner {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    /* Header: show ONLY TUTTO + brand + avatar */
    .eco-module-badge {
        display: none !important;
    }

    .eco-search {
        display: none !important;
    }

    .eco-divider {
        display: none !important;
    }

    /* Hide all right-side tools from the header */
    .eco-header-right>.eco-btn,
    .eco-header-right>.nx-elite-select-container {
        display: none !important;
    }

    /* But keep profile/avatar visible */
    .eco-header-right>.nx-elite-select-container:last-child {
        display: inline-flex !important;
    }

    /* If guest (login button), keep that too */
    .eco-btn-login {
        display: inline-flex !important;
    }

    /* ─── Mobile Toolbar (inside mega menu) ─── */
    .eco-mobile-toolbar {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid var(--border-subtle);
        background: var(--bg-surface-glass);
    }

    .eco-mobile-search {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: var(--bg-input);
        border: 1px solid var(--border-subtle);
        border-radius: 10px;
        padding: 0 0.75rem;
        height: 40px;
        margin-bottom: 0.75rem;
    }

    .eco-mobile-search i {
        width: 16px;
        height: 16px;
        color: var(--text-dim);
        flex-shrink: 0;
    }

    .eco-mobile-search input {
        background: none;
        border: none;
        outline: none;
        color: var(--text-primary);
        font-size: 0.85rem;
        width: 100%;
    }

    .eco-mobile-tools-row {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    /* ─── Mega menu: single-col, full viewport height, scrollable ─── */
    .eco-mega-menu {
        max-height: calc(100dvh - var(--eco-header-h));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .eco-mega-inner {
        grid-template-columns: 1fr;
        height: auto;
    }

    .eco-mega-col {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        padding: 1.25rem 1rem;
    }

    .eco-mega-col:last-child {
        border-bottom: none;
    }
}

/* ─── 1200px: 2-col mega menu ─── */
@media (min-width: 769px) and (max-width: 1200px) {
    .eco-mega-inner {
        grid-template-columns: repeat(2, 1fr);
    }

    .eco-mega-col {
        border-bottom: 1px solid var(--border-subtle);
    }
}

/* Extra-small: hide brand "prime" text */
@media (max-width: 380px) {
    .eco-brand {
        font-size: 14px;
    }
}