/* ==========================================================================
   Modern Mega Dropdown (Premium Visual Excellence - FINAL GLOSS)
   ========================================================================== */

/* ─── Dropdown Parent ───────────────────────────────────────── */
header.main-header .navigation li.modern-dropdown-multi {
    position: relative;
}

/* Forçando a seta nativa a aparecer */
header.main-header .navigation li.modern-dropdown-multi > .dropdown-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 5;
    opacity: 0.45;
    font-size: 14px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

header.main-header .navigation li.modern-dropdown-multi.open > .dropdown-btn {
    transform: translateY(-50%) rotate(180deg);
    opacity: 0.9;
    color: var(--primary-color);
}

/* Fix do posicionamento da seta no mobile ao expandir o accordion */
@media only screen and (max-width: 991px) {
    header.main-header .navigation li.modern-dropdown-multi > .dropdown-btn {
        top: 22px; /* Fixa no topo do item, ao lado do texto "Produtos" */
        right: 0px; 
    }

    header.main-header .navigation li.modern-dropdown-multi.open > .dropdown-btn {
        transform: rotate(180deg); /* No mobile tiramos o translate que conflita */
    }
}

/* ─── Megamenu Container (FROSTED GLASS & STABILITY) ───────── */
header.main-header .navigation li.modern-dropdown-multi .modern-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: min(900px, calc(100vw - 40px));
    max-width: calc(100vw - 40px);
    padding: 45px !important;
    border-radius: 36px;
    z-index: 1000;
    
    /* Animação CSS Premium */
    display: block; 
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Deep Frosted Glass Recipe (60px blur) */
    backdrop-filter: blur(60px) saturate(210%);
    -webkit-backdrop-filter: blur(60px) saturate(210%);
    overflow: hidden;
}

/* ─── Ponte Invisível (Vincular o mouse ao menu - Reforçada) ── */
header.main-header .navigation li.modern-dropdown-multi:hover > .modern-dropdown-menu {
    border-top: 25px solid transparent; /* Ponte física no topo do elemento */
    margin-top: -25px; /* Compensa a borda para encostar no header */
    opacity: 1;
    visibility: visible;
    transform: translateY(8px) scale(1);
    pointer-events: auto;
}

/* Camada de Textura (Grain) para realismo */
header.main-header .navigation li.modern-dropdown-multi .modern-dropdown-menu::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

/* ─── Grid & Body Styling ──────────────────────────────────── */
.modern-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 40px 60px;
    position: relative;
    z-index: 2;
    background: transparent;
}

.modern-dropdown-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.4;
    margin-bottom: 28px;
    padding-left: 18px;
    color: var(--text);
}

.modern-dropdown-list-container {
    background: transparent;
}

.modern-dropdown-item-wrapper {
    margin-bottom: 4px;
}

/* ─── Items (Clean Specificity) ─────────────────────────────── */
header.main-header .navigation li.modern-dropdown-multi a.modern-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    color: var(--text);
    line-height: 1.35;
    background: transparent !important;
    border: none !important;
}

.modern-dropdown-item .item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary-color);
    background: rgba(var(--primary-rgb, 87, 95, 245), 0.1);
    border-radius: 12px;
    flex-shrink: 0;
}

.modern-dropdown-item .item-title {
    display: block;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.modern-dropdown-item .item-description {
    font-size: 14px;
    opacity: 0.6;
    margin: 0;
    white-space: normal;
}

/* Hover Minimalista */
header.main-header .navigation li.modern-dropdown-multi a.modern-dropdown-item:hover {
    background: rgba(var(--primary-rgb, 87, 95, 245), 0.05) !important;
    color: var(--primary-color);
    transform: translateX(10px);
}

.modern-dropdown-item:hover .item-icon {
    transform: scale(1.1);
    background: var(--primary-color);
    color: white;
}

/* ─── Deep Frosted Themes ──────────────────────────────────── */

/* Light Mode: White Frosted Ice */
html[data-theme="light"] header.main-header .navigation li.modern-dropdown-multi .modern-dropdown-menu {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 40px 100px rgba(15, 23, 42, 0.12);
}

/* Dark Mode: Deep Sapphire Glass */
html[data-theme="dark"] header.main-header .navigation li.modern-dropdown-multi .modern-dropdown-menu {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

/* Desktop Fix */
@media only screen and (min-width: 992px) {
    header.main-header .navigation li.modern-dropdown-multi .modern-dropdown-menu {
        display: block !important;
    }
}

@media only screen and (min-width: 992px) and (max-width: 1350px) {
    header.main-header .navigation li.modern-dropdown-multi .modern-dropdown-menu {
        width: min(880px, calc(100vw - 40px));
        max-width: calc(100vw - 40px);
        padding: 30px !important;
        border-radius: 28px;
    }

    .modern-dropdown-grid {
        gap: 20px 40px;
    }

    .modern-dropdown-item .item-title {
        font-size: 16px;
    }

    .modern-dropdown-item .item-description {
        font-size: 13px;
    }
}

/* Mobile Reset */
@media only screen and (max-width: 991px) {
    /* Remove qualquer resquício de borda/fundo do template antigo no li */
    header.main-header .navigation li.modern-dropdown-multi {
        background: transparent !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100%;
    }

    /* Estiliza o trigger ("Produtos") como um header de seção quando ativo */
    header.main-header .navigation li.modern-dropdown-multi.open > a.modern-trigger {
        background: rgba(var(--primary-rgb, 87, 95, 245), 0.03); /* Leve destaque de fundo */
        color: var(--primary-color) !important;
    }

    header.main-header .navigation li.modern-dropdown-multi .modern-dropdown-menu {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        margin-top: 10px; /* Espaço para não encostar no título "Produtos" */
        padding: 10px 0 20px 20px !important; /* Indentação limpa */
        border-radius: 0;
        display: none;
        opacity: 1;
        visibility: visible;
        border: none !important; /* Removemos a linha vertical */
        box-shadow: none;
        transform: none;
        pointer-events: auto;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: transparent !important;
        overflow: visible;
    }

    .modern-dropdown-multi.open > .modern-dropdown-menu {
        display: block;
    }

    .modern-dropdown-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .modern-dropdown-section-title {
        margin-bottom: 12px;
        margin-top: 20px;
        padding-left: 0;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        opacity: 0.4; /* Bem discreto */
        letter-spacing: 0.15em;
        color: var(--text); /* Cor neutra, não compete com o título */
    }

    header.main-header .navigation li.modern-dropdown-multi a.modern-dropdown-item {
        padding: 12px;
        border-radius: 14px;
        gap: 12px;
    }

    .modern-dropdown-item .item-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
        border-radius: 10px;
    }

    .modern-dropdown-item .item-title {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 2px;
    }

    .modern-dropdown-item .item-description {
        font-size: 13px;
        line-height: 1.4;
        opacity: 0.7;
    }

    header.main-header .navigation li.modern-dropdown-multi > .dropdown-btn {
        display: block !important; /* Mostra a seta no mobile também */
        pointer-events: auto;
    }
}
