/* =====================================
   PANELES.CSS - Sistema de paneles de información UTU (Desktop only)
   VERSIÓN CORREGIDA - Altura dinámica y posicionamiento mejorado
   ===================================== */

@media screen and (min-width: 769px) {

  /* ============================
     KEYFRAMES ANIMATIONS
     ============================ */
  
  @keyframes slideInFromRight {
    from { 
      opacity: 0; 
      transform: translateX(100%);
    }
    to { 
      opacity: 1; 
      transform: translateX(0); 
    }
  }

  @keyframes slideOutToLeft {
    from { 
      opacity: 1; 
      transform: translateX(0); 
    }
    to { 
      opacity: 0; 
      transform: translateX(-100%);
    }
  }

  /* ============================
     CONTENEDOR PRINCIPAL
     ============================ */
  
  .contenedor-escritorio-infoUTU {
    display: flex;
    gap: 1em;
    padding: 1em;
    font-family: 'Atkinson Hyperlegible Next', sans-serif;
    /* Removida min-height fija para permitir adaptación */
  }

  /* ============================
     MENÚ LATERAL
     ============================ */
  
  .menu-infoUTU {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
    min-width: 240px;
    border-right: 2px solid rgba(0,0,0,0.1);
    padding-right: 1em;
    align-self: flex-start; /* Evita que el menú se estire */
  }

  .boton-infoUTU {
    font-size: 17px;
    padding: 1em 2.2em;
    font-weight: 500;
    background-color: var(--accent-blue);
    color: #ffffff;
    border: none;
    border-radius: 0.6em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
  }

  .boton-infoUTU::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
  }

  .boton-infoUTU:hover::before {
    left: 100%;
  }

  .boton-infoUTU:hover {
    background-color: var(--accent-yellow);
    color: #111;
    transform: translateX(5px);
  }

  .boton-infoUTU:active {
    transform: scale(0.97);
  }

  .boton-infoUTU.activo {
    background-color: var(--accent-yellow);
    color: #111;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.6);
    transform: translateX(10px);
  }

  /* ============================
     ZONA DE CONTENIDO - ALTURA DINÁMICA
     ============================ */
  
  .zona-contenido {
    flex: 1;
    position: relative;
    /* CAMBIO CLAVE: Altura mínima reducida y transición suave */
    min-height: 300px;
    height: auto;
    overflow: hidden;
    /* Transición suave para cambios de altura */
    transition: height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  /* ============================
     PANELES DE CONTENIDO
     ============================ */
  
  .panel-infoUTU {
    position: absolute;
    top: 0; 
    left: 0;
    right: 0;
    width: 100%;
    padding: 30px;
    border-radius: 12px;
    
    /* Estado inicial: oculto */
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    pointer-events: none;
    
    /* Transiciones suaves */
    transition: 
      transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
      opacity 0.4s ease,
      visibility 0.4s ease;
    
    /* Efectos visuales */
    background: var(--background-color, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    font-size: 1.05rem;
    z-index: 1;
    
    /* CAMBIO CLAVE: Permitir que el contenido determine la altura */
    height: auto;
    min-height: auto;
  }

  /* Panel activo */
  .panel-infoUTU.activo {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    z-index: 10;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    /* Posición estática para permitir que influya en la altura del contenedor */
    position: static;
  }

  /* Panel saliendo */
  .panel-infoUTU.saliendo {
    opacity: 0;
    transform: translateX(-100%);
    z-index: 5;
    position: absolute; /* Mantener absoluto durante salida */
  }

  /* Panel entrando */
  .panel-infoUTU.entrando {
    animation: slideInFromRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    position: absolute; /* Absoluto durante entrada */
  }

  /* Panel entrando que está por convertirse en activo */
  .panel-infoUTU.entrando-final {
    position: static; /* Cambio a estático al final */
  }

  /* ============================
     CONTENIDO DE PANELES
     ============================ */

  .panel-infoUTU h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: var(--accent-blue);
    border-bottom: 2px solid var(--accent-yellow);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .panel-infoUTU p {
    margin: 15px 0;
    line-height: 1.7;
    color: var(--text-color, #333);
  }

  .panel-infoUTU address {
    font-style: normal;
    line-height: 1.8;
  }

  .panel-infoUTU address div {
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
  }

  .panel-infoUTU address div:hover {
    background-color: rgba(0, 0, 0, 0.02);
    padding-left: 10px;
  }

  .panel-infoUTU address a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.3s ease;
  }

  .panel-infoUTU address a:hover {
    color: var(--accent-yellow);
    text-decoration: underline;
  }

  /* ============================
     CLASE AUXILIAR PARA MEDICIÓN
     ============================ */
  
  .panel-infoUTU.measure-height {
    position: static !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
  }

  /* ============================
     ACCESIBILIDAD
     ============================ */

  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .boton-infoUTU:focus-visible {
    outline: 3px solid var(--accent-yellow);
    outline-offset: 2px;
  }

  .panel-infoUTU:focus-visible {
    outline: 3px solid var(--accent-blue);
    outline-offset: -3px;
  }

  /* ============================
     MODO OSCURO
     ============================ */

  [data-bs-theme="oscuro"] .panel-infoUTU {
    background: rgba(30, 30, 30, 0.95);
    color: #f0f0f0;
  }

  [data-bs-theme="oscuro"] .panel-infoUTU h2 {
    color: var(--accent-yellow);
    border-bottom-color: var(--accent-blue);
  }

  [data-bs-theme="oscuro"] .panel-infoUTU p {
    color: #e0e0e0;
  }

  [data-bs-theme="oscuro"] .panel-infoUTU address div {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  [data-bs-theme="oscuro"] .panel-infoUTU address div:hover {
    background-color: rgba(255, 255, 255, 0.05);
  }

  /* ============================
     RESPONSIVE DENTRO DE DESKTOP
     ============================ */

  @media screen and (min-width: 769px) and (max-width: 1024px) {
    .menu-infoUTU {
      min-width: 200px;
    }
    
    .boton-infoUTU {
      font-size: 15px;
      padding: 0.8em 1.5em;
    }
    
    .panel-infoUTU {
      padding: 20px;
    }
    
    .panel-infoUTU h2 {
      font-size: 1.5rem;
    }
    
    .zona-contenido {
      min-height: 250px; /* Altura mínima reducida en tablets */
    }
  }

  @media screen and (min-width: 1440px) {
    .contenedor-escritorio-infoUTU {
      max-width: 1400px;
      margin: 0 auto;
    }
  }
}
/* =====================================
   CORRECCIÓN PARA PANEL DE CONTACTO
   ===================================== */

/* Sobrescribir estilos específicos para el panel de contacto */
/* Esto evita que el tema azulado se aplique al panel de contacto */
#panel-3.panel-infoUTU {
  background: var(--bg-elev-1) !important;
  color: var(--text-primary) !important;
}

#panel-3.panel-infoUTU p {
  color: var(--text-secondary) !important;
}

/* Hover mejorado para elementos de dirección en el panel de contacto */
/* Esto funciona para los div dentro de address */
#panel-3.panel-infoUTU address div {
  margin: 10px 0;
  padding: 8px 12px;
  border-radius: 6px;
  border-bottom: 1px solid var(--divider);
  transition: all 0.3s ease;
  cursor: default;
}

/* Hover específico para tema claro */
[data-bs-theme="claro"] #panel-3.panel-infoUTU address div:hover {
  background-color: var(--hover-bg);
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(15, 76, 129, 0.1);
}

/* Hover específico para tema oscuro */
[data-bs-theme="oscuro"] #panel-3.panel-infoUTU address div:hover {
  background-color: var(--hover-bg);
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Estilos para enlaces dentro de las direcciones */
#panel-3.panel-infoUTU address a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
}

#panel-3.panel-infoUTU address a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Asegurar que el texto fuerte tenga el color correcto */
#panel-3.panel-infoUTU address strong {
  color: var(--text-primary);
}