/* ------------------------------------------------------------------
   Variables globales
------------------------------------------------------------------ */
:root {
    --primary-color: #007ACC;       /* Azul VS Code */
    --secondary-color: #1F2937;     /* Azul oscuro */
    --accent-color: #FFFFFF;        /* Blanco */
    --text-primary: #1F2937;        /* Texto principal */
    --text-secondary: #6B7280;      /* Texto secundario */
    --background-color: #F3F4F6;    /* Fondo */
    --shadow-color: rgba(0, 0, 0, 0.08); /* Sombra sutil */
  }
  
  /* ------------------------------------------------------------------
     Reset y estilos base
  ------------------------------------------------------------------ */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  html, body {
    min-height: 100vh;
  }
  body {
    display: flex;
    flex-direction: column;
    background-color: var(--background-color);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
  }
  main {
    flex: 1 0 auto;
  }
  a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
  }
  a:hover {
    color: var(--secondary-color);
  }
  
  /* ------------------------------------------------------------------
     Hero (común) y variantes por página
  ------------------------------------------------------------------ */
  .hero-section {
    position: relative;
    overflow: hidden; 
    padding: 3rem 0 4rem; /* Aumentado el padding inferior de 2rem a 4rem */
    margin-bottom: 3rem;
    color: white;
    border-radius: 0 0 2rem 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  }

  /* Pseudo-elemento desactivado - imagen ahora inline en HTML
  .hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../../assets/images/fondo.jpeg") !important;
  background-size: cover;
  background-position: center;
  z-index: 1;
  }
  */
.hero-section::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Ejemplo: gradiente de tu paleta, ajústalo según variables o inline */
  background: linear-gradient(
    to top,
    rgba(0, 122, 204, 0.75), /* Azul VS Code más opaco */
    rgba(5, 25, 60, 0.85)   /* Azul oscuro más intenso y profundo */
  );
  z-index: 2;
}

  .hero-section.text-center {
    padding-top: 1rem; /* Reducido de 1.5rem a 1rem */
  }
  .hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0; /* Eliminando todo el margen para subirlo más */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  /* Ajuste para el subtítulo - subiéndolo más */
  .hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0.5rem auto 1.2rem; /* Margen superior reducido, inferior también */
    text-align: center;
  }

  .hero-dependencia-text {
    color: #FFFFFF !important;
    opacity: 1 !important;
    position: relative;
    z-index: 3;
  }
  
/* Chat box en hero (página index) */
.hero-chat-box {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  z-index: 5;
}

.hero-chat-box i.bi-chat-text {
  position: absolute !important;
  left: 20px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 5 !important;
}

.hero-chat-box input.form-control {
  padding-left: 50px !important;
  height: 50px;
  position: relative;
  z-index: 4 !important;
}

.hero-chat-box .btn-primary {
  position: relative !important;
  z-index: 5 !important;
  padding: 0.75rem 1rem;
}

.hero-chat-box .form-control:focus {
  box-shadow: none;
}

.hero-section .logo-container,
.hero-section .hero-title,
.hero-section .hero-subtitle,
.hero-section .search-container {
  position: relative;
  z-index: 3;
}

/* Si AOS te mete transform y rompe el stacking, fuerza con :not(::before): */
.hero-section > *:not(::before):not(::after) {
  position: relative;
  z-index: 3;
}

  /* ------------------------------------------------------------------
   Logo en Hero
------------------------------------------------------------------ */
.logo-container {
   position: relative;
     z-index: 3;
  max-width: 240px;
  margin: 0 auto 0.2rem; /* Reducido aún más el margen inferior */
}

.logo-container img {
  width: 100%;            /* Ocupa el 100% del contenedor */
  height: auto;           /* Conserva la proporción */
}

  
  /* Página trámites */
  .hero-section.hero-tramites {
    padding: 6rem 0;

    
  }
  .hero-tramites .container {
    display: block;
  }
.hero-tramites .breadcrumb {
justify-content: flex-start;
background-color: rgba(255, 255, 255, 0.25);
padding: 0.5rem 1rem;
border-radius: 0.5rem;
margin-bottom: 2rem;
}
  .hero-tramites .hero-title {
    margin-bottom: 0.5rem;
  }
  .hero-tramites .hero-subtitle {
    margin-bottom: 2rem;
  }
  .hero-tramites .input-group {
    max-width: 600px;
    margin: 0 auto;
  }
  
  /* Página detalle */
  .hero-section.hero-detalle {
    padding: 6rem 0;
    position: relative;
  }
  .hero-detalle .container {
    display: block;
  }
