/*===================================================================
 * WIDGET MENU USUARIOS - VERSION 2.1 - FIX CORRECTO DEL HOVER
===================================================================*/

/* Ocultar botón de área privada cuando el usuario está logueado */
body.logged-in [data-section="section-hb-button-1"], 
body.logged-in [data-section="sidebar-widgets-header-widget-1"] {
    display: none !important;
}

/* ======================
   MENÚ NO LOGUEADO
====================== */
.menu-no-logeado {
    display: inline-block;
}

.menu-no-logeado a.area-privada-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--ast-global-color-0);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.menu-no-logeado a.area-privada-button:hover {
    background-color: var(--ast-global-color-1);
    transform: translateY(-2px);
}

/* ======================
   MENÚ LOGUEADO - FIX HOVER Y Z-INDEX
====================== */
.menu-logeado {
    list-style: none;
    position: relative;
    margin: 0;
    padding: 0;
    display: inline-block;
    min-width: 180px;
}

.menu-logeado > li {
    margin: 0;
    padding: 0;
    position: relative;
}

/* Trigger del menú (nombre de usuario) */
.nombre-usuario-menu {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 10px 15px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    color: #171717;
    transition: color 0.3s ease;
    user-select: none;
    position: relative;
    z-index: 100000;
    font-family: 'Roboto', sans-serif !important;
}

/* FIX CRÍTICO: Puente invisible entre el trigger y el submenu */
.menu-logeado > li::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px; /* Puente de 10px */
    background: transparent;
    z-index: 999998; /* Debe estar DEBAJO del submenu pero capturar hover */
}

.menu-logeado:hover .nombre-usuario-menu {
    color: var(--ast-global-color-0);
}

.nombre-usuario-menu .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* Rotar la flecha cuando se hace hover */
.menu-logeado:hover .nombre-usuario-menu .dashicons {
    transform: rotate(180deg);
}

/* ======================
   SUBMENU DESPLEGABLE - FIX CRÍTICO
====================== */
.submenu-logeado {
    list-style: none;
    position: absolute;
    top: calc(100% + 10px); /* ⭐ CRÍTICO: Debe empezar DESPUÉS del puente */
    right: 0;
    padding: 8px 0;
    min-width: 200px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-top: 3px solid var(--ast-global-color-0);
    z-index: 999999 !important;
    
    /* Estado oculto por defecto */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    
    /* Pointer events activos */
    pointer-events: auto !important;
}

/* Mostrar menú al hacer hover en el contenedor padre */
.menu-logeado:hover .submenu-logeado,
.menu-logeado > li:hover .submenu-logeado {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Items del submenu */
.submenu-logeado li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.submenu-logeado a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
}

.submenu-logeado a:hover {
    background-color: #f8f8f8;
    color: var(--ast-global-color-0);
}

.submenu-logeado a i {
    width: 18px;
    height: 18px;
    font-size: 16px;
    color: #666;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submenu-logeado a:hover i {
    color: var(--ast-global-color-0);
}

