/* ==========================================================================
   Mega-Menu & Auxiliary Navigation Bar (Front-End)
   100% Responsive & Protected for Google AdSense Side Rails (Zero Overflow)
   ========================================================================== */

/* Keep main header & live search dropdown above the auxiliary navbar */
.site-header-bar {
    z-index: 105 !important;
}

/* --- 1. Auxiliary Horizontal Bar (Navbar) --- */
.mm-navbar {
    position: relative;
    z-index: 95;
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    user-select: none;
}

.mm-navbar--royal_gradient {
    background: linear-gradient(90deg, #ef2809 0%, #b51b58 22%, #59257a 52%, #005eb8 100%);
    color: #ffffff;
}

.mm-navbar--classic_blue {
    background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 60%, #0284c7 100%);
    color: #ffffff;
}

.mm-navbar--dark_slate {
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
}

.mm-navbar--clean_white {
    background: #ffffff;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
}

.mm-navbar__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 44px;
}

/* Trigger Button ("☰ Produse") aligned with 270px left column on desktop */
.mm-navbar__trigger-wrap {
    width: 270px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.mm-navbar__trigger {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    background: #ffffff;
    color: #0f172a;
    border: none;
    border-radius: 6px 6px 0 0;
    padding: 0.6rem 1.1rem;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    transition: background 0.15s ease, color 0.15s ease;
    margin-top: 4px;
    text-align: left;
}

.mm-navbar--clean_white .mm-navbar__trigger {
    background: #2563eb;
    color: #ffffff;
    border-radius: 6px;
    margin-top: 0;
}

.mm-navbar__trigger-left {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.mm-navbar__trigger svg {
    flex-shrink: 0;
}

.mm-navbar__trigger-chevron {
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.mm-navbar__trigger.is-open .mm-navbar__trigger-chevron,
.mm-navbar__trigger:hover .mm-navbar__trigger-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Horizontal Quick Links on the Navbar */
.mm-navbar__links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.mm-navbar__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 600;
    transition: background 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.mm-navbar--clean_white .mm-navbar__link {
    color: #1e293b;
}

.mm-navbar__link:hover {
    background: rgba(255, 255, 255, 0.16);
}

.mm-navbar--clean_white .mm-navbar__link:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.mm-navbar__link--highlight {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.32);
}

.mm-navbar--clean_white .mm-navbar__link--highlight {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.mm-navbar__badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.1rem 0.42rem;
    border-radius: 999px;
    background: #facc15;
    color: #0f172a;
    line-height: 1.2;
}

/* --- 2. Homepage Hero Grid & Left Vertical Department List --- */
.electro-hero-wrapper.mm-hero-wrapper {
    margin-top: 0;
    margin-bottom: 1.75rem;
}

.electro-hero-grid.mm-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

/* Left Vertical Department Card (Level 1) */
.mm-dept-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 65;
    min-height: 420px;
}

.mm-dept-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    flex: 1;
    max-height: 440px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.mm-dept-list::-webkit-scrollbar {
    width: 4px;
}

.mm-dept-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.mm-dept-item {
    margin: 0;
    padding: 0;
}

.mm-dept-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.52rem 0.9rem;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 500;
    line-height: 1.3;
    border-left: 3px solid transparent;
    transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}

.mm-dept-item.is-hovered > .mm-dept-link,
.mm-dept-link:hover {
    background: #eff6ff;
    color: #005eb8;
    font-weight: 600;
    border-left-color: #005eb8;
}

.mm-dept-link__left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}

.mm-dept-link__icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
    transition: color 0.1s ease, transform 0.15s ease;
}

.mm-dept-link__icon svg {
    width: 19px;
    height: 19px;
}

.mm-dept-item.is-hovered > .mm-dept-link .mm-dept-link__icon,
.mm-dept-link:hover .mm-dept-link__icon {
    color: #005eb8;
    transform: scale(1.06);
}

.mm-dept-link__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mm-dept-link__badge {
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.08rem 0.38rem;
    border-radius: 4px;
    background: #fee2e2;
    color: #dc2626;
    flex-shrink: 0;
}

.mm-dept-link__arrow {
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.1s ease, transform 0.15s ease;
}

