/* =============================================================
   mega-menu.css — GreenPress
   1. Mobile menu open / close states  ← was missing, causing bug
   2. Mega-menu category switcher
   3. Simple dropdown (non-mega items with children)
   4. Mobile shop panel + product scroll strips
   ============================================================= */


/* ── 1. MOBILE MENU OPEN / CLOSE ────────────────────────────────
   The JS adds / removes .is-open on .mobile-menu and #shopPanel.
   Without these rules the menu was there in the DOM but invisible.
   ─────────────────────────────────────────────────────────────── */

/* Lock body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}


/* Slide in when open */
.mobile-menu.is-open {
    transform: translateX(0);
}

/* Slide shop panel in from the right */
.mobile-shop-panel.is-open {
    transform: translateX(0);
}


/* ── 2. MEGA-MENU CATEGORY SWITCHER ─────────────────────────────
   All product grids hidden by default; only .is-active is shown.
   ─────────────────────────────────────────────────────────────── */

.mega-products .products-grid {
    display: none;
    /*grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    animation: gp-fade-in 0.15s ease;*/
}

.mega-products .products-grid.is-active {
    display: grid;
}

/* Category link states */
/*.mega-categories .category-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px 9px 16px;
    border-radius: 8px;
    color: var(--foreground, #1a1a1a);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    cursor: pointer;
    position: relative;
}
.mega-categories .category-link:hover,
.mega-categories .category-link.is-active {
    background: var(--primary-light, #f0faf4);
    color: var(--primary, #2d8a4e);
}
.mega-categories .category-link.is-active {
    font-weight: 600;
}
.mega-categories .category-link.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--primary, #2d8a4e);
    border-radius: 0 2px 2px 0;
}*/

/* "View all →" sits below the 4 cards */
.mega-view-all {
    grid-column: 1 / -1;
    display: inline-block;
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary, #2d8a4e);
    text-decoration: none;
}
.mega-view-all:hover { text-decoration: underline; }

/* Empty state */
.mega-empty {
    grid-column: 1 / -1;
    color: var(--muted, #888);
    font-size: 0.875rem;
    padding: 12px 0;
}

@keyframes gp-fade-in {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ── 3. SIMPLE DROPDOWN ─────────────────────────────────────────
   Pure CSS :hover — no JS needed.
   Applies to .nav-item that has a .simple-dropdown child but
   does NOT have a .mega-menu child.
   ─────────────────────────────────────────────────────────────── */


.nav-item { position: relative; }
.nav-item.mega-item { position: static; }

.nav-item .simple-dropdown {
    list-style: none;
    margin: 0;
    padding: 6px 0;

    /* Hidden until hovered */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;

    background: var(--surface, #fff);
    border: 1px solid var(--border, #e8e8e8);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);

    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
    z-index: 500;
}

/* Caret / arrow tip */
.nav-item .simple-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 18px;
    width: 10px;
    height: 10px;
    background: var(--surface, #fff);
    border-top: 1px solid var(--border, #e8e8e8);
    border-left: 1px solid var(--border, #e8e8e8);
    transform: rotate(45deg);
}

.nav-item:hover .simple-dropdown,
.nav-item:focus-within .simple-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}

.nav-item .simple-dropdown li + li {
    border-top: 1px solid var(--border, #f0f0f0);
}

.nav-item .simple-dropdown li a {
    display: block;
    padding: 9px 18px;
    font-size: 0.875rem;
    color: var(--foreground, #1a1a1a);
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
}

.nav-item .simple-dropdown li a:hover {
    background: var(--primary-light, #f0faf4);
    color: var(--primary, #2d8a4e);
}
.mobile-product-card {
    display: inline-block;
    overflow: hidden;
}
.product-meta .product-price {
    font-size: 14px;
    color: var(--primary);
    font-weight: 700;
}
.submenu-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.submenu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--foreground);
    text-decoration: none;
    background: var(--background);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.2s;
}
.submenu-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}