/* ===== VARIABLES CSS OPTIMIZADAS ===== */
:root {
  /* Colores principales */
  --rojo-judicial: #8B0000;
  --rojo-claro: #A52A2A;
  --rojo-oscuro: #700000;
  --dorado-judicial: #D4AF37;

  /* Escala de grises */
  --plomo-judicial: #5A5A5A;
  --plomo-oscuro: #3A3A3A;
  --plomo-claro: #F5F5F5;
  --blanco: #FFFFFF;

  /* Colores secundarios */
  --crema-judicial: #F8F4E9;
  --crema-oscuro: #E8E2D1;

  /* Efectos */
  --sombra: 0 10px 30px rgba(0,0,0,0.1);
  --sombra-intensa: 0 15px 40px rgba(0,0,0,0.15);

  /* Transiciones */
  --transicion-rapida: all 0.3s ease;
  --transicion-media: all 0.5s cubic-bezier(.25, .46, .45, .94);
}

/* ===== ESTILOS BASE OPTIMIZADOS ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  color: #333;
  background-color: var(--blanco);
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, h5 {
  font-family: 'Merriweather', serif;
  font-weight: 700;
  line-height: 1.2;
}

/* ===== LAYOUT REUTILIZABLE ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.section-title {
  color: var(--rojo-judicial);
  position: relative;
  margin-bottom: 4rem;
  font-weight: 700;
  text-align: center;
  font-size: 2.8rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 5px;
  background: linear-gradient(90deg, var(--rojo-judicial), var(--dorado-judicial));
  border-radius: 3px;
}

/* ===== BOTONES OPTIMIZADOS ===== */
.btn-judicial {
  background: linear-gradient(135deg, var(--rojo-judicial), var(--rojo-oscuro));
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transicion-rapida);
  box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-judicial:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(139, 0, 0, 0.4);
  color: white;
}

.btn-outline-judicial {
  background: transparent;
  color: white;
  border: 2px solid white;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transicion-rapida);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-outline-judicial:hover {
  background: white;
  color: var(--rojo-judicial);
}

/* ===== NAVBAR OPTIMIZADO ===== */
.navbar {
  background: transparent !important;
  box-shadow: none !important;
  padding: 16px 0;
  transition: background .25s ease, box-shadow .25s ease, padding .25s ease;
}

.navbar.scrolled {
  background: rgba(139, 0, 0, .97) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
  padding: 12px 0;
}

.navbar-brand {
  display: flex;
  align-items: center;
  color: white !important;
  font-weight: 700;
  font-size: 1.5rem;
  text-decoration: none;
}

.navbar-brand img {
  height: 50px;
  margin-right: 10px;
}

.navbar-brand i {
  margin-right: 10px;
  font-size: 1.8rem;
  color: white !important;
}

/* Botón de retroceso */
.btn-outline-judicial-back {
  background: transparent;
  color: white;
  border: 2px solid white;
  padding: 10px 25px;
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transicion-rapida);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-outline-judicial-back:hover {
  background: white;
  color: var(--rojo-judicial);
  transform: translateX(-5px);
}

/* ===== CORRECCIÓN ESPECÍFICA PARA EL MENÚ SERVICIOS ===== */
.navbar-nav .nav-item.dropdown > .nav-link {
  position: relative;
}

.navbar-nav .nav-item.dropdown > .nav-link::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 0 !important;
  height: 3px !important;
  background: linear-gradient(90deg, var(--rojo-judicial), var(--dorado-judicial)) !important;
  transition: width 0.4s cubic-bezier(.25, .46, .45, .94) !important;
  border-radius: 2px !important;
  display: block !important;
}

.navbar-nav .nav-item.dropdown > .nav-link:hover::after {
  width: 100% !important;
}

