/* ------------------------------------------------------------------
   Mega-menu redesign + header icon fixes (2026-07-15 rev.2)
   Keep the previously-correct flex layout. Only add:
   - width overrides that beat legacy .sm-menu-parent-about (240px)
     and .sm-menu-parent-results (270px) caps in App.css
   - right-alignment for Results panel
   - no text truncation on headings
------------------------------------------------------------------ */

/* ============ HEADER ICON SIZING ============ */
.cart-header-design > a > img {
    width: 22px !important;
    height: 22px !important;
    object-fit: contain;
}
.cart-header-design .login-btn-user svg {
    width: 24px !important;
    height: 24px !important;
    color: #fff;
}
.cart-header-design .cart-header p.quantity {
    font-size: 11px !important;
    line-height: 1 !important;
    min-width: 16px;
    height: 16px;
    padding: 2px 4px !important;
}

/* ============ MEGA-MENU PANEL ============
   Higher-specificity + !important to override legacy width/height caps. */
li.nav-item.dropdown .dropdown-menu.mega-menu-panel {
    display: block !important;
    height: auto !important;
    max-width: min(96vw, 1180px) !important;
    padding: 22px 26px !important;
    border-top: 3px solid #f5a623 !important;
    box-shadow: 0 18px 44px rgba(20, 30, 60, .22) !important;
    border-radius: 0 0 8px 8px !important;
    background: #fff !important;
    box-sizing: border-box !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    z-index: 1000;
}

/* Explicit panel widths per group count. */
.mega-menu-panel.mega-groups-2 { width: 560px !important; }
.mega-menu-panel.mega-groups-3 { width: 780px !important; }
.mega-menu-panel.mega-groups-4 { width: 940px !important; }

/* Results panel is on the right side of nav — anchor to the right edge
   of its nav-item so the wider panel doesn't overflow the viewport. */
.dropdown-parent-results .dropdown-menu.mega-menu-panel,
.dropdown-parent-success-stories .dropdown-menu.mega-menu-panel {
    left: auto !important;
    right: 0 !important;
}

/* Hide any legacy decorative <img> the CMS attached to menu items. */
.mega-menu-panel img,
.mega-menu-panel .mega-col-head img,
.mega-menu-panel .mega-link img,
.mega-menu-panel .mega-leaf-link img {
    display: none !important;
}

/* ============ COLUMN LAYOUT (flex) ============ */
.mega-menu-panel .mega-row {
    display: flex !important;
    flex-wrap: wrap;
    margin: 0 -8px !important;
    padding: 0 !important;
    width: 100%;
    box-sizing: border-box;
}
.mega-menu-panel .mega-row > .mega-group,
.mega-menu-panel .mega-row > .mega-leaf {
    padding: 0 12px !important;
    box-sizing: border-box;
    margin-bottom: 8px;
}
.mega-groups-2 .mega-row > .mega-group { flex: 0 0 50%; max-width: 50%; }
.mega-groups-3 .mega-row > .mega-group { flex: 0 0 33.333%; max-width: 33.333%; }
.mega-groups-4 .mega-row > .mega-group { flex: 0 0 25%; max-width: 25%; }
.mega-menu-panel .mega-row > .mega-leaf {
    flex: 0 0 100%;
    max-width: 100%;
}

.mega-leaf-link {
    display: block;
    padding: 10px 12px;
    color: #1f2c50 !important;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    border-radius: 6px;
}
.mega-leaf-link:hover {
    background: #fff6e8;
    color: #1f2c50 !important;
    text-decoration: none !important;
}

/* Column heading — normal wrapping (no truncation). */
.mega-menu-panel p.mega-col-head,
.mega-menu-panel .mega-col-head {
    font-size: 11px !important;
    letter-spacing: 1.3px !important;
    text-transform: uppercase !important;
    color: #f5a623 !important;
    font-weight: 700 !important;
    padding: 2px 10px 9px !important;
    border-bottom: 1px solid #ececec !important;
    margin: 0 0 8px !important;
    line-height: 1.3 !important;
    white-space: normal;
}

.mega-menu-panel .mega-links {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
}
.mega-menu-panel .mega-links li {
    display: block;
    margin: 0;
    padding: 0 !important;
    border: none !important;
}
.mega-menu-panel .mega-link {
    display: block !important;
    padding: 7px 10px !important;
    border-radius: 6px !important;
    line-height: 1.3 !important;
    color: #2b2b2b !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    white-space: normal !important;
    transition: background .14s, color .14s;
}
.mega-menu-panel .mega-link:hover {
    background: #fff6e8 !important;
    color: #1f2c50 !important;
    font-weight: 500 !important;
    text-decoration: none !important;
}

/* Full-width promoted CTA button (e.g. "Shop All Products"). */
.mega-menu-panel .mega-cta-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 12px !important;
    padding: 11px 14px !important;
    background: #f5a623 !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    border-radius: 7px !important;
    width: 100%;
    box-sizing: border-box;
}
.mega-menu-panel .mega-cta-button:hover {
    background: #e0951a !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* Position panel relative to its nav item so left/right anchoring works. */
li.nav-item.dropdown { position: relative; }

/* Keep social icons/floating decorations behind the mega-menu panel. */
ul.socialicons {
    z-index: 5 !important;
}

/* ============ MOBILE ============ */
.mobile-mega-cta {
    display: block;
    margin: 14px 20px;
    padding: 12px;
    background: #f5a623;
    color: #fff !important;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 14.5px;
}
.mobile-mega-cta:hover,
.mobile-mega-cta:active {
    background: #e0951a;
    color: #fff !important;
}
.mobile-mega-group-head {
    color: #f5a623 !important;
    font-size: 11px !important;
    letter-spacing: 1.2px !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
}

/* Below 992px — stack columns. */
@media (max-width: 991px) {
    li.nav-item.dropdown .dropdown-menu.mega-menu-panel,
    .mega-menu-panel.mega-groups-2,
    .mega-menu-panel.mega-groups-3,
    .mega-menu-panel.mega-groups-4 {
        width: 100% !important;
        max-width: 100% !important;
    }
    .mega-groups-2 .mega-row > .mega-group,
    .mega-groups-3 .mega-row > .mega-group,
    .mega-groups-4 .mega-row > .mega-group {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
