/* ── DROPDOWN MENU ─────────────────────────────────────── */
.has-dropdown {
    position: relative;
}

.dropdown-arrow {
    font-size: .65rem;
    margin-left: 4px;
    line-height: 1;
    transition: transform 0.25s ease;
    display: inline-block;
    vertical-align: middle;
}

.has-dropdown:hover .dropdown-arrow,
.has-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
    border: 1px solid rgba(0, 0, 0, .07);
    min-width: 210px;
    padding: 8px 0;
    list-style: none;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateX(-50%) translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 400;
}

/* Triângulo decorativo */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--white);
    filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, .06));
}

/* Desktop: ativa no hover */
@media (min-width: 769px) {

    .has-dropdown:hover .dropdown-menu,
    .has-dropdown:focus-within .dropdown-menu {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile: ativa via classe .open (JS) */
.has-dropdown.open .dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    font-size: .9rem;
    font-weight: 500;
    color: var(--text);
    transition: background 0.18s ease, color 0.18s ease;
    white-space: nowrap;
}

.dropdown-menu li a i {
    color: var(--red);
    width: 16px;
    text-align: center;
    font-size: .85rem;
    flex-shrink: 0;
}

.dropdown-menu li a:hover {
    background: rgba(225, 34, 23, .06);
    color: var(--red);
}

.dropdown-menu li a:hover i {
    color: var(--red);
}

/* ── Mobile: dropdown integrado ao menu ── */
@media (max-width: 768px) {
    .has-dropdown {
        flex-direction: column;
        align-items: stretch;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 3px solid rgba(225, 34, 23, .25);
        border-radius: 0;
        background: rgba(225, 34, 23, .04);
        padding: 4px 0;
        margin: 0 0 0 16px;
        min-width: unset;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.2s ease;
    }

    .dropdown-menu::before {
        display: none;
    }

    .has-dropdown.open .dropdown-menu {
        max-height: 300px;
        transform: none;
        pointer-events: auto;
        visibility: visible;
    }

    .dropdown-menu li a {
        padding: 11px 14px;
        font-size: .95rem;
    }
}

/* ── Bridge: preenche o gap entre trigger e dropdown ── */
@media (min-width: 769px) {
    .has-dropdown::before {
        content: '';
        position: absolute;
        bottom: -12px;
        left: -10px;
        right: -10px;
        height: 12px;
        background: transparent;
        z-index: 399;
    }
}