.navbar-nav .nav-item.dropdown.show > .nav-link::after {
  width: 100% !important;
  background: linear-gradient(90deg, var(--dorado-judicial), #b8941f) !important;
}

.navbar-nav .nav-item.dropdown > .nav-link.dropdown-toggle::after {
  display: none !important;
}

.navbar-nav .nav-item.dropdown > .nav-link::before {
  content: '\f078' !important;
  font-family: 'Font Awesome 6 Free' !important;
  font-weight: 900 !important;
  margin-left: 5px !important;
  font-size: 0.8em !important;
  display: inline-block !important;
  transition: transform 0.3s ease !important;
}

.navbar-nav .nav-item.dropdown.show > .nav-link::before {
  transform: rotate(-180deg) !important;
}

/* ===== ESTILOS GENERALES PARA NAV-LINKS ===== */
.nav-link {
  color: #fff !important;
  font-weight: 600;
  margin: 0 12px;
  position: relative;
  font-size: 1.05rem;
  transition: color .3s;
}

.navbar .container {
  display: flex;
  align-items: center;
}

.navbar-toggler {
  margin-left: auto;
  border: none;
  padding: 4px 8px;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-collapse {
  justify-content: flex-end;
}

/* ===== ESTILOS PARA EL MENÚ DESPLEGABLE ===== */
.dropdown-menu {
  background: linear-gradient(135deg, var(--rojo-judicial) 0%, var(--rojo-oscuro) 100%) !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: var(--sombra-intensa) !important;
  padding: 10px 0 !important;
  min-width: 250px !important;
  margin-top: 10px !important;
}

.dropdown-item {
  color: white !important;
  padding: 12px 20px !important;
  font-weight: 500 !important;
  transition: var(--transicion-rapida) !important;
  position: relative !important;
}

.dropdown-item::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 3px !important;
  height: 0 !important;
  background: linear-gradient(135deg, var(--dorado-judicial), #b8941f) !important;
  transition: height 0.3s ease !important;
  border-radius: 0 3px 3px 0 !important;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  padding-left: 25px !important;
}

.dropdown-item:hover::before {
  height: 60% !important;
}

.dropdown-divider {
  border-color: rgba(255, 255, 255, 0.2) !important;
  margin: 8px 15px !important;
}

@media (max-width: 992px) {
  .dropdown-menu {
    background: rgba(139, 0, 0, 0.95) !important;
    box-shadow: none !important;
    border-radius: 0 0 10px 10px !important;
    margin-top: 0 !important;
  }
  
  .dropdown-item {
    padding: 10px 15px !important;
  }
  
  .navbar-nav .nav-item.dropdown > .nav-link::before {
    display: none !important;
  }
}

/* ===== HERO SECTIONS OPTIMIZADAS ===== */
.hero, .herosub {
  background: linear-gradient(135deg, var(--rojo-judicial) 0%, var(--rojo-oscuro) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero {
  padding: 110px 0 50px;
  min-height: 53vh;
}

.herosub {
  padding: 80px 0 20px;
  min-height: 30vh;
}

.hero::before, .herosub::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.08" d="M0,224L48,213.3C96,203,192,181,288,181.3C384,181,480,203,576,192C672,181,768,139,864,128C960,117,1056,139,1152,149.3C1248,160,1344,160,1392,160L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') center/cover no-repeat;
  animation: wave 25s linear infinite;
}

@keyframes wave {
  0% { transform: translateX(0); }
  50% { transform: translateX(-80px); }
  100% { transform: translateX(0); }
}

.hero-content, .herosub-content {
  position: relative;
  z-index: 1;
  padding-top: 20px;
}

.hero h1, .herosub-content h1 {
  margin-bottom: 1.8rem;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 1.2s ease .5s forwards;
  text-shadow: 0 5px 15px rgba(0, 0, 0, .2);
}

.hero h1 {
  font-size: 4rem;
}

.herosub-content h1 {
  font-size: 3.5rem;
}

.hero p, .herosub-content p {
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 1.2s ease .8s forwards;
  line-height: 1.6;
}

.hero p {
  font-size: 1.3rem;
}

.herosub-content p {
  font-size: 1.25rem;
}

.hero-buttons {
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 1.2s ease 1.1s forwards;
  margin-top: 20px;
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== LOGO JUDICIAL RESPONSIVE ===== */
.judicial-logo-img {
  max-width: 155px;
  width: 100%;
  height: auto;
  filter: brightness(0) invert(1) drop-shadow(0 8px 20px rgba(149, 2, 2, 0.5));
  transition: all 0.4s cubic-bezier(.25, .46, .45, .94);
}

.judicial-symbol:hover .judicial-logo-img {
  transform: scale(1.08) rotate(2deg);
  filter: brightness(0) invert(1) drop-shadow(0 15px 35px rgb(200, 200, 200));
}

/* ===== ANIMACIONES JUDICIALES OPTIMIZADAS ===== */
.judicial-symbol {
  animation: pulse 2s infinite;
  margin-bottom: 2rem;
  position: relative;
}

.judicial-symbol::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  z-index: -1;
  animation: ripple 3s infinite;
}

.judicial-symbol::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  z-index: -2;
  animation: ripple 3s infinite 0.5s;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes ripple {
  0% { width: 150px; height: 150px; opacity: 0.8; }
  100% { width: 300px; height: 300px; opacity: 0; }
}

.animated-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  animation: bounce 1.4s infinite ease-in-out;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ===== SECCIONES COMUNES OPTIMIZADAS ===== */
.services-section, .search-section {
  padding: 120px 0;
  background: linear-gradient(135deg, var(--plomo-claro) 0%, #e9ecef 100%);
  position: relative;
  overflow: hidden;
}

.services-section::before, .search-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.5" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,192C1248,192,1344,128,1392,96L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') center/cover no-repeat;
}

/* ===== SECCIÓN RESUMEN DE SERVICIOS ===== */
.services-overview {
  padding: 120px 0;
  background: linear-gradient(135deg, var(--plomo-claro) 0%, #e9ecef 100%);
  position: relative;
  overflow: hidden;
}

.services-overview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.5" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,192C1248,192,1344,128,1392,96L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') center/cover no-repeat;
}

/* ===== COMPONENTES DE TARJETAS OPTIMIZADOS ===== */
.service-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--sombra);
  transition: var(--transicion-media);
  border: 1px solid rgba(0, 0, 0, .05);
  position: relative;
  overflow: hidden;
  z-index: 1;
  height: 100%;
  text-align: center;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(135deg, var(--rojo-judicial), var(--rojo-oscuro));
  transition: height .5s cubic-bezier(.25, .46, .45, .94);
  z-index: -1;
}

.service-card:hover {
  transform: translateY(-20px) scale(1.02);
  box-shadow: var(--sombra-intensa);
}

.service-card:hover::before {
  height: 100%;
}

.service-card:hover .service-icon,
.service-card:hover .service-title,
.service-card:hover p,
.service-card:hover .btn-service {
  color: #fff;
}

.service-icon {
  background: linear-gradient(135deg, var(--rojo-judicial), var(--rojo-oscuro));
  color: #fff;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 30px;
  font-size: 2.5rem;
  transition: var(--transicion-media);
  box-shadow: 0 10px 25px rgba(139, 0, 0, .3);
  position: relative;
  z-index: 2;
}

.service-card:hover .service-icon {
  background: #fff;
  color: var(--rojo-judicial);
  transform: scale(1.15) rotate(15deg);
  box-shadow: 0 15px 30px rgba(255, 255, 255, .3);
}

.service-title {
  color: var(--rojo-judicial);
  font-weight: 700;
  margin-bottom: 20px;
  transition: color .5s ease;
  font-size: 1.5rem;
}

.service-card p {
  color: var(--plomo-judicial);
  transition: color .5s ease;
  line-height: 1.7;
}

.btn-service {
  background-color: transparent;
  color: var(--rojo-judicial);
  border: 2px solid var(--rojo-judicial);
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transicion-media);
  margin-top: 25px;
  display: inline-block;
  position: relative;
  overflow: hidden;
  z-index: 1;
  text-decoration: none;
}

