/* 
 * RESPONSIVE MOBILE - Mejoras adicionales
 * Agregar al final de /assets/css/main.css
 */

/* ===========================
   HAMBURGER MENU (Mobile)
   =========================== */

/* Botón hamburger (oculto en desktop) */
.menu-toggle {
  display: none;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  color: #fff;
  font-size: 1.2em;
  transition: .2s;
}

.menu-toggle:hover {
  background: rgba(255,255,255,.25);
}

/* Mobile: mostrar hamburger, ocultar navegación por defecto */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  .toplinks {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--az1);
    box-shadow: -4px 0 12px rgba(0,0,0,.3);
    flex-direction: column;
    padding: 60px 20px 20px;
    z-index: 1000;
    overflow-y: auto;
  }
  
  .toplinks.active {
    display: flex;
  }
  
  .pilllink {
    width: 100%;
    justify-content: flex-start;
    padding: 14px 16px;
    font-size: 1.05em;
  }
  
  /* Overlay para cerrar el menú */
  .menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.5);
    z-index: 999;
  }
  
  .menu-overlay.active {
    display: block;
  }
  
  /* Botón cerrar dentro del menú */
  .menu-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
}

/* ===========================
   TABLAS RESPONSIVE
   =========================== */

/* Contenedor scrolleable para tablas */
.table-wrapper {
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--r);
}

.table-wrapper table {
  width: 100%;
  min-width: 600px; /* Forzar scroll en móvil si es necesario */
  border-collapse: collapse;
}

.table-wrapper th,
.table-wrapper td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.table-wrapper th {
  background: rgba(0,51,102,.05);
  font-weight: 900;
  color: var(--az1);
}

/* Indicador visual de scroll */
.table-wrapper::after {
  content: '→ Deslizá para ver más';
  display: none;
  position: absolute;
  right: 20px;
  top: 10px;
  font-size: .8em;
  color: var(--mut);
  opacity: .7;
}

@media (max-width: 768px) {
  .table-wrapper::after {
    display: block;
  }
}

/* ===========================
   TOUCH TARGETS (Móvil)
   =========================== */

/* Asegurar que botones y links sean fáciles de tocar */
@media (max-width: 768px) {
  .btn,
  .pilllink,
  button,
  input[type="submit"],
  a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  input,
  select,
  textarea {
    min-height: 48px;
    font-size: 16px; /* Evita zoom automático en iOS */
  }
}

/* ===========================
   HERO RESPONSIVE MEJORADO
   =========================== */

@media (max-width: 768px) {
  .hero {
    padding: 20px 16px 30px;
  }
  
  .hero h2 {
    font-size: 1.75em;
  }
  
  .hero p {
    font-size: 1em;
  }
  
  .badge {
    width: 240px;
  }
}

@media (max-width: 480px) {
  .hero h2 {
    font-size: 1.5em;
  }
  
  .brand h1 {
    font-size: 1.3em;
  }
  
  .brand .sub {
    font-size: .9em;
  }
}

/* ===========================
   CARDS RESPONSIVE
   =========================== */

@media (max-width: 768px) {
  .card {
    padding: 14px;
  }
  
  .card h3 {
    font-size: 1.1em;
  }
  
  .directory-item {
    padding: 14px;
  }
  
  .directory-item .meta {
    flex-direction: column;
    gap: 6px;
  }
}

/* ===========================
   BÚSQUEDA RESPONSIVE
   =========================== */

@media (max-width: 768px) {
  .search-box {
    position: relative; /* No sticky en móvil */
    padding: 14px;
  }
  
  .search-filters {
    flex-direction: column;
  }
  
  .filter-select {
    min-width: 100%;
  }
}

/* ===========================
   ANIMACIONES SUAVES (Opcional)
   =========================== */

@media (prefers-reduced-motion: no-preference) {
  .toplinks {
    transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .menu-overlay {
    transition: opacity .3s;
  }
}