/* ======================
   RESPONSIVE
====================== */
@media (max-width: 768px) {
    .menu-logeado {
        min-width: auto;
        width: 100%;
    }
    
    .nombre-usuario-menu {
        justify-content: center;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .submenu-logeado {
        right: 0;
        left: 0;
        min-width: 100%;
        border-radius: 0 0 8px 8px;
    }
}

/* ======================
   ACCESIBILIDAD
====================== */
.nombre-usuario-menu:focus,
.submenu-logeado a:focus {
    outline: 2px solid var(--ast-global-color-0);
    outline-offset: 2px;
}

/* TEST: Eliminar borders */
.submenu-logeado li {
    border-bottom: none !important;
}

.submenu-logeado a {
    border-bottom: 1px solid #f0f0f0 !important;
}

.submenu-logeado li:last-child a {
    border-bottom: none !important;
}

/*===================================================================
 * LISTADO DE ECONOMISTAS
===================================================================*/
 .contacto-card {
     display: flex;
     justify-content: space-between;
     padding: 16px 0;
     border-bottom: 1px solid #ccc;
 }

  .contacto-card .contacto-profile-img img {
      max-width: 64px;
      height: auto;
      border-radius: 50%;
  }
    .contacto-data {
        display: flex;
        flex-direction: column;
        min-width: 90%;
        gap: 16px;
    }
  .contacto-card .contacto-profile-data .contacto-data-name {
      font-size: 18px;
      margin-bottom: 8px;
  }
  .contacto-card .contacto-profile-data .contacto-data-list {
      list-style: none;
      margin: 0;
  }
  .contacto-profile-data {
        width: 100%;
    }
.lista-contactos-pagination {
    text-align: center;
    margin-top: 24px;
}
.lista-empresas-relacionadas{
    margin-top: 16px;
    padding: 16px;
    padding-top:4px;
    background-color: var(--ast-global-color-6);
    width: 100%;
  }
    .lista-empresas-relacionadas dt{
        margin-top:16px;
        text-transform: uppercase;
        font-weight: normal;
  }
  .lista-empresas-relacionadas dd{
        margin: 0;
  }
  .toggle-details p {
        margin-bottom:0;
    }
  .toggle-details:hover p {
      color:var(--ast-global-color-1);
  }
    .toggle-details .hidden-mobile{
        display:none;
    }
    .form-row {
        display: flex;
        flex-direction:column;
        gap: 16px;
        margin-bottom: 16px;
    }
@media(min-width:768px){
    .form-row {
        flex-direction:row;
        margin-bottom: 24px;
    }
    .form-row:last-child{
        margin-bottom: 0;
    }
    .contacto-data {
        flex-direction: row;
        gap: 24px;
        width:80%;
        min-width: auto;
    }
    .toggle-details .hidden-mobile {
        display: inline-block;
    }
}
.search-form, .contactos-search-form > div{
    margin-bottom: 24px;
}
.form-row .form-group {
  flex: 1 1 calc(33.33% - 1rem);
  box-sizing: border-box;
}
.form-row .form-group .form-control {
    box-shadow: none;
    border-color: #ced4da;
}
    
.button-actions {
    text-align: right;
}
.button-actions .button-outline {
    background-color: var(--ast-global-color-5);
    color: var(--ast-global-color-0);
    border:1px solid var(--ast-global-color-0);
    transition: 0.2s;
}
.button-actions .button-outline:hover {
    background-color: var(--ast-global-color-0);
    color: var(--ast-global-color-5);
    border:1px solid var(--ast-global-color-0);
}
.listado-colegiados .ast-pagination {
	display: inline-block;
    width: 100%;
    padding-top: 2em;
    text-align: center;
}
.listado-colegiados .ast-pagination .nav-links {
    display: inline-block;
    width: 100%;
}
.listado-colegiados .ast-pagination .page-numbers {
    display: inline-block;
    width: 2.33333em;
    height: 2.33333em;
    font-size: 16px;
    font-size: 1.06666rem;
    line-height: calc(2.33333em - 3px);
    font-weight: 500;
}
.listado-colegiados .ast-pagination .page-numbers.current {
    color: #ffffff;
    border-color: var(--ast-global-color-0);
    background-color: var(--ast-global-color-0);
}
.listado-colegiados .ast-pagination .next.page-numbers {
    float: right;
	width: auto;
}
.listado-colegiados .ast-pagination .prev.page-numbers {
    float: left;
	width: auto;
}

/*===================================================================
 * VERIFICACIÓN CSV
===================================================================*/
@keyframes spin {
	0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.csv-loading-overlay {
	display: none;
    position: relative;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 5px;
    margin-top: 15px;
}
.csv-loading-overlay.active {
	display: block;
}
.csv-spinner {
	border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}
.csv-loading-text {
	color: #555;
    font-size: 16px;
    font-weight: 500;
}