.btn-service::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: #fff;
  transition: width .5s cubic-bezier(.25, .46, .45, .94);
  z-index: -1;
}

.service-card:hover .btn-service {
  color: var(--rojo-judicial);
  border-color: #fff;
  transform: translateY(-5px);
}

.service-card:hover .btn-service::before {
  width: 100%;
}

/* ===== CARACTERÍSTICAS OPTIMIZADAS ===== */
.features-section {
  padding: 120px 0;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.features-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23f5f5f5" fill-opacity="0.5" d="M0,160L48,176C96,192,192,224,288,224C384,224,480,192,576,165.3C672,139,768,117,864,128C960,139,1056,181,1152,181.3C1248,181,1344,139,1392,117.3L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') center/cover no-repeat;
}

.feature-box {
  text-align: center;
  padding: 50px 30px;
  border-radius: 20px;
  transition: var(--transicion-media);
  position: relative;
  overflow: hidden;
  z-index: 1;
  background: #fff;
  box-shadow: var(--sombra);
  border: 1px solid rgba(0, 0, 0, .05);
}

.feature-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(135deg, var(--rojo-judicial), var(--rojo-oscuro));
  transition: height .5s cubic-bezier(.25, .46, .45, .94);
  z-index: -1;
}

.feature-box:hover::before {
  height: 100%;
}

.feature-box:hover {
  transform: translateY(-15px) scale(1.03);
  box-shadow: var(--sombra-intensa);
}

