    :root {
        --desktop-sticky-height: 72px;
        --mobile-sticky-height: 60px;
    }

    /* STICKY HEADER BASE */
    .sticky-header-clone {
        position: fixed;
        top: -100%;
        left: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
        z-index: 1000;
        transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        opacity: 0;
        visibility: hidden;
    }

    .sticky-header-clone.active {
        top: 0;
        opacity: 1;
        visibility: visible;
    }

    /* ESPACIO PARA STICKY */
    body.sticky-active {
        padding-top: var(--desktop-sticky-height, 72px);
    }

    /* HEADER ORIGINAL */
    .sticky-header {
        transition: transform 0.3s ease;
    }

    .sticky-header.hide {
        transform: translateY(-100%);
    }

    /* VISIBILIDAD POR DISPOSITIVO */
    .desktop-only {
        display: block;
    }

    .mobile-only {
        display: none;
    }

    .mobile-menu-overlay,
    .sidebar-overlay {
        /* Remove the dark overlay background used previously. Keep element inert so
        JS can still reference it but it won't block or darken the UI. */
        position: fixed;
        inset: 0;
        background: transparent !important;
        z-index: -1 !important;
        display: none !important;
        pointer-events: none !important;
    }

    /* Prevent any JS toggles from showing the overlay visually */
    .menu-open .mobile-menu-overlay,
    .menu-open .sidebar-overlay {
        display: none !important;
    }

    @keyframes slideDown {
        from {
            transform: translateY(-20px);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    /* HEADER MÓVIL - ESTILO OPTIMIZADO */
    @media (max-width: 991.98px) {
        body.sticky-active {
            padding-top: 0;
        }

        body.sticky-mobile-active {
            padding-top: var(--mobile-sticky-height, 60px);
        }

        .mobile-header-wrap {
            width: 100%;
            height: 100%;
            margin: 0 auto;
            padding: 0 1rem;
            max-width: 1736px;
            box-sizing: border-box;
        }

        .sticky-header-clone.mobile-only {
            background: #ffffff;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            border-bottom: 1px solid #f0f0f0;
            padding: 0;
            opacity: 1;
            visibility: visible;
            position: relative;
            top: auto;
            left: auto;
            right: auto;
            z-index: 1000;
        }

        /* make utility classes work for mobile views */
        .mobile-only { display: block !important; }
        .desktop-only { display: none !important; }

        .sticky-header-clone.desktop-only {
            display: none;
        }

        .header-inner-mobile {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 100%;
            position: relative;
            min-height: 60px;
        }

        /* Botón menú izquierdo */
        .mobile-nav-toggle {
            background: transparent;
            border: none;
            color: #333;
            font-size: 1.4rem;
            padding: 5px 10px;
            position: absolute;
            left: 5px;
            z-index: 10;
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Contenedor logo */
        .mobile-logo-wrapper {
            position: absolute;
            left: 0;
            right: 0;
            text-align: center;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: none;
        }

        .mobile-main-logo {
            max-height: 34px;
            width: auto;
            max-width: 150px;
        }

        /* Botón búsqueda derecho */
        .mobile-search-trigger {
            background: transparent;
            border: none;
            color: #333;
            font-size: 1.3rem;
            padding: 5px 10px;
            position: absolute;
            right: 5px;
            z-index: 10;
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Contenedor buscador */
        .mobile-search-wrapper {
            position: fixed;
            top: var(--mobile-sticky-height);
            left: 0;
            width: 100%;
            background: #ffffff;
            padding: 14px 1rem 18px;
            display: none;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            z-index: 1000;
            box-sizing: border-box;
        }

        .search-active .mobile-search-wrapper {
            display: block;
            animation: slideDown 0.3s ease-out;
        }

        .sticky-header-clone.mobile-only .search-box {
            max-width: none;
        }

        .sticky-header-clone.mobile-only .search-fields {
            border-width: 1.25px;
        }

        .sticky-header-clone.mobile-only .search-input {
            font-size: 0.95rem;
            padding: 0.65rem 0.9rem;
        }

        .sticky-header-clone.mobile-only .search-submit {
            padding: 0.6rem 0.95rem;
        }

        .sticky-header-clone.mobile-only .search-results {
            margin-top: 0.65rem;
        }

        /* MENÚ DE CATEGORÍAS MÓVIL */
        .mobile-categories-menu {
            position: fixed;
            /* Always open below the mobile header height so it is not covered */
            top: var(--mobile-sticky-height, 60px);
            left: -100%;
            width: 85%;
            max-width: 350px;
            height: calc(100vh - var(--mobile-sticky-height, 60px));
            background: white;
            /* Ensure the categories panel sits above the sticky mobile header when it becomes fixed */
            z-index: 1220;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
            overflow-y: auto;
        }

        .mobile-categories-menu.active {
            left: 0;
        }

        /* Mobile: make the primary header fixed and simplified for a cleaner look */
        @media (max-width: 640px) {
            /* Primary header is hidden on mobile (we show only the sticky mobile header clone) */
            .primary-subheader.desktop-only { display: none !important; }

            /* Default state stays in flow; sticky behavior handled by JS toggling */
            .sticky-header-clone.mobile-only {
                position: relative;
                top: auto;
                left: auto;
                right: auto;
                z-index: 1000;
                background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
                box-shadow: 0 1px 6px rgba(2,6,23,0.04);
                border-bottom: 1px solid rgba(15,23,42,0.03);
            }

            .sticky-header-clone.mobile-only.active,
            body.sticky-mobile-active .sticky-header-clone.mobile-only {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                z-index: 1200;
                box-shadow: 0 6px 18px rgba(2,6,23,0.08);
                border-bottom: 1px solid rgba(15,23,42,0.06);
            }

            /* compact the mobile sticky header clone for a clean look */
            .sticky-header-clone.mobile-only .header-inner-mobile {
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 8px;
                padding: 8px 12px;
            }

            /* hide the many inline category chips from the original header (desktop-only) */
            .primary-subheader .menu-toggle-container { display: none !important; }

            /* keep only the categories toggle visible and compact inside the clone */
            .sticky-header-clone.mobile-only .menu-toggle.categorias,
            .sticky-header-clone.mobile-only .mobile-nav-toggle {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 44px;
                height: 44px;
                border-radius: 10px;
                background: transparent;
                color: #0b2447;
            }

            .sticky-header-clone.mobile-only .mobile-logo-wrapper { pointer-events: none; }
            /* Allow links inside the logo wrapper to be clickable even if the wrapper itself
            was set to pointer-events:none to avoid accidental blocking of other controls. */
            .sticky-header-clone.mobile-only .mobile-logo-wrapper a,
            .sticky-header-clone.mobile-only .mobile-logo-wrapper a img {
                pointer-events: auto;
                display: inline-block;
            }
            .sticky-header-clone.mobile-only .mobile-main-logo { max-height: 36px; }

            /* keep the main menu label (text) hidden to save space */
            .sticky-header-clone.mobile-only .menu-label { display: none; }

            /* hide the in-header dropdown on small screens (we use the slide-in panel) */
            #categoryMenuDropdown { display: none !important; }

            /* style the slide-in categories panel to look modern */
            .mobile-categories-menu {
                width: 88%;
                max-width: 380px;
                left: -110%;
                border-top-right-radius: 12px;
                border-bottom-right-radius: 12px;
                overflow: auto;
                padding-bottom: 28px;
                /* slide under the mobile header clone so header always remains visible */
                top: var(--mobile-sticky-height, 60px);
                height: calc(100vh - var(--mobile-sticky-height, 60px));
            }

            .mobile-categories-menu.active { left: 0; }

            .mobile-menu-header {
                background: linear-gradient(90deg,#0b63ff,#0033cc);
                color: #fff;
                padding: 14px 16px;
                border-top-right-radius: 12px;
            }

            .mobile-menu-content { padding: 12px 14px; }

            .mobile-categories-list { margin: 0; padding: 0; list-style: none; }
            .mobile-category-item { border-bottom: 1px solid #f3f4f6; }
            .mobile-category-link { display: block; padding: 12px 10px; color: #0b2447; font-weight: 600; }

            .close-menu-btn { background: transparent; border: none; color: #fff; font-size: 1.05rem; padding: 6px; }

            /* Slightly lighten overlay so content behind is subtly visible */
            /* overlay must sit above the header but below the categories panel */
            .mobile-menu-overlay { background: rgba(3,7,18,0.5); z-index: 1210; }
        }

        .mobile-menu-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px;
            background: #0033ff;
            color: white;
        }

        .mobile-menu-header h3 {
            margin: 0;
            font-size: 1.2rem;
        }

        .close-menu-btn {
            background: none;
            border: none;
            color: white;
            font-size: 1.3rem;
        }

        .mobile-categories-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        /* Anchor dropdowns to the menu wrapper */
        .menu-wrapper { position: relative; }

        /* Dropdown/menu for desktop and mobile when using the lateral categories panel */
        .menu-dropdown {
            display: none;
            position: absolute;
            left: 0;
            /* Reduce the vertical gap so the dropdown sits closer to the subheader */
            top: calc(100% + 2px);
            background: white;
            box-shadow: 0 6px 18px rgba(0,0,0,0.08);
            z-index: 1110;
            padding: 12px;
            min-width: 220px;
            box-sizing: border-box;
            border-radius: 10px; /* ensure rectangular card corners match other panels */
        }

        .menu-dropdown.active {
            display: block;
            animation: slideDown 240ms ease;
        }

        .menu-dropdown .submenu {
            display: none;
            background: white;
            padding: 8px 0;
            box-shadow: none;
            pointer-events: auto;
        }

        .menu-dropdown .submenu.active {
            display: block;
        }

        .mobile-category-item {
            border-bottom: 1px solid #eee;
        }

        .mobile-category-link {
            display: block;
            padding: 15px;
            color: #333;
            text-decoration: none;
            font-weight: 500;
        }

        .mobile-submenu {
            list-style: none;
            padding: 0;
            margin: 0;
            background: #f9f9f9;
            display: none;
        }

        .mobile-category-item.active .mobile-submenu {
            display: block;
        }

        .mobile-submenu-item a {
            display: block;
            padding: 12px 20px;
            color: #333;
            text-decoration: none;
            font-size: 0.95rem;
        }
    }

    @media (min-width: 640px) and (max-width: 991.98px) {
        .mobile-header-wrap {
            padding: 0 2rem;
        }

        .mobile-search-wrapper {
            padding: 16px 2rem 22px;
        }
    }

    @media (min-width: 992px) {
        .sticky-header-clone.desktop-only {
            display: block;
        }

        .sticky-header-clone.desktop-only .header-frame {
            padding-top: 0.5rem;
            padding-bottom: 0.5rem;
        }

        .sticky-header-clone.desktop-only .header-shell {
            gap: 1.25rem;
        }
    }

    /* ------------------------------------------------------------------
       ALIGNMENT: Ensure header / subheader / footer share the same centered
       container width and horizontal padding. This forces .header-frame to
       match site header width and centers footer content.
       Added here so subheader-specific stylesheet guarantees effect.
    ------------------------------------------------------------------- */

    /* Use the same max width used in templates (max-w-[1736px]) and center */
    .header-frame,
    .primary-subheader .header-frame,
    .subheader-clone .header-frame,
    .sticky-header-clone .header-frame {
        max-width: 1736px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    /* Ensure the footer uses the same centered container (override any cm margins) */
    .footer-content,
    .footer-bottom {
        max-width: 1736px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box !important;
    }

    /* Slightly reduce vertical spacing in subheader to match header visual height */
    .primary-subheader .subheader-bar,
    .subheader-clone .subheader-bar {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }

    /* -------------------------------------------------------------
       SUBHEADER single-row and overflow handling (desktop only)
       - Keep items in one row; extra items go into a "Más" dropdown.
       - Ensure alignment with header-frame width; no growth in height.
    -------------------------------------------------------------- */
    @media (min-width: 992px) {
        /* Force a single row and hide overflow; we'll capture extras in "Más" */
        .primary-subheader .subheader-bar,
        .sticky-header-clone .subheader-clone .subheader-bar {
            display: flex;
            flex-wrap: nowrap !important;
            align-items: center;
            gap: 0.5rem;
            justify-content: flex-start !important; /* align with header/footer left edge */
            overflow: visible; /* allow dropdowns to render outside the bar */
            white-space: nowrap;
        }

        /* Chips shouldn't flex-grow; keep natural width and allow ellipsis */
        .subheader-bar .menu-toggle-container,
        .subheader-bar .menu-toggle.categorias {
            flex: 0 0 auto;
        }

        .subheader-bar .menu-toggle .menu-label,
        .subheader-bar .menu-toggle-container .menu-label {
            display: inline-block;
            max-width: 16ch;
            overflow: hidden;
            text-overflow: ellipsis;
            vertical-align: bottom;
            white-space: nowrap;
        }

        /* Más dropdown styles */
        .subheader-bar .more-dropdown {
            position: relative;
            flex: 0 0 auto;
        }

        .subheader-bar .more-toggle {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            color: #fff;
            background: #0b0b0b;
            border-radius: 9999px;
            cursor: pointer;
            user-select: none;
            line-height: 1;
        }

        .subheader-bar .more-toggle i { font-size: 0.9em; opacity: 0.85; }

        .subheader-bar .more-menu {
            display: none;
            position: absolute;
            right: 0;
            top: calc(100% + 8px);
            min-width: 240px;
            background: #ffffff;
            color: #0f172a;
            border-radius: 10px;
            box-shadow: 0 10px 30px rgba(2, 6, 23, 0.16);
            padding: 8px;
            z-index: 1200;
        }

        .subheader-bar .more-dropdown.open > .more-menu { display: block; }

        .subheader-bar .more-menu ul { list-style: none; margin: 0; padding: 4px; }
        .subheader-bar .more-menu li {
            position: relative;
            border-radius: 8px;
        }
        .subheader-bar .more-menu li > a {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            color: #0f172a;
            text-decoration: none;
            border-radius: 8px;
        }
        .subheader-bar .more-menu li:hover > a { background: #f3f4f6; }

        /* Nested grupos dropdown inside Más (appears to the right on hover) */
        .subheader-bar .more-grupos-dropdown {
            display: none;
            position: absolute;
            top: 0;
            left: calc(100% + 6px);
            min-width: 260px;
            background: #ffffff;
            border-radius: 10px;
            box-shadow: 0 10px 30px rgba(2, 6, 23, 0.16);
            padding: 8px;
            z-index: 1250;
        }
        .subheader-bar .more-menu li:hover > .more-grupos-dropdown { display: block; }

        .subheader-bar .more-grupos-dropdown .grupos-list { list-style: none; margin: 0; padding: 4px; }
        .subheader-bar .more-grupos-dropdown .grupos-list > li > a,
        .subheader-bar .more-grupos-dropdown .subgrupos-list a {
            display: block;
            padding: 8px 10px;
            color: #0f172a;
            text-decoration: none;
            border-radius: 8px;
        }
        .subheader-bar .more-grupos-dropdown .grupos-list > li > a:hover,
        .subheader-bar .more-grupos-dropdown .subgrupos-list a:hover {
            background: #f3f4f6;
        }
        .subheader-bar .more-grupos-dropdown .subgrupos-list { list-style: none; margin: 0; padding-left: 12px; }
    }

    /* Dropdowns for grupos and nested subgrupos: positioning and flip to avoid viewport overflow */
    @media (min-width: 992px) {
        .grupos-dropdown,
        .more-grupos-dropdown {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            min-width: 220px;
            max-width: 420px;
            background: #ffffff;
            border-radius: 10px;
            box-shadow: 0 10px 30px rgba(2,6,23,0.12);
            padding: 8px;
            z-index: 1300;
            max-height: 60vh;
            overflow: auto;
        }

        /* When flipped, anchor to the right edge of the parent instead */
        .grupos-dropdown.flip,
        .more-grupos-dropdown.flip {
            left: auto;
            right: 0;
        }

        /* Grupo item with nested subgrupos (flyout) */
        .grupos-dropdown .grupos-list > li,
        .more-grupos-dropdown .grupos-list > li {
            position: relative;
        }

        .grupos-dropdown .subgrupos-list,
        .more-grupos-dropdown .subgrupos-list {
            position: absolute;
            top: 0;
            left: calc(100% + 6px);
            min-width: 200px;
            max-width: 360px;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 10px 30px rgba(2,6,23,0.12);
            padding: 6px;
            z-index: 1350;
            max-height: 60vh;
            overflow: auto;
        }

        /* Flip nested flyout when parent manages space on the right */
        .grupos-dropdown.flip .subgrupos-list,
        .more-grupos-dropdown.flip .subgrupos-list {
            left: auto;
            right: calc(100% + 6px);
        }
    }

    /* Desktop-only distribution of chips between left and right edges */
    @media (min-width: 992px) {
        .subheader-bar .chips-row {
            display: flex;
            flex: 1 1 auto;
            min-width: 0;
            flex-wrap: nowrap;
            gap: 0.5rem;
            justify-content: space-between; /* spread chips to the right edge when all fit */
            align-items: center;
        }

        .subheader-bar.is-overflowing .chips-row {
            justify-content: flex-start; /* pack to left when overflow and show Más at the end */
        }
    }

    /* Make the category dropdown (desktop) a white rectangular card like the mega-panel */
    @media (min-width: 992px) {
        .menu-dropdown {
            background: #fff;
            border-radius: 10px;
            box-shadow: 0 12px 40px rgba(2,6,23,0.12);
            padding: 16px;
            z-index: 1400;
            max-height: 60vh;
            overflow: auto;
            min-width: 260px;
        }

        /* Layout the menu-list in columns for readability */
        .menu-dropdown .menu-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px 18px;
            align-items: start;
            margin: 0;
            padding: 0;
            list-style: none;
        }

        /* Category/menu links: make category titles pure black for contrast */
        .menu-dropdown .menu-item > .menu-link,
        .menu-dropdown .menu-item > a {
            display: block;
            font-weight: 700;
            color: #000000; /* categories in pure black as requested */
            text-decoration: none !important;
            padding: 6px 8px;
            border-radius: 6px;
        }

        /* Ensure any anchors inside the dropdown are not shown as underlined blue links */
        .menu-dropdown a {
            color: #0f172a;
            text-decoration: none !important;
        }

        .menu-dropdown .menu-item > .menu-link:hover { background: #f3f4f6; }

        .menu-dropdown .submenu {
            display: block;
            background: transparent;
            box-shadow: none;
            padding: 8px 0 0 0;
        }

        .menu-dropdown .submenu-list { list-style: none; padding: 0; margin: 0; }
        .menu-dropdown .submenu-list li a { display:block; padding:6px 8px; color:#334155; text-decoration:none; border-radius:6px; }
        .menu-dropdown .submenu-list li a:hover { background:#f3f4f6; }

        /* Ensure cloned dropdown uses same visual style */
        #categoryMenuDropdownClone { background: #fff; }
    }

    /* Specific card sizing for dropdowns that should match the mega-panel
       Use this when the dropdown markup has the `menu-dropdown-card` class. */
    @media (min-width: 992px) {
        .menu-dropdown.menu-dropdown-card {
            width: auto;
            max-width: 920px; /* contain the dropdown to a card width like the mega-panel */
            min-width: 300px;
            padding: 18px;
            box-shadow: 0 12px 40px rgba(2,6,23,0.12);
            border-radius: 10px;
            max-height: 60vh;
            overflow: auto;
            box-sizing: border-box;
        }

        .menu-dropdown.menu-dropdown-card .menu-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px 18px;
            margin: 0;
            padding: 0;
            list-style: none;
        }

        .menu-dropdown.menu-dropdown-card .menu-item > .menu-link,
        .menu-dropdown.menu-dropdown-card a {
            color: #0f172a;
            text-decoration: none !important;
        }
    }

    /* When the dropdown is opened and attached to the subheader we remove the
       top radii and slightly adjust the shadow so it reads as an extension */
    @media (min-width: 992px) {
        .menu-dropdown.menu-dropdown-card.attached-to-subheader {
            border-top-left-radius: 0 !important;
            border-top-right-radius: 0 !important;
            /* We position absolutely inside header-frame; top is computed in JS so
               avoid extra negative margin here. */
            margin-top: 0 !important;
            box-shadow: 0 10px 28px rgba(2,6,23,0.10);
        }

        /* Ensure the clone version inherits the same attached style */
        /* Clone should match the main dropdown attached styling; avoid negative margins that
           create visual offsets between subheader and dropdown. JS will compute precise
           positioning, so keep margins neutral. */
        #categoryMenuDropdownClone.attached-to-subheader {
            border-top-left-radius: 0 !important;
            border-top-right-radius: 0 !important;
            margin-top: 0 !important;
        }

        /* While a dropdown is attached to the subheader, remove the hairline/border
           and heavy shadow from the header container so the dropdown visually
           reads as a continuous extension (helps eliminate tiny visible gaps). */
        .header-frame.dropdown-open,
        .header-frame.dropdown-open .sticky-header-clone {
            box-shadow: none !important;
            border-bottom: none !important;
        }
    }

    /* Mega panel: a white rectangle under the subheader that shows grupos/subgrupos */
    @media (min-width: 992px) {
        .mega-panel {
            display: none;
            position: absolute;
            left: 0;
            top: calc(100% + 6px);
            width: 100%; /* will be inside .header-frame so aligns */
            z-index: 1400;
            box-sizing: border-box;
            padding: 0;
        }

        .mega-panel.open { display: block; animation: fadeIn 160ms ease; }

        .mega-panel .mega-inner {
            background: #fff;
            border-radius: 10px;
            box-shadow: 0 12px 40px rgba(2,6,23,0.12);
            padding: 10px 12px;
            max-height: 60vh;
            overflow: auto;
        }

        .mega-panel .mega-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 6px 9px;
            align-items: start;
        }

        .mega-panel .mega-group {
            min-width: 160px;
            /* Slight visual card inside the grid to separate groups */
            padding: 4px 3px;
            border-radius: 8px;
            transition: background 120ms ease, transform 100ms ease;
        }

        .mega-panel .mega-group .grupo-title {
            font-weight: 800;
            color: #000000; /* category titles in black for max contrast */
            margin-bottom: 8px;
            font-size: 1rem;
            text-transform: none;
            letter-spacing: -0.01em;
            /* a subtle underline to separate the title from the items */
            padding-bottom: 6px;
            border-bottom: 1px solid rgba(2,6,23,0.06);
        }

        /* Titles that are links (if any) should also be non-underlined */
        .mega-panel .mega-group .grupo-title a,
        .grupo-title-link {
            color: #0f172a;
            text-decoration: none !important;
        }

        .mega-panel .mega-group ul { list-style: none; margin: 0; padding: 4px 0 0 0; }
        .mega-panel .mega-group li a {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 4px 5px;
            color: #334155;
            text-decoration: none;
            border-radius: 6px;
            font-size: 0.92rem;
            transition: background .12s ease, transform .08s ease;
        }
        .mega-panel .mega-group li a:hover {
            background: linear-gradient(90deg, rgba(243,246,251,1), rgba(243,246,251,1));
            transform: translateX(4px);
        }

        /* Emphasize 'grupos' links: stronger weight and subtle accent bar */
        .mega-panel .mega-group li a.grupo-link {
            font-weight: 700;
            color: #0b2447; /* deep blue for highlighted groups */
            background: rgba(11,36,71,0.03);
            padding-left: 12px; /* give room for accent */
            border-left: 3px solid rgba(11,99,255,0.16); /* subtle accent */
        }
        /* Hide the small bullet for highlighted grupo links to avoid clutter */
        .mega-panel .mega-group li a.grupo-link::before { display: none; }

        /* small round bullet for subfilters/groups to increase scannability */
        .mega-panel .mega-group li a::before {
            content: '';
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: rgba(2,6,23,0.08);
            flex: 0 0 auto;
            margin-left: 2px;
        }

        /* style clickable group titles when they were cloned as links */
        .mega-panel .grupo-title a,
        .mega-panel .grupo-title .grupo-title-link {
            color: #062244;
            text-decoration: none !important;
            display: inline-block;
            padding: 2px 4px;
        }

        /* subtle hover state for the entire group card */
        .mega-panel .mega-group:hover { background: rgba(243,246,251,0.3); }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-6px); }
            to { opacity: 1; transform: translateY(0); }
        }
    }

/* ------------------------------------------------------------------
   FORCE CONTRAST for category titles in dropdowns and mega-panel
   Some global/theme rules set link text to white; ensure all category
   titles inside the category dropdowns and the mega-panel are black.
   This uses high specificity and !important to reliably override
   competing rules without changing markup.
------------------------------------------------------------------- */
@media (min-width: 992px) {
    /* Target the known dropdown elements and clones */
    #categoryMenuDropdown .menu-item > .menu-link,
    #categoryMenuDropdown .menu-item > a,
    #categoryMenuDropdownClone .menu-item > .menu-link,
    #categoryMenuDropdownClone .menu-item > a,
    .menu-dropdown.menu-dropdown-card .menu-item > .menu-link,
    .menu-dropdown.menu-dropdown-card .menu-item > a,
    .menu-dropdown .menu-item > .menu-link,
    .menu-dropdown .menu-item > a,
    /* Mega panel group titles */
    .mega-panel .mega-group .grupo-title,
    .mega-panel .mega-group .grupo-title a {
        color: #000000 !important;
    }

    /* Make sure any generic anchors inside these dropdowns are visible */
    #categoryMenuDropdown a,
    #categoryMenuDropdownClone a,
    .menu-dropdown.menu-dropdown-card a,
    .mega-panel a {
        color: #0f172a !important;
        text-decoration: none !important;
    }
}