.mm-dept-item.is-hovered > .mm-dept-link .mm-dept-link__arrow,
.mm-dept-link:hover .mm-dept-link__arrow {
    color: #005eb8;
    transform: translateX(2px);
}

/* --- 3. Mega-Menu Flyout Stage & Panels (Level 2 & Level 3) --- */
.mm-flyout-stage {
    position: absolute;
    top: 0;
    left: 270px;
    width: calc(100% - 270px);
    min-height: 100%;
    z-index: 64;
    pointer-events: none;
}

.mm-flyout-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 420px;
    max-height: 540px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-left: 1px solid #e2e8f0;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
    padding: 1.35rem 1.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(4px);
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
    box-sizing: border-box;
}

.mm-flyout-panel.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

/* Top header inside the Flyout Panel */
.mm-flyout-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.mm-flyout-panel__title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    color: #0f172a;
}

.mm-flyout-panel__title a {
    color: inherit;
    text-decoration: none;
}

.mm-flyout-panel__title a:hover {
    color: #005eb8;
}

.mm-flyout-panel__all-link {
    font-size: 0.82rem;
    font-weight: 700;
    color: #005eb8;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    background: #eff6ff;
    transition: background 0.15s ease;
}

.mm-flyout-panel__all-link:hover {
    background: #dbeafe;
}

/* Multi-Column Masonry / Grid for Level 2 & Level 3 */
.mm-flyout-columns {
    column-gap: 1.5rem;
    width: 100%;
}

.mm-flyout-columns--cols-2 {
    column-count: 2;
}

.mm-flyout-columns--cols-3 {
    column-count: 3;
}

.mm-flyout-columns--cols-4 {
    column-count: 4;
}

@media (max-width: 1280px) {
    .mm-flyout-columns--cols-4 {
        column-count: 3;
    }
}

.mm-subcat-group {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 1.25rem;
    display: inline-block;
    width: 100%;
}

.mm-subcat-group__title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    margin-bottom: 0.35rem;
    line-height: 1.3;
    transition: color 0.12s ease;
}

.mm-subcat-group__title:hover {
    color: #005eb8;
    text-decoration: underline;
}

.mm-subcat-group__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

.mm-subcat-group__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.83rem;
    color: #475569;
    text-decoration: none;
    line-height: 1.35;
    padding: 0.1rem 0;
    transition: color 0.12s ease, transform 0.12s ease;
}

.mm-subcat-group__link:hover {
    color: #005eb8;
    text-decoration: underline;
}

.mm-item-badge {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.06rem 0.35rem;
    border-radius: 4px;
    background: #dbeafe;
    color: #1d4ed8;
}

/* --- 4. Floating Mega-Menu on Internal Pages (Product, Category, Blog, Contact) --- */
.mm-floating-dropdown {
    position: absolute;
    top: 100%;
    left: var(--site-gutter, 1.25rem);
    right: var(--site-gutter, 1.25rem);
    z-index: 98;
    display: none;
    pointer-events: none;
}

.mm-floating-dropdown.is-open {
    display: block;
    pointer-events: auto;
}

.mm-floating-dropdown__grid {
    position: relative;
    width: 100%;
    min-height: 420px;
}

.mm-floating-dropdown .mm-dept-card {
    width: 270px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}

/* --- 5. Responsive Behavior (< 992px Tablet & Mobile) --- */
@media (max-width: 991px) {
    .mm-navbar__trigger-wrap {
        width: auto;
    }

    .mm-navbar__trigger {
        border-radius: 6px;
        margin-top: 0;
        padding: 0.45rem 0.85rem;
        font-size: 0.86rem;
    }

    .mm-navbar__links {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .mm-navbar__links::-webkit-scrollbar {
        display: none;
    }

    .electro-hero-grid.mm-hero-grid {
        grid-template-columns: 1fr;
    }

    /* On mobile/tablet, the permanent desktop left column & hover flyout hide;
       clicking the trigger button opens the full mobile category drawer */
    .electro-hero-grid.mm-hero-grid > .mm-dept-card,
    .electro-hero-grid.mm-hero-grid > .mm-flyout-stage,
    .mm-floating-dropdown {
        display: none !important;
    }
}