.feature-box:hover .feature-icon,
.feature-box:hover h4,
.feature-box:hover p {
  color: #fff;
}

.feature-icon {
  font-size: 3.5rem;
  color: var(--rojo-judicial);
  margin-bottom: 30px;
  transition: var(--transicion-media);
}

.feature-box:hover .feature-icon {
  transform: scale(1.3) rotate(10deg);
}

/* ===== CONTACTO OPTIMIZADO ===== */
.contact-section {
  background: linear-gradient(135deg, var(--crema-judicial) 0%, var(--crema-oscuro) 100%);
  color: var(--rojo-judicial);
  padding: 100px 0;
  position: relative;
  overflow: hidden;
}

.contact-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23D4AF37" fill-opacity="0.05" d="M0,224L48,213.3C96,203,192,181,288,181.3C384,181,480,203,576,192C672,181,768,139,864,128C960,117,1056,139,1152,149.3C1248,160,1344,160,1392,160L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') center/cover no-repeat;
}

.contact-info, .denuncias-info {
  background: linear-gradient(135deg, var(--rojo-oscuro) 0%, var(--rojo-claro) 100%);
  color: var(--blanco);
  border-radius: 20px;
  padding: 40px;
  height: 100%;
  box-shadow: var(--sombra-intensa);
  transition: var(--transicion-rapida);
}

.contact-info:hover, .denuncias-info:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(139, 0, 0, 0.25);
}

.contact-info h4 {
  color: var(--blanco);
  margin-bottom: 30px;
  font-weight: 700;
  text-align: center;
}

.contact-info-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  padding: 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  transition: var(--transicion-rapida);
}

.contact-info-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(5px);
}

.contact-info-icon {
  background: rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  flex-shrink: 0;
  transition: var(--transicion-rapida);
}

