/**
 * LojaVirtual - Mega Menu Stylesheet
 * Classes alinhadas com views/partials/mega-menu.php
 */

/* ============================================================
   MEGA MENU NAV BAR
   ============================================================ */
.mega-menu-nav {
    background: #fff;
    border-bottom: 1px solid #e3e6f0;
    position: relative;
    z-index: 900;
}

.mega-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
}

/* ============================================================
   CATEGORIES BUTTON + DROPDOWN
   ============================================================ */
.mega-menu-categories-btn {
    position: relative;
    flex-shrink: 0;
}

.categories-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--primary, #4e73df);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
.categories-toggle:hover { background: var(--primary-dark, #3a5bc7); }
.categories-toggle i { font-size: 16px; }
.toggle-arrow { font-size: 10px !important; transition: transform .2s; }
.mega-menu-categories-btn.open .toggle-arrow { transform: rotate(180deg); }

/* Dropdown Container */
.mega-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 800px;
    max-width: 90vw;
    background: #fff;
    border: 1px solid #e3e6f0;
    border-top: 3px solid var(--primary, #4e73df);
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    z-index: 1000;
    display: none;
    border-radius: 0 0 12px 12px;
}
.mega-menu-dropdown.show { display: block; }

.mega-menu-container {
    display: flex;
    min-height: 400px;
}

/* Categories List (Left Column) */
.mega-menu-categories-list {
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid #f0f0f5;
    padding: 8px 0;
    background: #fafbfc;
    overflow-y: auto;
    max-height: 500px;
}

.mega-category-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    transition: all .15s ease;
    border-left: 3px solid transparent;
}
.mega-category-item a:hover,
.mega-category-item.active a {
    background: #fff;
    color: var(--primary, #4e73df);
    border-left-color: var(--primary, #4e73df);
}
.mega-category-item a i { font-size: 16px; width: 20px; text-align: center; }
.mega-category-item a span { flex: 1; }
.mega-category-item a .arrow { font-size: 10px; opacity: .4; margin-left: auto; }

/* Content Panels (Right Column) */
.mega-menu-content {
    flex: 1;
    padding: 20px 24px;
    position: relative;
    overflow-y: auto;
    max-height: 500px;
}

.mega-content-panel { display: none; }
.mega-content-panel.active { display: block; }

.mega-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary, #4e73df);
}
.mega-panel-header h3 { font-size: 16px; font-weight: 700; color: #2d2d2d; margin: 0; }
.see-all-link { font-size: 12px; font-weight: 600; color: var(--primary, #4e73df); display: flex; align-items: center; gap: 4px; }
.see-all-link:hover { text-decoration: underline; }

/* Subcategories Grid */
.mega-subcategories { display: flex; gap: 24px; }
.mega-subcat-column { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.mega-subcat-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 13px;
    color: #555;
    border-radius: 6px;
    transition: all .15s ease;
    text-decoration: none;
}
.mega-subcat-link:hover { background: #f0f2ff; color: var(--primary, #4e73df); padding-left: 14px; }
.mega-subcat-link .product-count { margin-left: auto; font-size: 10px; color: #bbb; background: #f5f5f5; padding: 1px 6px; border-radius: 10px; }

/* Promo Banner */
.mega-promo-banner { margin-top: 16px; border-radius: 10px; overflow: hidden; }
.mega-promo-banner img { width: 100%; max-height: 150px; object-fit: cover; border-radius: 10px; transition: transform .3s; }
.mega-promo-banner:hover img { transform: scale(1.03); }

/* ============================================================
   MAIN NAV LINKS (Horizontal)
   ============================================================ */
.mega-menu-main-nav {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.mega-menu-main-nav::-webkit-scrollbar { display: none; }

.nav-link-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #2d2d2d;
    white-space: nowrap;
    transition: all .2s ease;
    border-bottom: 3px solid transparent;
    text-decoration: none;
}
.nav-link-item:hover,
.nav-link-item.active { color: var(--primary, #4e73df); border-bottom-color: var(--primary, #4e73df); background: #f8f9fc; }
.nav-link-item i { font-size: 14px; }

.nav-highlight { color: var(--danger, #e74a3b); }
.nav-highlight:hover { color: var(--danger, #e74a3b); border-bottom-color: var(--danger, #e74a3b); }

.nav-badge { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; background: var(--danger, #e74a3b); color: #fff; }
.nav-badge.pulse { animation: navBadgePulse 1.5s infinite; }
@keyframes navBadgePulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ============================================================
   INFO (Frete Grátis)
   ============================================================ */
.mega-menu-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success, #1cc88a);
    white-space: nowrap;
    margin-left: auto;
}
.mega-menu-info i { font-size: 16px; }

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 991.98px) {
    .mega-menu-nav { display: none; }

    .mobile-menu-body .mega-menu-categories-btn { width: 100%; }
    .mobile-menu-body .categories-toggle { width: 100%; background: var(--light, #f8f9fc); color: var(--dark, #2d2d2d); justify-content: space-between; }
    .mobile-menu-body .mega-menu-dropdown { position: static; width: 100%; max-width: 100%; box-shadow: none; border: none; border-top: 1px solid #eee; background: #fafbfc; }
    .mobile-menu-body .mega-menu-container { flex-direction: column; min-height: auto; }
    .mobile-menu-body .mega-menu-categories-list { width: 100%; border-right: none; border-bottom: 1px solid #eee; max-height: 250px; }
    .mobile-menu-body .mega-menu-content { padding: 12px; }
    .mobile-menu-body .mega-subcategories { flex-direction: column; gap: 4px; }
    .mobile-menu-body .mega-promo-banner { display: none; }
}
