.mgmm-wrapper { 
    position: relative; 
    font-family: 'Inter', sans-serif; 
    width: 100%; 
    z-index: 999; 
    display: flex; 
    justify-content: center; /* Centra el menú en el header */
}
.mgmm-mobile-toggle { display: none; }

/* Menú Principal */
.mgmm-main-list { display: flex; list-style: none; margin: 0; padding: 0; gap: 40px; align-items: center; }
.mgmm-main-list > li { position: relative; padding: 20px 0; }
.mgmm-main-list > li > a { text-decoration: none; font-weight: 600; font-size: 14px; text-transform: uppercase; transition: color 0.3s ease; }

/* Para que el MegaMenú se centre en relación a la pantalla o contenedor, hacemos static el li */
.mgmm-main-list > li:has(.mgmm-mega-dropdown) { position: static; }

/* Sub-menús Normales (Promociones, Servicio, etc.) */
.mgmm-main-list .sub-menu {
    position: absolute; top: 100%; left: 0; min-width: 220px;
    background: #fff; box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    list-style: none; padding: 10px 0; margin: 0;
    opacity: 0; visibility: hidden; transform: translateY(10px); transition: 0.3s;
    border-radius: 0 0 5px 5px;
}
.mgmm-main-list li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.mgmm-main-list .sub-menu li a { display: block; padding: 10px 20px; color: #333; text-decoration: none; font-size: 14px; }
.mgmm-main-list .sub-menu li a:hover { background: #f9f9f9; color: #E3001B; }

/* El MegaMenú (Solo para Vehículos) - NUEVO CENTRADO Y ANCHO */
.mgmm-mega-dropdown {
    position: absolute; 
    top: 100%; 
    left: 50%; /* Lo empuja al 50% de la pantalla */
    width: 100%; 
    max-width: 1300px; /* Ancho máximo para que no se vea desproporcionado */
    background: #fff;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15); 
    padding: 30px;
    border-radius: 0 0 8px 8px; /* Bordes redondeados sutiles */
    opacity: 0; 
    visibility: hidden; 
    /* El translateX(-50%) lo centra perfectamente respecto al 50% anterior */
    transform: translateX(-50%) translateY(15px); 
    transition: all 0.3s ease;
}
.mgmm-main-list li:hover > .mgmm-mega-dropdown { 
    opacity: 1; 
    visibility: visible; 
    transform: translateX(-50%) translateY(0); 
}

/* Pestañas de Categoría */
.mgmm-tabs { display: flex; list-style: none; padding: 0; margin: 0 0 20px 0; border-bottom: 2px solid #f0f0f0; gap: 10px; justify-content: center; }
.mgmm-tab { padding: 10px 20px; cursor: pointer; font-weight: 600; color: #666; transition: 0.3s; background: #f9f9f9; border-radius: 5px 5px 0 0; }
.mgmm-tab:hover { background: #eee; }
.mgmm-tab.active { background: #E3001B; color: #fff; }

/* Cuadrícula de Autos */
.mgmm-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; 
    
}
.mgmm-car-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; padding: 20px; border: 1px solid #f0f0f0; border-radius: 8px; transition: 0.3s; background: #fff; }
.mgmm-car-card:hover { border-color: #E3001B; transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.mgmm-car-image img { max-width: 100%; height: 100px; object-fit: contain; margin-bottom: 15px; }
.mgmm-car-title { margin: 0 0 5px; font-size: 16px; color: #1a1a1a; font-weight: bold; }
.mgmm-car-price { margin: 0; font-size: 13px; color: #666; }
.mgmm-badge { position: absolute; top: 10px; right: 10px; color: #fff; font-size: 10px; padding: 3px 8px; border-radius: 20px; font-weight: bold; }

/* Mobile First (Acordeón para todo el menú) */
@media (max-width: 991px) {
    .mgmm-nav { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
    .mgmm-mobile-toggle { display: flex; justify-content: space-between; align-items: center; background: #1a1a1a; color: #fff; padding: 15px 20px; cursor: pointer; font-weight: bold; width: 100%; }
    .mgmm-hamburger span { display: block; width: 25px; height: 3px; background: #fff; margin-bottom: 5px; transition: 0.3s; }
    .mgmm-main-list { flex-direction: column; gap: 0; align-items: flex-start; }
    .mgmm-main-list > li { width: 100%; padding: 0; border-bottom: 1px solid #f0f0f0; }
    .mgmm-main-list > li > a { display: block; padding: 15px 20px; color: #1a1a1a !important; } /* Fuerzo a negro en móvil para visibilidad */
    
    /* Reseteo de Sub-menús y MegaMenú para móvil */
    .mgmm-main-list .sub-menu, .mgmm-mega-dropdown { position: static; width: 100%; max-width: 100%; opacity: 1; visibility: visible; transform: none; box-shadow: none; display: none; padding: 10px 20px; background: #f9f9f9; }
    .mgmm-main-list li.mobile-open > .sub-menu, .mgmm-main-list li.mobile-open > .mgmm-mega-dropdown { display: block; }
    
    /* Ajustes Grid Móvil */
    .mgmm-tabs { flex-wrap: wrap; justify-content: flex-start; }
    .mgmm-tab { flex: 1 1 auto; text-align: center; font-size: 12px; padding: 8px; }
    .mgmm-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .mgmm-car-card { padding: 10px; }
    .mgmm-car-image img { height: 70px; }
}