/* ===== NutFill Mega Menu ===== */

/* Hide ALL Astra default sub-menu elements for mega triggers */
.nutfill-mega-trigger > .ast-menu-toggle,
.nutfill-mega-trigger > .sub-menu,
.nutfill-mega-trigger .children,
.nutfill-mega-trigger .ast-header-navigation-arrow,
.nutfill-mega-trigger .dropdown-menu-toggle {
    display: none !important;
}

/* Down arrow on mega trigger menu links */
.nutfill-mega-trigger .menu-link {
    display: flex !important;
    align-items: center;
    gap: 4px;
}

.nutfill-mega-arrow {
    display: inline-block;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nutfill-mega-trigger:hover .nutfill-mega-arrow,
.nutfill-mega-trigger.current-menu-ancestor .nutfill-mega-arrow,
.nutfill-mega-trigger.current-menu-parent .nutfill-mega-arrow {
    transform: rotate(180deg);
}

/* Active top-level menu item */
.nutfill-mega-trigger.current-menu-ancestor > .menu-link,
.nutfill-mega-trigger.current-menu-parent > .menu-link {
    color: #16a34a !important;
}

/* Reset Astra sub-menu toggle behaviors */
.nutfill-mega-trigger.ast-submenu-expanded > .sub-menu {
    display: none !important;
}

/* ===== Mega panel base — fixed positioning at body level ===== */
.nutfill-mega-panel {
    position: fixed !important;
    background: #ffffff !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    border-radius: 0 0 12px 12px !important;
    border: 1px solid #e2e8f0 !important;
    z-index: 999999 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

/* Reset Astra menu link styles inside mega panel */
.nutfill-mega-panel a {
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* ===== Sell Panel: 7-column grid ===== */
.nutfill-sell-panel {
    padding: 28px 32px;
    width: fit-content;
    max-width: 90vw;
}

.nutfill-sell-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 20px;
}

.nutfill-sell-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 12px 8px;
    border-radius: 12px;
    transition: background 0.15s ease;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

.nutfill-sell-item:hover {
    background: #f0fdf4;
}

.nutfill-sell-item:hover .nutfill-sell-label {
    color: #16a34a;
}

.nutfill-sell-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #dcfce7;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.nutfill-sell-item:hover .nutfill-sell-icon {
    background: #bbf7d0;
    transform: scale(1.08);
}

.nutfill-sell-icon svg {
    width: 26px;
    height: 26px;
    color: #16a34a;
}

.nutfill-sell-label {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    line-height: 1.3;
    white-space: nowrap;
}

.nutfill-sell-item.is-active,
.nutfill-sell-item.is-active:hover {
    background: #dcfce7 !important;
}

.nutfill-sell-item.is-active .nutfill-sell-icon,
.nutfill-sell-item.is-active:hover .nutfill-sell-icon {
    background: #bbf7d0 !important;
}

.nutfill-sell-item.is-active .nutfill-sell-label,
.nutfill-sell-item.is-active:hover .nutfill-sell-label {
    color: #16a34a !important;
}

/* ===== Resources Panel: 3-column mega menu ===== */
.nutfill-resources-panel {
    padding: 28px 32px;
    width: fit-content;
    max-width: 90vw;
}

.nutfill-res-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.nutfill-res-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

.nutfill-res-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #22c55e;
    display: inline-block;
    width: fit-content;
}

.nutfill-res-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
    padding: 10px 8px;
    border-radius: 10px;
    transition: background 0.15s ease;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

.nutfill-res-item:hover {
    background: #f8fafc;
}

.nutfill-res-item:hover .nutfill-res-desc {
    color: #6b7280;
}

.nutfill-res-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #dcfce7;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.nutfill-res-item:hover .nutfill-res-icon {
    background: #bbf7d0;
}

.nutfill-res-icon svg {
    width: 20px;
    height: 20px;
    color: #16a34a;
}

.nutfill-res-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nutfill-res-label {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    white-space: nowrap;
}

.nutfill-res-item:hover .nutfill-res-label {
    color: #16a34a;
}

.nutfill-res-item.is-active,
.nutfill-res-item.is-active:hover {
    background: #dcfce7 !important;
}

.nutfill-res-item.is-active .nutfill-res-icon,
.nutfill-res-item.is-active:hover .nutfill-res-icon {
    background: #bbf7d0 !important;
}

.nutfill-res-item.is-active .nutfill-res-label,
.nutfill-res-item.is-active:hover .nutfill-res-label {
    color: #16a34a !important;
}

.nutfill-res-item.is-active .nutfill-res-desc,
.nutfill-res-item.is-active:hover .nutfill-res-desc {
    color: #16a34a !important;
}

.nutfill-res-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    white-space: nowrap;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .nutfill-sell-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
    .nutfill-sell-panel {
        padding: 28px 32px;
    }
}

@media (max-width: 768px) {
    .nutfill-mega-panel {
        position: static !important;
        box-shadow: none;
        border-top: none;
        padding: 0 !important;
    }

    .nutfill-sell-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .nutfill-res-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .nutfill-res-label,
    .nutfill-res-desc {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .nutfill-sell-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
