/* ── AGO Mega Menu — Front-end Styles ── */
/* Designed for BeTheme (Muffin Group) header structure */

:root {
    --ago-ink:    #0d1a0b;
    --ago-turf:   #2f6120;
    --ago-grass:  #4d9132;
    --ago-blade:  #74bb52;
    --ago-lawn:   #e4f4d8;
    --ago-mist:   #b8dba0;
    --ago-cream:  #f7f4ee;
    --ago-soil:   #b8894a;
    --ago-sand:   #e8cc8a;
    --ago-border: #e0e4d8;
}

/* ── Panel container ── */
.ago-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    background: #ffffff;
    border-top: 3px solid var(--ago-turf);
    border-bottom: 1px solid var(--ago-border);
    box-shadow: 0 8px 32px rgba(13, 26, 11, 0.12);
    border-radius: 0 0 12px 12px;
    padding: 32px 40px;
    z-index: 9999;
    display: none;
    box-sizing: border-box;
}

/* Open via JS class on parent <li> */
.ago-has-mega-menu.is-open > .ago-mega-menu {
    display: block;
}

/*
 * Full-viewport-width mega menu panel.
 * Uses fixed positioning relative to the viewport so it breaks out of
 * all parent containers (BeTheme's #Top_bar, .container, etc.).
 * JS sets the `top` value dynamically based on the nav item position.
 */
.ago-has-mega-menu {
    position: static !important;
}

.ago-mega-menu {
    position: fixed;
    left: 0;
    width: 100vw;
    border-radius: 0 0 0 0;
}

/* Constrain inner content to a readable max-width */
.ago-mega-menu__inner {
    display: flex;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Columns grid ── */
.ago-mega-menu__columns {
    display: flex;
    gap: 40px;
    flex-wrap: nowrap;
    flex: 1;
    min-width: 0;
}

.ago-mega-menu__col {
    flex: 1;
    min-width: 120px;
}

/* ── Column heading ── */
.ago-mega-menu__col-heading {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ago-turf);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ago-border);
    white-space: nowrap;
}

/* ── Links ── */
.ago-mega-menu__links {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    position: static !important;
    display: block !important;
    width: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.ago-mega-menu__links li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    border: none !important;
    background: none !important;
    width: auto !important;
    float: none !important;
}

.ago-mega-menu__link {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: var(--ago-ink) !important;
    padding: 6px 0 !important;
    text-decoration: none !important;
    transition: color 150ms ease;
    line-height: 1.3 !important;
    background: none !important;
    border: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.ago-mega-menu__link:hover {
    color: var(--ago-turf) !important;
    background: none !important;
}

/* ── Badges ── */
.ago-mega-menu__badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
}

.ago-mega-menu__badge--green {
    background: var(--ago-lawn);
    color: var(--ago-turf);
}

.ago-mega-menu__badge--dark {
    background: var(--ago-ink);
    color: var(--ago-blade);
}

.ago-mega-menu__badge--amber {
    background: var(--ago-sand);
    color: #7a5c2e;
}

/* ── Menu image ── */
.ago-mega-menu__image {
    min-width: 220px;
    max-width: 280px;
    flex-shrink: 0;
    align-self: stretch;
    border-radius: 10px;
    overflow: hidden;
}

.ago-mega-menu__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
    transition: opacity 200ms ease;
}

/* Highlight the hovered link */
.ago-mega-menu__link[data-mega-image]:hover {
    color: var(--ago-turf) !important;
}

/*
 * ── Override BeTheme sub-menu styles ──
 * BeTheme aggressively styles #Top_bar .menu li ul — we need to
 * reset those on our mega menu panels.
 */
#Top_bar .menu > li > .ago-mega-menu,
#Top_bar .menu li .ago-mega-menu {
    position: fixed !important;
    left: 0 !important;
    width: 100vw !important;
    background: #ffffff !important;
    border: none !important;
    border-top: 3px solid var(--ago-turf) !important;
    border-bottom: 1px solid var(--ago-border) !important;
    box-shadow: 0 8px 32px rgba(13, 26, 11, 0.12) !important;
    padding: 32px 40px !important;
    max-width: none !important;
    min-width: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* Prevent BeTheme from hiding the panel on hover of other items */
#Top_bar .menu > li.ago-has-mega-menu:hover > ul.sub-menu {
    display: none !important;
}

/* ══════════════════════════════════════
   Sidebar Layout (WVH style)
   ══════════════════════════════════════ */

.ago-mega-menu--sidebar .ago-mega-menu__inner {
    gap: 0;
}

/* Sidebar nav */
.ago-mega-sidebar__nav {
    width: 260px;
    flex-shrink: 0;
    border-right: 1px solid var(--ago-border);
    padding-right: 0;
    display: flex;
    flex-direction: column;
}

.ago-mega-sidebar__link {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--ago-ink) !important;
    text-decoration: none !important;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s, color 0.15s;
    background: none !important;
    border-left: 3px solid transparent;
}

.ago-mega-sidebar__link:hover,
.ago-mega-sidebar__link.is-active {
    background: #f8f8f6 !important;
    color: var(--ago-turf) !important;
    border-left-color: var(--ago-turf);
}

.ago-mega-sidebar__link:last-child {
    border-bottom: none;
}

.ago-mega-sidebar__arrow {
    margin-left: auto;
    opacity: 0.3;
    flex-shrink: 0;
}

.ago-mega-sidebar__link.is-active .ago-mega-sidebar__arrow,
.ago-mega-sidebar__link:hover .ago-mega-sidebar__arrow {
    opacity: 0.7;
}

/* Content area (product grids) */
.ago-mega-sidebar__content {
    flex: 1;
    min-width: 0;
    padding: 0 0 0 32px;
}

.ago-mega-sidebar__panel {
    display: none;
}

.ago-mega-sidebar__panel.is-active {
    display: block;
}

.ago-mega-sidebar__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.ago-mega-sidebar__product {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    color: var(--ago-ink);
    transition: opacity 0.15s;
}

.ago-mega-sidebar__product:hover {
    opacity: 0.8;
}

.ago-mega-sidebar__product img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.ago-mega-sidebar__product-name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
}

.ago-mega-sidebar__view-all {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ago-turf);
    border: 1px solid var(--ago-turf);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.ago-mega-sidebar__view-all:hover {
    background: var(--ago-turf);
    color: #fff;
}

.ago-mega-sidebar__empty {
    color: #999;
    font-size: 14px;
    padding: 40px 0;
    text-align: center;
}

/* ══════════════════════════════════════
   Cards Layout (4-column image grid)
   ══════════════════════════════════════ */

.ago-mega-menu--cards .ago-mega-menu__inner {
    display: block;
}

.ago-mega-cards__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.ago-mega-cards__card {
    position: relative;
    display: block;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    text-decoration: none !important;
    color: #fff !important;
    background: var(--ago-ink);
}

.ago-mega-cards__card:hover {
    color: #fff !important;
}

.ago-mega-cards__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ago-mega-cards__card:hover .ago-mega-cards__img {
    transform: scale(1.05);
    opacity: 0.85;
}

.ago-mega-cards__label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 18px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ── Mobile: hide completely ── */
@media (max-width: 1023px) {
    .ago-mega-desktop-only,
    .ago-mega-menu {
        display: none !important;
    }
}