.contact-info-item:hover .contact-info-icon {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.contact-info-text p {
  margin-bottom: 0;
  line-height: 1.6;
  color: var(--blanco);
}

.contact-info-text strong {
  color: var(--dorado-judicial);
}

.denuncias-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.contact-info-icon-denuncia {
  background: linear-gradient(135deg, var(--dorado-judicial), #b8941f);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  transition: var(--transicion-rapida);
}

.denuncias-info:hover .contact-info-icon-denuncia {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.contact-info-text-denuncia h5 {
  color: var(--dorado-judicial);
  font-weight: 700;
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.contact-info-text-denuncia p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 25px;
  font-size: 1.05rem;
  line-height: 1.6;
}

.btn-denuncia {
  background: linear-gradient(135deg, var(--dorado-judicial), #b8941f);
  color: #1a365d;
  border: none;
  padding: 15px 35px;
  border-radius: 30px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: var(--transicion-rapida);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  font-size: 1.05rem;
}

.btn-denuncia::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.7s;
}

.btn-denuncia:hover::before {
  left: 100%;
}

.btn-denuncia:hover {
  color: #1a365d;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  background: linear-gradient(135deg, #e6c158, var(--dorado-judicial));
}

/* ===== FOOTER OPTIMIZADO ===== */
.footer {
  background: linear-gradient(135deg, var(--plomo-oscuro) 0%, #2a2a2a 100%);
  color: #fff;
  padding: 30px 0 30px;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23000000" fill-opacity="0.1" d="M0,160L48,176C96,192,192,224,288,224C384,224,480,192,576,165.3C672,139,768,117,864,128C960,139,1056,181,1152,181.3C1248,181,1344,139,1392,117.3L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') center/cover no-repeat;
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 30px;
  margin-top: 10px;
  text-align: center;
  color: #ffffff;
  font-size: .95rem;
}

/* ===== COMPONENTES ESPECÍFICOS DE PÁGINAS ===== */
.search-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--sombra);
  transition: var(--transicion-media);
  border: 1px solid rgba(0, 0, 0, .05);
  position: relative;
  overflow: hidden;
  z-index: 1;
  padding: 50px;
}

.search-card .form-label {
  font-weight: 600;
  color: var(--rojo-judicial);
  margin-bottom: 10px;
}

.search-card .form-select {
  border: 2px solid var(--crema-oscuro);
  color: var(--plomo-oscuro);
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  transition: var(--transicion-rapida);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.search-card .form-select:hover {
  border-color: var(--rojo-claro);
}

.search-card .form-select.is-invalid {
  border-color: #dc3545;
}

.error-message {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
  color: #dc3545;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 25px;
  display: none;
}

.loading {
  text-align: center;
  padding: 30px;
  display: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(139, 0, 0, 0.2);
  border-top: 5px solid var(--rojo-judicial);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* IFRAMES */
.contenedor-iframe {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 5px;
  overflow: hidden;
}

.contenedor-iframe iframe {
  width: 100%;
  min-height: 650px;
  border: none;
}

/* ===== UTILIDADES ===== */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .8s, transform .8s;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.alert {
  border-radius: 10px;
  border: none;
  padding: 15px 20px;
  margin-bottom: 20px;
}

.alert-success {
  background-color: rgba(25, 135, 84, 0.1);
  color: #0f5132;
  border-left: 4px solid #198754;
}

/* ===== MEDIA QUERIES OPTIMIZADAS ===== */

/* Dispositivos grandes */
@media (max-width: 1200px) {
  .container {
    max-width: 95%;
  }
  
  .hero h1 {
    font-size: 3.5rem;
  }
  
  .herosub-content h1 {
    font-size: 3rem;
  }
  
  .services-section, .search-section {
    padding: 100px 0;
  }
  
  .section-title {
    font-size: 2.5rem;
  }
  
  .service-card {
    padding: 40px 30px;
  }
  
  .service-icon {
    width: 90px;
    height: 90px;
    font-size: 2.2rem;
  }
  
  .features-section {
    padding: 100px 0;
  }
  
  .feature-box {
    padding: 40px 25px;
  }
  
  .contact-section {
    padding: 90px 0;
  }
  
  .contact-info, .denuncias-info {
    padding: 35px 30px;
  }
  
  .contenedor-iframe iframe {
    min-height: 600px;
  }
}

/* Tablets */
@media (max-width: 992px) {
  .navbar-collapse {
    text-align: right;
    background: rgba(139, 0, 0, 0.95);
    border-radius: 10px;
    margin-top: 10px;
    padding: 15px;
  }
  
  .navbar-nav .nav-link {
    padding: .6rem 0;
    margin: 5px 0;
  }
  
  .judicial-logo-img {
    max-width: 130px;
  }
  
  .hero, .herosub {
    text-align: center;
  }
  
  .hero {
    padding: 160px 0 100px;
  }
  
  .herosub {
    padding: 120px 0 70px;
  }
  
  .services-section, .search-section {
    padding: 90px 0;
  }
  
  .section-title {
    font-size: 2.2rem;
    margin-bottom: 3rem;
  }
  
  .service-card {
    margin-bottom: 30px;
    padding: 35px 25px;
  }
  
  .service-title {
    font-size: 1.3rem;
  }
  
  .features-section {
    padding: 90px 0;
  }
  
  .feature-box {
    margin-bottom: 30px;
    padding: 35px 25px;
  }
  
  .feature-icon {
    font-size: 3rem;
    margin-bottom: 25px;
  }
  
  .contact-section {
    padding: 80px 0;
  }
  
  .contact-info, .denuncias-info {
    padding: 30px 25px;
    margin-bottom: 30px;
  }
  
  .contact-info-item {
    padding: 12px;
  }
  
  .contact-info-icon {
    width: 45px;
    height: 45px;
    margin-right: 12px;
  }
  
  .contact-info-icon-denuncia {
    width: 70px;
    height: 70px;
    font-size: 1.7rem;
  }
  
  .copyright {
    margin-top: 50px;
    padding-top: 25px;
  }
  
  .contenedor-iframe iframe {
    min-height: 550px;
  }
}

/* Tablets pequeñas */
@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  .navbar-brand i {
    font-size: 1.5rem;
  }
  
  .judicial-logo-img {
    max-width: 110px;
  }
  
  .btn-outline-judicial-back {
    padding: 8px 20px;
    font-size: 0.9rem;
  }
  
  .hero {
    padding: 150px 0 80px;
    min-height: 60vh;
  }
  
  .herosub {
    padding: 120px 0 60px;
    min-height: 25vh;
  }
  
  .hero h1 {
    font-size: 2.8rem;
  }
  
  .herosub-content h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .herosub-content p {
    font-size: 1.1rem;
  }
  
  .hero-buttons .btn {
    display: block;
    width: 100%;
    margin-bottom: 15px;
  }
  
  .hero-buttons .btn:last-child {
    margin-bottom: 0;
  }
  
  .hero-buttons .me-3 {
    margin-right: 0 !important;
  }
  
  .judicial-symbol::before {
    width: 120px;
    height: 120px;
  }
  
  .judicial-symbol::after {
    width: 160px;
    height: 160px;
  }
  
  .services-section, .search-section {
    padding: 80px 0;
  }
  
  .section-title {
    font-size: 2rem;
    margin-bottom: 2.5rem;
  }
  
  .section-title::after {
    bottom: -15px;
    width: 80px;
    height: 4px;
  }
  
  .service-card {
    padding: 30px 20px;
    margin-bottom: 25px;
  }
  
  .service-icon {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    margin-bottom: 20px;
  }
  
  .service-title {
    font-size: 1.25rem;
    margin-bottom: 15px;
  }
  
  .service-card p {
    font-size: 0.95rem;
  }
  
  .btn-service {
    padding: 10px 25px;
    font-size: 0.9rem;
    margin-top: 20px;
  }
  
  .features-section {
    padding: 80px 0;
  }
  
  .feature-box {
    padding: 30px 20px;
    margin-bottom: 25px;
  }
  
  .feature-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
  }
  
  .feature-box h4 {
    font-size: 1.3rem;
  }
  
  .feature-box p {
    font-size: 0.95rem;
  }
  
  .contact-section {
    padding: 70px 0;
  }
  
  .contact-info, .denuncias-info {
    padding: 25px 20px;
  }
  
  .contact-info-item {
    flex-direction: column;
    text-align: center;
    padding: 15px;
  }
  
  .contact-info-icon {
    margin-right: 0;
    margin-bottom: 10px;
    align-self: center;
  }
  
  .contact-info-icon-denuncia {
    width: 65px;
    height: 65px;
    font-size: 1.6rem;
  }
  
  .contact-info-text-denuncia h5 {
    font-size: 1.25rem;
  }
  
  .btn-denuncia {
    padding: 12px 28px;
    font-size: 0.95rem;
  }
  
  .copyright {
    margin-top: 40px;
    padding-top: 20px;
  }
  
  .contenedor-iframe iframe {
    min-height: 500px;
  }
  
  .search-card {
    padding: 30px 20px;
  }
  
  .container {
    max-width: 100%;
    padding: 0 20px;
  }
}

/* Móviles */
@media (max-width: 576px) {
  .navbar {
    padding: 12px 0;
  }
  
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .judicial-logo-img {
    max-width: 90px;
  }
  
  .hero {
    padding: 130px 0 60px;
    min-height: 70vh;
  }
  
  .herosub {
    padding: 110px 0 50px;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .herosub-content h1 {
    font-size: 2rem;
  }
  
  .hero p, .herosub-content p {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
  
  .btn-judicial, .btn-outline-judicial {
    padding: 10px 25px;
    font-size: 0.95rem;
  }
  
  .judicial-symbol::before {
    width: 100px;
    height: 100px;
  }
  
  .judicial-symbol::after {
    width: 140px;
    height: 140px;
  }
  
  .services-section, .search-section {
    padding: 70px 0;
  }
  
  .section-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }
  
  .section-title::after {
    bottom: -12px;
    width: 60px;
    height: 3px;
  }
  
  .service-card {
    padding: 25px 20px;
  }
  
  .service-icon {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
  }
  
  .service-title {
    font-size: 1.2rem;
  }
  
  .features-section {
    padding: 70px 0;
  }
  
  .feature-box {
    padding: 25px 20px;
  }
  
  .feature-icon {
    font-size: 2.2rem;
  }
  
  .contact-section {
    padding: 60px 0;
  }
  
  .contact-info, .denuncias-info {
    padding: 20px 15px;
  }
  
  .contact-info-icon-denuncia {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  .contact-info-text-denuncia h5 {
    font-size: 1.2rem;
  }
  
  .contact-info-text-denuncia p {
    font-size: 0.95rem;
  }
  
  .btn-denuncia {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }
  
  .copyright {
    margin-top: 30px;
    padding-top: 15px;
    font-size: 0.9rem;
  }
  
  .contenedor-iframe iframe {
    min-height: 400px;
  }
  
  .search-card {
    padding: 25px 15px;
  }
  
  .container {
    padding: 0 15px;
  }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .herosub-content h1 {
    font-size: 1.6rem;
  }
}

/* Tablets en horizontal */
@media (max-width: 1024px) and (orientation: landscape) {
  .hero {
    min-height: 80vh;
    padding: 150px 0 80px;
  }
  
  .herosub {
    min-height: 40vh;
    padding: 120px 0 60px;
  }
}