/* Container Principal */
.perto-mega-menu-container {
    display: flex;
    min-height: 450px;
    background: #fff;
    border: 1px solid #e1e1e1;
    font-family: Arial, Helvetica, sans-serif; /* Ajuste para fonte do seu site */
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-radius: 25px;
}

/* --- SIDEBAR --- */
.perto-menu-sidebar {
    width: 280px;
    flex-shrink: 0;
    padding: 25px;
    background: #fff;
    border-right: 1px solid #eee;
    border-radius: 25px;
}

.perto-menu-group {
    margin-bottom: 30px;
}

.perto-menu-group h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1a1a1a;
    font-family: Arial, Helvetica, sans-serif;
}

.perto-menu-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.perto-menu-sidebar li {
    margin-bottom: 2px;
}

.perto-menu-trigger {
    display: block;
    padding: 10px 15px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.perto-menu-trigger:hover {
    background-color: #f7f9fc;
    color: #0056b3;
}

/* Estado Ativo (Fundo Azul Claro igual ao Print) */
.perto-menu-trigger.is-active {
    background-color: #e6f0fa;
    color: #0056b3;
    font-weight: 600;
    border-left: 4px solid #0056b3;
}

/* --- CONTEÚDO (DIREITA) --- */
.perto-menu-content {
    flex-grow: 1;
    padding: 40px;
    background-color: #f4f5f7;
    position: relative;
    overflow-y: auto; /* Scroll interno se a lista for muito grande */
    max-height: 600px; /* Limite de altura se desejar */
    border-radius: 25px;
}

/* Títulos dos Grupos no Resultado */
.perto-group-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 0;
    margin-top: 0;
    font-family: Arial, Helvetica, sans-serif;
}
.perto-solucao-group:first-child .perto-group-title {
    margin-top: 0;
}

/* Grid de Produtos */
.perto-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 30px;
}

/* Card Produto */
.perto-product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none !important;
    transition: transform 0.3s;
}

.perto-product-card:hover {
    transform: translateY(-5px);
}

.perto-card-image {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
   /* background: #fff; /* Fundo branco na imagem ajuda a destacar no fundo cinza */ */
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
   /* box-shadow: 0 2px 5px rgba(0,0,0,0.03);*/
}

.perto-card-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.perto-card-title {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    font-weight: 500;
    margin-bottom: 5px;
    font-family: Arial, Helvetica, sans-serif;
}

.perto-card-arrow {
    color: #0073e6;
    font-size: 14px;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.3s;
}

.perto-product-card:hover .perto-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.perto-product-card:hover .perto-card-title {
    color: #0073e6;
}

/* Loading Spinner */
.perto-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0056b3;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.perto-intro, .perto-no-results {
    color: #777;
    font-size: 16px;
    text-align: center;
    margin-top: 50px;
}

/* --- MOBILE (Responsivo) --- */
@media (max-width: 768px) {
    
    /* 1. Garante que o container principal cresça conforme o conteúdo */
    .perto-mega-menu-container {
        display: flex;
        flex-direction: column;
        height: auto !important; /* Força altura automática */
        min-height: 0 !important;
    }

    /* 2. Sidebar (Menu) no topo */
    .perto-menu-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 15px;
    }

    /* 3. Conteúdo (Produtos) - AQUI ESTÁ A SOLUÇÃO */
    .perto-menu-content {
        width: 100%;
        padding: 20px 15px;
        
        /* Remove a rolagem interna e o limite de altura */
        max-height: none !important; 
        height: auto !important;
        overflow: visible !important; 
        
        /* Garante que o container flex não tente encolher isso */
        flex-shrink: 0; 
        flex-basis: auto;
    }

    /* Ajuste visual opcional para o grid no celular (2 colunas fica melhor que 1) */
    .perto-products-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 produtos por linha */
        gap: 15px;
    }
    
    /* Ajuste tamanho da fonte e imagem para caber melhor */
    .perto-card-image {
        height: 100px; /* Um pouco menor no mobile */
    }
    
    .perto-card-title {
        font-size: 12px;
    }
}