.hero-detalle .breadcrumb {
justify-content: flex-start;
background-color: rgba(255, 255, 255, 0.25);
padding: 0.5rem 1rem;
border-radius: 0.5rem;
margin-bottom: 2rem;
}
  .hero-detalle .hero-title {
    margin-bottom: 0.5rem;
  }
  .hero-detalle .hero-subtitle {
    margin-bottom: 2.5rem;
  }
  .hero-detalle .input-group {
    max-width: 600px;
    margin: 0 auto;
  }
  
  /* Reducir tamaño de la tipografía del título del trámite en la página de detalle */
  .hero-section.hero-detalle .hero-title {
    font-size: 2rem; /* ajústalo al tamaño deseado */
  }
  
  /* ------------------------------------------------------------------
     Sección: trámites frecuentes
  ------------------------------------------------------------------ */
  .tramites-frecuentes-section {
    margin: 2.5rem 0 3.5rem;
  }
  .tramites-frecuentes-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .tramite-frecuente-card {
    background-color: white;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px var(--shadow-color);
  }
  .tramite-frecuente-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  }
  .tramite-frecuente-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .tramite-frecuente-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
  }
  .tramite-frecuente-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    background-color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
  }
  .tramite-frecuente-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
  }
  .tramite-frecuente-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .tramite-frecuente-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    flex: 1;
  }
  .tramite-frecuente-dependencia {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
  }
  .tramite-frecuente-dependencia i {
    margin-right: 0.5rem;
    color: var(--primary-color);
  }
  .tramite-frecuente-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    margin-top: auto;
  }
  .tramite-frecuente-link:hover {
    background-color: #0E639C;
  }
  
  /* ------------------------------------------------------------------
     Tarjetas de dependencia
  ------------------------------------------------------------------ */
  .dependencia-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px var(--shadow-color);
  }
  .dependencia-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  }
  .dependencia-card-header {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .dependencia-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    background-color: rgba(0, 122, 204, 0.1);
    color: var(--primary-color);
  }
  .dependencia-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
  }
  .dependencia-card-body {
    padding: 16px;
    flex: 1;
  }
  .dependencia-card-footer {
    padding: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: right;
  }
  .dependencia-card .dependencia-icon {
    margin-right: 0.75rem;  /* ajusta el valor al espacio que quieras */
  }
  .dependencia-stat {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 4px 0;
  }
  .dependencia-stat i {
    margin-right: 8px;
    color: var(--primary-color);
  }
  .btn-ver-dependencia {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
  }
  .btn-ver-dependencia:hover {
    background-color: #0E639C;
  }
  
  /* ------------------------------------------------------------------
     Tarjetas de trámite genéricas
  ------------------------------------------------------------------ */
  .tramite-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .tramite-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  }
  .tramite-card-header {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .tramite-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 122, 204, 0.1);
    color: var(--primary-color);
    margin-bottom: 8px;
  }
  .tramite-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
  }
  .tramite-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    align-self: flex-start;
  }
  .tramite-card-body {
    padding: 16px;
  }
  .tramite-dependencia {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
  }
  .tramite-dependencia i {
    margin-right: 8px;
    color: var(--text-secondary);
  }
  .tramite-card-footer {
    padding: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: right;
  }
  .btn-ver-tramite {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
  }
  .btn-ver-tramite:hover {
    background-color: #0E639C;
  }
  
  /* ------------------------------------------------------------------
     Detalle de trámite (info-section)
  ------------------------------------------------------------------ */
  .info-section {
    background-color: white;
    border-radius: 1.25rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.08);
    transition: all 0.3s ease;
  }
  .info-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.12);
  }
  .info-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
  }
  .info-content {
    background-color: var(--background-color);
    padding: 1rem;
    border-radius: 0.75rem;
  }
  
  /* ------------------------------------------------------------------
     Filtros y estados vacíos
  ------------------------------------------------------------------ */
  .filter-container {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }
  .filter-container .btn-group { margin-bottom: 15px; }
  .filter-container .btn { border-radius: 8px; margin-right: 5px; font-weight: 500; padding: 8px 16px; }
  .btn-outline-primary { border-color: #e2e8f0; color: #64748b; }
  .btn-outline-primary:hover, .btn-outline-primary.active { background-color: var(--primary-color); color: white; }
  .empty-state { text-align: center; padding: 3rem 1rem; }
  .empty-state i { font-size: 3rem; color: #d1d5db; margin-bottom: 1rem; }
  .empty-state h3 { font-size: 1.5rem; color: var(--text-primary); margin-bottom: 0.5rem; }
  .empty-state p { color: var(--text-secondary); max-width: 500px; margin: 0 auto; }
  
  /* ------------------------------------------------------------------
     Footer
  ------------------------------------------------------------------ */
  .footer {
    /* El color de fondo se asigna dinámicamente en functions_css.php */
    color: #F3F4F6;
    padding-top: 2rem;
    margin-top: 3rem; /* Espacio para que se vea el efecto de redondeo */
    width: 100%;
    left: 0;
    right: 0;
    border-radius: 2rem 2rem 0 0; /* Redondeo superior inverso al del hero */
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.12); /* Sombra superior, inversa a la del hero */
  }
  .footer h5 { font-weight: 600; font-size: 1.1rem; margin-bottom: 1.5rem; color: #F9FAFB; }
  .footer p, .footer a { color: #D1D5DB; transition: color 0.3s ease; }
  .footer a:hover { color: var(--primary-color); }
  .footer i { color: var(--primary-color); }
  .footer-link { display: inline-flex; align-items: center; gap: 0.5rem; }
  .social-links { display: flex; gap: 1rem; }
  .social-links a { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.1); transition: all 0.3s ease; }
  .social-links a:hover { background: rgba(255,255,255,0.15); transform: translateY(-3px); }
  .social-links a i { color: white !important; }
  .footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; font-size: 0.9rem; }
  
  /* ------------------------------------------------------------------
   Badges de tipo - SOLUCIÓN SIMPLE Y EFECTIVA
------------------------------------------------------------------ */

/* Base común para todos los badges - MISMA ESTRUCTURA EXACTA */
.type-badge { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  padding: 6px 12px; 
  border-radius: 20px; 
  font-size: 0.85rem; 
  font-weight: 500; 
  margin-left: 0.5rem;   
  width: 80px; /* Ancho FIJO, no mínimo */
  text-align: center;
  white-space: nowrap; 
  box-sizing: border-box;
}

/* Solo cambiar colores - ESTRUCTURA IDÉNTICA */
.type-badge.tramite-badge { 
  background-color: rgba(0,122,204,0.1); 
  color: #007ACC; 
  border: 1px solid rgba(0,122,204,0.2);
}

.type-badge.servicio-badge { 
  background-color: rgba(34,197,94,0.1); 
  color: #22C55E; 
  border: 1px solid rgba(34,197,94,0.2);
}

.type-badge.programa-badge { 
  background-color: rgba(139,92,246,0.1); 
  color: #8B5CF6; 
  border: 1px solid rgba(139,92,246,0.2);
}

/* Para badges de Bootstrap - MISMA LÓGICA */
.badge.tramite-badge,
.badge.servicio-badge, 
.badge.programa-badge {
  display: inline-flex !important; 
  align-items: center !important; 
  justify-content: center !important;
  padding: 6px 12px !important; 
  border-radius: 20px !important; 
  font-size: 0.85rem !important; 
  font-weight: 500 !important; 
  width: 80px !important; /* Ancho FIJO */
  text-align: center !important;
  white-space: nowrap !important; 
  box-sizing: border-box !important;
}

.badge.tramite-badge { 
  background-color: rgba(0,122,204,0.1) !important; 
  color: #007ACC !important; 
  border: 1px solid rgba(0,122,204,0.2) !important;
}

.badge.servicio-badge { 
  background-color: rgba(34,197,94,0.1) !important; 
  color: #22C55E !important; 
  border: 1px solid rgba(34,197,94,0.2) !important;
}

.badge.programa-badge { 
  background-color: rgba(139,92,246,0.1) !important; 
  color: #8B5CF6 !important; 
  border: 1px solid rgba(139,92,246,0.2) !important;
}
  /* ------------------------------------------------------------------
     Banda lateral coloreada (tramite y all-tramite)
  ------------------------------------------------------------------ */
  .tramite-item .tramite-card,
  .all-tramite-item .all-tramite-card {
    position: relative;
    overflow: hidden;
  }
  
  .tramite-item[data-tipo="Tramite"] .tramite-card::before,
  .tramite-item[data-tipo="Servicio"] .tramite-card::before,
  .tramite-item[data-tipo="Programa"] .tramite-card::before,
  .all-tramite-item[data-tipo="Tramite"] .all-tramite-card::before,
  .all-tramite-item[data-tipo="Servicio"] .all-tramite-card::before,
  .all-tramite-item[data-tipo="Programa"] .all-tramite-card::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
  }
  .tramite-item[data-tipo="Tramite"] .tramite-card::before,
  .all-tramite-item[data-tipo="Tramite"] .all-tramite-card::before { background: #007ACC; }
  .tramite-item[data-tipo="Servicio"] .tramite-card::before,
  .all-tramite-item[data-tipo="Servicio"] .all-tramite-card::before { background: #22C55E; }
  .tramite-item[data-tipo="Programa"] .tramite-card::before,
  .all-tramite-item[data-tipo="Programa"] .all-tramite-card::before { background: #8B5CF6; }

  /* ----------------------------------------
   Alinear breadcrumb con el ícono de usuario
  ---------------------------------------- */
  .hero-section.hero-tramites .breadcrumb {
    position: absolute;       /* para posicionarlo dentro de .hero-section */
    top: 1.5rem;              /* 1.5 rem desde el top de .hero-section */
    left: 1.5rem;             /* idem del lado izquierdo */
    margin-bottom: 0;         /* evita el gap extra que tenías */
    z-index: 3;               /* por encima del gradiente e imagen */
    background-color: rgba(255,255,255,0.25);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
  }
  .hero-tramites .breadcrumb .breadcrumb-item.active {
  color: white !important;
}

/* ------------------------------------------------------------------
   NAVEGACIÓN PRINCIPAL - DISEÑO COMPACTO Y RESPONSIVE
------------------------------------------------------------------ */

.navigation-section {
  background: white;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}

/* Pestañas principales en línea */
.main-tabs-grid {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.main-tab-btn {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 40px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #64748b;
  font-size: 0.85rem;
  flex: 1;
  justify-content: center;
  white-space: nowrap;
}

.main-tab-btn:hover {
  background: #f8fafc;
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.main-tab-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 6px rgba(0, 122, 204, 0.25);
}

.main-tab-btn i {
  font-size: 0.9rem;
}

/* Búsqueda rápida más compacta */
.quick-search-container {
  max-width: 100%;
}

.quick-search-container .form-control {
  border-radius: 0.375rem 0 0 0.375rem;
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  height: 38px;
  flex: 1;
}

.quick-search-container .btn {
  border-radius: 0 0.375rem 0.375rem 0;
  border: 1px solid #e2e8f0;
  border-left: none;
  padding: 0.5rem 0.75rem;
  height: 38px;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Filtros adicionales dentro del recuadro principal */
.todos-filters {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.inline-filters {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.inline-filter-btn {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #64748b;
  font-size: 0.85rem;
  white-space: nowrap;
  min-height: 42px;
}

.inline-filter-btn:hover {
  background: #f1f5f9;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.inline-filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.inline-filter-btn i {
  font-size: 0.85rem;
}

/* Responsive para móvil */
@media (max-width: 768px) {
  .navigation-section {
    padding: 0.75rem;
    margin-bottom: 1rem;
  }
  
  /* En móvil: 2x2 cuadrícula para pestañas principales */
  .main-tabs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }
  
  .main-tab-btn {
    padding: 0.6rem 0.4rem;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 50px;
    font-size: 0.75rem;
  }
  
  .main-tab-btn i {
    font-size: 1rem;
  }
  
  /* Filtros adicionales en móvil */
  .inline-filters {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .inline-filter-btn {
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    justify-content: flex-start;
    min-height: 44px;
  }
  
  .quick-search-container .form-control,
  .quick-search-container .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    height: 36px;
  }
  
  .quick-search-container .btn {
    min-width: 36px;
  }
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
  .navigation-section {
    padding: 0.5rem;
  }
  
  .main-tab-btn {
    padding: 0.5rem 0.25rem;
    min-height: 45px;
    font-size: 0.7rem;
  }
  
  .main-tab-btn i {
    font-size: 0.9rem;
  }
  
  .inline-filter-btn {
    padding: 0.6rem 0.75rem;
    font-size: 0.75rem;
    min-height: 40px;
  }
}
.custom-breadcrumb {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.25);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 3;
}

.breadcrumb-link {
  color: white;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.breadcrumb-link:hover {
  opacity: 0.8;
  color: white;
  text-decoration: none;
}

.breadcrumb-separator {
  color: white;
  margin: 0 0.5rem;
  opacity: 0.7;
}

.breadcrumb-current {
  color: white;
  font-weight: 500;
}

/* Breadcrumb custom responsive */
@media (max-width: 768px) {
  .custom-breadcrumb {
    position: static;
    margin-bottom: 1rem;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
  }
  
  .breadcrumb-link,
  .breadcrumb-separator,
  .breadcrumb-current {
    color: white;
  }
}

/* ------------------------------------------------------------------
   MENSAJES DE NO RESULTADOS EN FILTROS
------------------------------------------------------------------ */
.no-results-filter-message .alert {
  border-radius: 1rem;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.no-results-filter-message .alert i {
  font-size: 1.2rem;
}

.no-results-filter-message .alert strong {
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.5rem;
}

.no-results-filter-message .alert span {
  font-size: 0.95rem;
  opacity: 0.8;
}

/* Estilos para botones de filtro con contadores */
.filter-container .btn .badge {
  font-size: 0.75rem;
  padding: 0.25em 0.5em;
}

.filter-container .btn.disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.filter-container .btn.disabled .badge {
  background-color: #6c757d !important;
  color: white !important;
}

/* ------------------------------------------------------------------
   CORRECCIÓN BREADCRUMB - TODO BLANCO SIEMPRE
------------------------------------------------------------------ */

/* SOLUCIÓN NUCLEAR: Forzar color blanco en todos los elementos del breadcrumb */
.custom-breadcrumb,
.custom-breadcrumb *,
.breadcrumb-link,
.breadcrumb-separator,
.breadcrumb-current {
    color: #ffffff !important;
}

/* Asegurar que NO haya color azul en hover o active en móviles */
@media (max-width: 768px) {
    .custom-breadcrumb *,
    .custom-breadcrumb,
    .breadcrumb-link,
    .breadcrumb-separator,
    .breadcrumb-current,
    .breadcrumb-link:hover,
    .breadcrumb-link:focus,
    .breadcrumb-link:active,
    .breadcrumb-link:visited {
        color: #ffffff !important;
        text-decoration: none !important;
    }
    
    /* Eliminar cualquier color heredado de Bootstrap o otros estilos */
    .hero-section .custom-breadcrumb *,
    .hero-tramites .custom-breadcrumb *,
    .hero-detalle .custom-breadcrumb *,
    .hero-section .breadcrumb-current,
    .hero-tramites .breadcrumb-current,
    .hero-detalle .breadcrumb-current {
        color: #ffffff !important;
        text-decoration: none !important;
    }
    
    /* Forzar también en elementos span y a */
    .custom-breadcrumb span,
    .custom-breadcrumb a {
        color: #ffffff !important;
    }
}

/* Para asegurar compatibilidad con diferentes tamaños de pantalla */
@media (max-width: 992px) {
    .breadcrumb-current {
        color: #ffffff !important;
    }
}

/* Corrección adicional para pantallas pequeñas */
@media (max-width: 480px) {
    .custom-breadcrumb {
        background-color: rgba(255, 255, 255, 0.15) !important;
    }
    
    .custom-breadcrumb *,
    .breadcrumb-current {
        color: #ffffff !important;
        font-weight: 500 !important;
    }
}

  .hero-section.hero-detalle  .breadcrumb {
    position: absolute;
    top: 1.5rem;       /* ajusta hasta que quede justo al nivel del ícono */
    left: 1.5rem;      /* mantiene la misma separación del borde izquierdo */
    margin-bottom: 0;  /* elimina el espacio inferior */
    z-index: 2;        /* para que quede encima del fondo */
  }

  /* ------------------------------------------------------------
     Ajuste extra: bajar título/subtítulo y subir contenido post-hero
  -------------------------------------------------------------*/
  /* 1) Hacer el hero un poco más alto arriba y más compacto abajo */
  .hero-section.hero-tramites,
  .hero-section.hero-detalle {
    padding: 5rem 0 1rem;    /* antes 4rem 0 2rem; sube el contenido interno */
    margin-bottom: 0.75rem;  /* reduce el gap antes de la sección principal */
  }

  /* 2) Bajar aún más el título y el subtítulo */
  .hero-section.hero-tramites .hero-title,
  .hero-section.hero-detalle  .hero-title {
    margin-top: 1rem;   /* antes 2rem; separa del breadcrumb/icono */
  }
  .hero-section.hero-tramites .hero-subtitle,
  .hero-section.hero-detalle  .hero-subtitle {
    margin-top: 1rem;   /* antes 0.5rem; acerca el subtítulo al título */
  }

  /* 3) Subir la sección de contenido principal sin pegarla */
  .container.main-content {
    margin-top: -0.5rem; /* mueve hacia arriba el contenido tras el hero */
  }

  .hero-section .logo-container,
  .hero-section .hero-title,
  .hero-section .hero-subtitle,
  .hero-section .search-container,
  .hero-section .hero-chat-box,
  .hero-section .btn,
  .hero-section .breadcrumb,
  .hero-section form,
  .hero-section input,
  .hero-section i,
  .hero-section a {
    position: relative;
    z-index: 3; /* Mayor que el z-index del gradiente (2) */
  }

  .hero-content {
    position: relative;
    z-index: 3;   /* Mayor que 2 (gradiente) y 1 (imagen) */
  }

  /* 1) Evita que .hero-content actúe como contenedor posicionado para el breadcrumb */
  .hero-section.hero-tramites .hero-content {
    position: static !important;
    z-index: auto !important;
  }

  /* 2) Ahora posiciona el breadcrumb respecto a .hero-section */
  .hero-section.hero-tramites .breadcrumb {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    margin-bottom: 0;   /* quita el gap que tenías */
    z-index: 3;         /* por encima de ::after y ::before */
  }

  /* 3) Eleva también el título y subtítulo para que floten sobre el gradiente */
  .hero-section.hero-tramites .hero-title,
  .hero-section.hero-tramites .hero-subtitle {
    position: relative;
    z-index: 3;
  }
  /* 1) Quitar el contexto de apilamiento para el wrapper */
  .hero-section.hero-tramites .hero-content,
  .hero-section.hero-detalle  .hero-content {
    position: static !important;
    z-index: auto     !important;
  }

  /* 2) Posicionar el breadcrumb respecto a la sección padre */
  .hero-section.hero-tramites .breadcrumb,
  .hero-section.hero-detalle  .breadcrumb {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    margin-bottom: 0;
    z-index: 3;       /* encima de ::after y ::before */
  }

  /* 3) Elevar título y subtítulo sobre el gradiente */
  .hero-section.hero-tramites .hero-title,
  .hero-section.hero-tramites .hero-subtitle,
  .hero-section.hero-detalle  .hero-title,
  .hero-section.hero-detalle  .hero-subtitle {
    position: relative;
    z-index: 3;
  }
  /* Eleva todos los botones dentro de los hero de trámites/detalle */
  .hero-section.hero-tramites .btn,
  .hero-section.hero-detalle .btn {
    position: relative;
    z-index: 3;  /* > 2 del gradiente y > 1 de la imagen */
  }

  /* ========================================
     MOBILE RESPONSIVE IMPROVEMENTS
     ======================================== */

  /* ------------------------------------------------------------------
     1. INDEX PAGE HERO SECTION MOBILE FIXES
  ------------------------------------------------------------------ */

  /* Fix for subtitle text sticking to margin on mobile */
  @media (max-width: 768px) {
    .hero-subtitle {
      font-size: 1.1rem !important;
      opacity: 0.9;
      max-width: 100% !important;
      margin: 0.5rem 1rem 1.2rem !important; /* Add horizontal margins */
      padding: 0 0.5rem !important; /* Additional padding */
      text-align: center;
      line-height: 1.4 !important; /* Better line spacing */
    }
    
    /* Improve hero title spacing on mobile */
    .hero-title {
      font-size: 1.8rem !important;
      margin: 0 1rem !important; /* Add horizontal margins */
      padding: 0 0.5rem !important;
    }
    
    /* Better logo sizing on mobile */
    .logo-container {
      max-width: 200px !important;
      margin: 0 auto 0.5rem !important;
    }
    
    .logo-container img {
      width: 100% !important;
      height: auto !important;
      max-width: 200px !important;
    }

    /* Index móvil: caja de chat más angosta y centrada */
    .hero-chat-box {
      max-width: 95% !important;
      margin: 0 auto !important;
      padding: 0 0.5rem !important;
    }
    
    .hero-chat-box .form-control {
      font-size: 0.9rem !important;
      padding: 0.75rem 1rem 0.75rem 50px !important;
      height: 48px !important;
    }
    
    .hero-chat-box .btn-primary {
      padding: 0.75rem 1rem !important;
      font-size: 0.9rem !important;
    }
    
    .hero-chat-box i.bi-chat-text {
      font-size: 1.1rem !important;
      left: 17px !important;
    }

    /* Oculta por completo el bloque de estadísticas en pantallas pequeñas */
    .stats-container {
      display: none !important;
    }

    /* Hero section padding adjustments */
    .hero-section { 
      padding: 1rem 0 3rem; 
    }
    
    .search-box { 
      margin: 0 1rem; 
    }
    
    .stat-item { 
      margin-bottom: 15px; 
    }
    
    .filter-container .row > div { 
      margin-bottom: 10px; 
    }
    
    .tramite-meta { 
      flex-direction: column; 
      gap: 5px; 
    }
    
    .footer { 
      text-align: center; 
    }
    
    .social-links { 
      justify-content: center; 
      margin-top: 1rem; 
    }
    
    .footer-bottom { 
      text-align: center !important; 
      margin-top: 1rem; 
    }
  }

  /* ------------------------------------------------------------------
     2. NAVIGATION TABS RESPONSIVE LAYOUT
  ------------------------------------------------------------------ */

  /* Mobile-first approach for navigation tabs and search */
  @media (max-width: 768px) {
    /* Stack navigation and search vertically */
    .d-flex.justify-content-between.align-items-center {
      flex-direction: column !important;
      gap: 1rem !important;
      align-items: stretch !important;
    }
    
    /* Container for scrollable tabs */
    .nav-tabs .nav-link {
      padding: 0.75rem 0.5rem !important;
      font-size: 0.8rem !important;
      border: 1px solid #dee2e6 !important;
      border-radius: 0.375rem !important;
      margin: 0 !important;
      text-align: center !important;
      background: white !important;
    }
    
    .nav-tabs .nav-link.active {
      background: var(--primary-color) !important;
      color: white !important;
      border-color: var(--primary-color) !important;
    }
    
    /* First row tabs */
    .nav-tabs .nav-item:nth-child(1) .nav-link {
      border-bottom-left-radius: 0 !important;
      border-bottom-right-radius: 0 !important;
    }
    
    .nav-tabs .nav-item:nth-child(2) .nav-link {
      border-bottom-left-radius: 0 !important;
      border-bottom-right-radius: 0 !important;
      border-left: none !important;
    }
    
    /* Second row tabs */
    .nav-tabs .nav-item:nth-child(3) .nav-link {
      border-top-left-radius: 0 !important;
      border-top-right-radius: 0 !important;
      border-top: none !important;
    }
    
    .nav-tabs .nav-item:nth-child(4) .nav-link {
      border-top-left-radius: 0 !important;
      border-top-right-radius: 0 !important;
      border-top: none !important;
      border-left: none !important;
    }
  }
/* ------------------------------------------------------------------
   3. SPECIFIC MOBILE NAVIGATION FIXES FOR VERY SMALL SCREENS
   (MANTENIENDO COLORES ORIGINALES)
------------------------------------------------------------------ */

/* Two-row layout for tabs when needed */
@media (max-width: 576px) {
  .nav-tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: repeat(2, auto) !important;
    gap: 0.25rem !important;
    width: 100% !important;
    border-bottom: 1px solid #dee2e6 !important;
    min-width: auto !important;
  }
  
  .nav-tabs .nav-item {
    margin: 0 !important;
  }
  
  .nav-tabs .nav-link {
    padding: 0.75rem 0.5rem !important;
    font-size: 0.8rem !important;
    border-radius: 0.375rem !important;
    margin: 0 !important;
    text-align: center !important;
    /* Mantener colores originales de Bootstrap */
    background: transparent !important;
    color: #495057 !important;
    border: 1px solid transparent !important;
    border-bottom-color: #dee2e6 !important;
  }
  
  .nav-tabs .nav-link.active {
    /* Mantener estilo activo original */
    background: #fff !important;
    color: var(--primary-color) !important;
    border-color: #dee2e6 #dee2e6 #fff !important;
  }
  
  .nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6 !important;
  }
}

/* ------------------------------------------------------------------
   4. CONTENT CARDS RESPONSIVE IMPROVEMENTS
------------------------------------------------------------------ */

@media (max-width: 768px) {
  /* Better card grid on mobile */
  .tramites-frecuentes-section .row > div,
  .row .col-lg-3,
  .row .col-md-4,
  .row .col-sm-6 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 1rem !important;
    padding: 0 0.75rem !important;
  }
  
  /* Card improvements - mantener colores originales */
  .tramite-frecuente-card,
  .dependencia-card,
  .tramite-card,
  .all-tramite-card {
    margin-bottom: 1rem !important;
    border-radius: 0.75rem !important;
    /* Mantener colores de fondo originales */
  }
  
  /* Better card titles */
  .tramite-frecuente-title,
  .dependencia-title,
  .tramite-title {
    font-size: 1rem !important;
    line-height: 1.3 !important;
  }
  
  /* Improved card padding */
  .tramite-frecuente-body,
  .dependencia-card-body,
  .tramite-card-body {
    padding: 1rem 0.75rem !important;
  }
}

/* ------------------------------------------------------------------
   5. BREADCRUMB AND HERO FIXES FOR OTHER PAGES
------------------------------------------------------------------ */

@media (max-width: 768px) {
  /* Better breadcrumb positioning */
  .hero-section.hero-tramites .breadcrumb,
  .hero-section.hero-detalle .breadcrumb {
    position: static !important;
    margin-bottom: 1rem !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.85rem !important;
  }
  
  /* FORZAR color blanco del breadcrumb activo en móvil con máxima especificidad */
  .hero-section.hero-tramites .breadcrumb .breadcrumb-item.active,
  .hero-section.hero-detalle .breadcrumb .breadcrumb-item.active,
  .hero-tramites .breadcrumb .breadcrumb-item.active,
  .hero-detalle .breadcrumb .breadcrumb-item.active {
    color: white !important;
  }
  
  /* Hero section padding adjustments */
  .hero-section.hero-tramites,
  .hero-section.hero-detalle {
    padding: 2rem 0 1.5rem !important;
    margin-bottom: 1rem !important;
  }
  
  /* Container margin adjustments */
  .container.main-content {
    margin-top: 0 !important;
    padding: 1rem 0.75rem !important;
  }
}

/* ------------------------------------------------------------------
   6. FILTER CONTAINER MOBILE IMPROVEMENTS 
------------------------------------------------------------------ */

@media (max-width: 768px) {
  .filter-container {
    margin-bottom: 1.5rem !important;
    padding: 1rem 0.75rem !important;
    border-radius: 0.75rem !important;
    /* Mantener color de fondo original */
    background-color: #fff !important;
  }
  
  .filter-container .btn-group {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  
  .filter-container .btn {
    flex: 1 1 calc(50% - 0.25rem) !important;
    font-size: 0.85rem !important;
    padding: 0.5rem 0.75rem !important;
    margin-right: 0 !important;
    border-radius: 0.5rem !important;
    /* Mantener colores originales de botones */
  }
  
  /* Mantener colores originales para botones de filtro */
  .filter-container .btn-outline-primary {
    border-color: #e2e8f0 !important;
    color: #64748b !important;
  }
  
  .filter-container .btn-outline-primary:hover,
  .filter-container .btn-outline-primary.active {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
  }
}

/* ------------------------------------------------------------------
   7. TAB CONTENT AND SEARCH IMPROVEMENTS
------------------------------------------------------------------ */

@media (max-width: 768px) {
  /* Tab content spacing */
  .tab-content {
    margin-top: 1rem !important;
  }
  
  .tab-pane {
    padding: 0 !important;
  }
  
  /* Better content cards in tab panes */
  .tab-pane .row {
    margin: 0 !important;
  }
  
  .tab-pane .row > div {
    padding: 0 0.5rem 1rem !important;
  }
  
  /* Search results improvements */
  .tab-pane .alert {
    margin: 1rem 0.5rem !important;
    border-radius: 0.5rem !important;
  }
  
  /* Quick search improvements */
  .mini-search .input-group-sm .form-control {
    font-size: 14px !important;
    padding: 0.5rem 0.75rem !important;
  }
  
  .mini-search .btn-outline-secondary {
    padding: 0.5rem 0.75rem !important;
    border-color: #ced4da !important;
  }
}

/* ------------------------------------------------------------------
   8. FORM AND INPUT IMPROVEMENTS
------------------------------------------------------------------ */

@media (max-width: 768px) {
  /* Better form controls on mobile */
  .form-control {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 0.75rem !important;
  }
  
  .btn {
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
  }
  
  .input-group {
    flex-wrap: nowrap !important;
  }
  
  /* Search improvements */
  .search-container {
    margin: 1rem 0.5rem !important;
  }
}

/* ------------------------------------------------------------------
   9. MENU TOGGLE BUTTON IMPROVEMENTS
------------------------------------------------------------------ */

@media (max-width: 768px) {
  .menu-toggle-btn {
    top: 15px !important;
    right: 15px !important;
    font-size: 24px !important;
    padding: 0.5rem !important;
    background: rgba(0, 0, 0, 0.1) !important;
    border-radius: 0.5rem !important;
    backdrop-filter: blur(10px) !important;
  }
  
  .menu-dropdown {
    top: 60px !important;
    right: 15px !important;
    left: 15px !important;
    min-width: auto !important;
    max-width: none !important;
  }
}

/* ------------------------------------------------------------------
   10. ACCESSIBILITY IMPROVEMENTS
------------------------------------------------------------------ */

@media (max-width: 768px) {
  /* Larger touch targets */
  .btn,
  .nav-link,
  .dropdown-item,
  .menu-dropdown-item {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Better focus states */
  .btn:focus,
  .form-control:focus,
  .nav-link:focus {
    outline: 2px solid var(--primary-color) !important;
    outline-offset: 2px !important;
  }
}

/* ------------------------------------------------------------------
   11. ADDITIONAL UTILITY CLASSES FOR MOBILE
------------------------------------------------------------------ */

@media (max-width: 768px) {
  /* Hide elements that are not essential on mobile */
  .mobile-hidden {
    display: none !important;
  }
  
  /* Full width on mobile */
  .mobile-full-width {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Reduced padding on mobile */
  .mobile-padding-sm {
    padding: 0.5rem !important;
  }
  
  /* Smaller text on mobile */
  .mobile-text-sm {
    font-size: 0.85rem !important;
  }
  
  /* Better spacing */
  .mobile-mb-1 {
    margin-bottom: 0.5rem !important;
  }
  
  .mobile-mb-2 {
    margin-bottom: 1rem !important;
  }
}

/* ------------------------------------------------------------------
   12. STATS CONTAINER MOBILE OPTIMIZATION
------------------------------------------------------------------ */

@media (max-width: 768px) {
  .stats-container {
    margin: 1.5rem 0.5rem !important;
    padding: 1rem 0.5rem !important;
  }
  
  .stats-container .row {
    gap: 0.5rem !important;
  }
  
  .stat-item {
    flex: 1 1 auto !important;
    margin-bottom: 0.5rem !important;
    text-align: center !important;
  }
  
  .stat-number {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
  }
  
  .stat-label {
    font-size: 0.8rem !important;
    margin-top: 0.25rem !important;
  }
}

/* ------------------------------------------------------------------
   13. CARD HOVER EFFECTS FOR MOBILE
------------------------------------------------------------------ */

@media (max-width: 768px) {
  /* Touch-friendly card interactions */
  .card-hover-effect:active,
  .tramite-card:active,
  .dependencia-card:active,
  .all-tramite-card:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
  }
  
  /* Disable hover effects on touch devices */
  .touch-device .card-hover-effect:hover {
    transform: translateY(0) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  }
}

/* ------------------------------------------------------------------
   14. MODAL AND OVERLAY IMPROVEMENTS FOR MOBILE
------------------------------------------------------------------ */

@media (max-width: 768px) {
  .modal {
    padding: 0.5rem !important;
  }
  
  .modal-dialog {
    margin: 0.5rem !important;
    max-width: calc(100% - 1rem) !important;
  }
  
  .modal-content {
    border-radius: 0.75rem !important;
  }
  
  .modal-header,
  .modal-footer {
    padding: 1rem 0.75rem !important;
  }
  
  .modal-body {
    padding: 0.75rem !important;
  }
}

/* ------------------------------------------------------------------
   15. RESPONSIVE TYPOGRAPHY
------------------------------------------------------------------ */

@media (max-width: 768px) {
  h1 { font-size: 1.75rem !important; }
  h2 { font-size: 1.5rem !important; }
  h3 { font-size: 1.25rem !important; }
  h4 { font-size: 1.1rem !important; }
  h5 { font-size: 1rem !important; }
  h6 { font-size: 0.9rem !important; }
  
  .display-1 { font-size: 2.5rem !important; }
  .display-2 { font-size: 2rem !important; }
  .display-3 { font-size: 1.75rem !important; }
  .display-4 { font-size: 1.5rem !important; }
  
  .lead {
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
  }
}

/* ------------------------------------------------------------------
   16. LOADING STATES AND ANIMATIONS
------------------------------------------------------------------ */

@media (max-width: 768px) {
  /* Reduced motion for better mobile performance */
  @media (prefers-reduced-motion: reduce) {
    .card-hover-effect,
    .tramite-card,
    .dependencia-card {
      transition: none !important;
    }
    
    .card-animation-fadeInUp,
    .card-animation-popIn,
    .card-animation-slideInRight,
    .card-animation-slideInLeft {
      animation: none !important;
    }
  }
  
  /* Loading spinner for mobile */
  .mobile-loading {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 200px !important;
  }
  
  .mobile-loading .spinner-border {
    width: 2rem !important;
    height: 2rem !important;
  }
}

/* ------------------------------------------------------------------
   17. PRINT STYLES (MOBILE FRIENDLY)
------------------------------------------------------------------ */

@media print {
  .hero-section,
  .stats-container,
  .nav-tabs,
  .mini-search,
  .btn,
  .menu-toggle-btn,
  .menu-dropdown {
    display: none !important;
  }
  
  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  
  .card {
    page-break-inside: avoid !important;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* ------------------------------------------------------------------
   18. LANDSCAPE ORIENTATION FIXES
------------------------------------------------------------------ */

@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    padding: 1rem 0 2rem !important;
  }
  
  .hero-title {
    font-size: 1.5rem !important;
  }
  
  .hero-subtitle {
    font-size: 1rem !important;
    margin: 0.25rem 1rem 1rem !important;
  }
  
  .logo-container {
    max-width: 150px !important;
  }
}

/* ------------------------------------------------------------------
   19. HIGH DPI SCREEN OPTIMIZATIONS
------------------------------------------------------------------ */

@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2), 
       (max-width: 768px) and (min-resolution: 2dppx) {
  .card {
    border-width: 0.5px !important;
  }
  
  .btn {
    border-width: 0.5px !important;
  }
  
  .nav-tabs .nav-link {
    border-width: 0.5px !important;
  }
}

@media (max-width: 768px) {
  .hero-section .breadcrumb .breadcrumb-item.active {
    color: #ffffff !important;
  }
}

@media (max-width: 768px) {
  .custom-breadcrumb,
  .custom-breadcrumb *,
  .breadcrumb-link,
  .breadcrumb-separator,
  .breadcrumb-current,
  .breadcrumb-item.active,
  .hero-section .breadcrumb *,
  .hero-tramites .breadcrumb *,
  .hero-detalle .breadcrumb * {
    color: #ffffff !important;
  }
}

.hero-section .breadcrumb .breadcrumb-item.active {
  color: #ffffff !important;
}

/* FIX DEFINITIVO BREADCRUMB MÓVIL */
@media (max-width: 768px) {
  body .hero-section .custom-breadcrumb .breadcrumb-current,
  body .hero-section .breadcrumb .breadcrumb-item.active {
    color: white !important;
    text-decoration: none !important;
  }
}

/* FIX DEFINITIVO BREADCRUMB MÓVIL CON ID */
@media (max-width: 768px) {
  #page-breadcrumb .breadcrumb-item.active,
  #page-breadcrumb .breadcrumb-current {
    color: white !important;
    text-decoration: none !important;
  }
}

/* ÚLTIMO INTENTO: Forzar color en enlaces de breadcrumb activo en móvil */
@media (max-width: 768px) {
  #page-breadcrumb .breadcrumb-item.active a,
  #page-breadcrumb .breadcrumb-current a,
  #page-breadcrumb .breadcrumb-item.active,
  #page-breadcrumb .breadcrumb-current {
    color: white !important;
    text-decoration: none !important;
  }

  #page-breadcrumb .breadcrumb-item.active a:link,
  #page-breadcrumb .breadcrumb-item.active a:visited,
  #page-breadcrumb .breadcrumb-item.active a:hover,
  #page-breadcrumb .breadcrumb-item.active a:active,
  #page-breadcrumb .breadcrumb-current a:link,
  #page-breadcrumb .breadcrumb-current a:visited,
  #page-breadcrumb .breadcrumb-current a:hover,
  #page-breadcrumb .breadcrumb-current a:active {
    color: white !important;
    text-decoration: none !important;
  }
}
