/* Correções para o dropdown de produtos */

/* Ajustes principais para o dropdown */
.navbar {
    position: relative;
    z-index: 1030;
}

.nav-item.dropdown {
    position: static;
}

.dropdown-menu {
    padding: 0.5rem 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1050;
    border-radius: 0;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dropdown-menu.show {
    display: block !important;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #212529;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    border-bottom: 1px solid #f8f9fa;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    white-space: normal;
    line-height: 1.4;
    min-height: 44px;
    align-items: flex-start;
    font-size: 0.875rem;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: rgba(255, 102, 0, 0.1);
    color: var(--primary-color);
    text-decoration: none;
}

.dropdown-item i {
    font-size: 0.5rem;
    margin-right: 0.75rem;
    color: #6c757d;
    transition: color 0.15s ease;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-item.has-submenu {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    white-space: normal;
    line-height: 1.4;
    min-height: 44px;
    font-size: 0.875rem;
}

.dropdown-item.has-submenu:hover {
    background-color: rgba(255, 102, 0, 0.1);
}

.item-content {
    display: flex;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    white-space: normal;
    line-height: 1.4;
    font-size: 0.875rem;
}

.submenu-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.submenu-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    color: var(--primary-color);
}

.submenu-count {
    background: var(--primary-color);
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    font-weight: 600;
}

.submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    min-width: 250px;
    max-width: 300px;
    z-index: 1060;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    padding: 0.5rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-item-container:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.dropdown-item-container:hover .submenu-arrow {
    transform: rotate(90deg);
}

.dropdown-item-container:hover .submenu-count {
    background: #e67e22;
    transform: scale(1.1);
}

.submenu-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    color: #212529;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    border-bottom: 1px solid #f8f9fa;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    white-space: normal;
    line-height: 1.4;
    min-height: 44px;
    font-size: 0.8rem;
}

.submenu-item:last-child {
    border-bottom: none;
}

.submenu-item:hover {
    background-color: rgba(255, 102, 0, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateX(5px);
}

.submenu-item i {
    font-size: 0.5rem;
    margin-right: 0.75rem;
    color: #6c757d;
    transition: color 0.15s ease;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.submenu-item:hover i {
    color: var(--primary-color);
}

/* Scrollbar personalizada para submenu */
.submenu::-webkit-scrollbar {
    width: 4px;
}

.submenu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.submenu::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.submenu::-webkit-scrollbar-thumb:hover {
    background: #e67e22;
}

/* Ajuste para submenu não sair da tela */
.dropdown-menu-horizontal .col:last-child .submenu {
    left: auto;
    right: 100%;
}

.dropdown-menu-horizontal .col:nth-last-child(2) .submenu {
    left: auto;
    right: 100%;
}

/* Responsividade para submenu */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        width: 100%;
        max-height: none;
        overflow-y: visible;
        box-shadow: none;
        border: none;
    }
    
    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 3px solid var(--primary-color);
        margin-left: 1rem;
        margin-top: 0.5rem;
        padding-left: 1rem;
        max-height: none;
        overflow-y: visible;
    }
    
    .dropdown-item-container:hover .submenu {
        transform: none;
    }
    
    .submenu-arrow {
        transform: rotate(90deg);
    }
    
    .submenu-item:hover {
        transform: none;
    }
    
    .submenu-indicator {
        margin-left: auto;
    }
}

.dropend .dropdown-menu {
    margin-top: 0;
    margin-left: 0.125rem;
}

.dropdown-menu-horizontal {
    min-width: 800px;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.dropdown-menu-horizontal .row {
    margin: 0;
}

.dropdown-menu-horizontal .col {
    padding: 0 1rem;
}

.dropdown-menu-horizontal .dropdown-item {
    white-space: normal;
    padding: 0.75rem 1rem;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.4;
    min-height: 44px;
    align-items: flex-start;
    font-size: 0.875rem;
}

.dropdown-menu-horizontal .dropdown-divider {
    margin: 0.5rem 0;
}

/* Estilos para submenu */
.dropdown-item-container {
    position: relative;
}

/* Ajustes para melhor posicionamento */
@media (min-width: 769px) {
    .dropdown-menu-horizontal {
        left: 50%;
        transform: translateX(-50%);
        width: 90vw;
        max-width: 1200px;
    }
    
    .submenu {
        position: absolute;
        left: 100%;
        top: 0;
    }
    
    /* Ajuste para colunas da direita */
    .dropdown-menu-horizontal .col:last-child .submenu,
    .dropdown-menu-horizontal .col:nth-last-child(2) .submenu {
        left: auto;
        right: 100%;
    }
}

/* Melhorar acessibilidade */
.dropdown-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.dropdown-item:focus,
.submenu-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
} 