/* ===== MUNICIPIOS - ESTILOS ESPECÍFICOS ===== */

/* ===== ESTILOS GENERALES DE LA PÁGINA ===== */
.municipios-page {
  padding-top: 0;
  min-height: 100vh;
}

/* ===== FONDO DE LA SECCIÓN MUNICIPIOS (ESTILO CONSISTENTE) ===== */
.municipios-section-bg {
  background-color: #254934; /* Fondo verde sólido como en el resto del sitio */
  padding: 180px 0 80px 0; /* Reducido el padding bottom para ver las cards */
  margin-top: 0;
  position: relative;
}

.municipios-section-bg .section-title {
  position: relative;
  z-index: 2;
  margin-bottom: 30px; /* Reducido para acercar elementos */
}

.municipios-section-bg .section-title h2,
.municipios-section-bg .section-title p {
  color: white;
}

.municipios-section-bg .section-title h2 {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.municipios-section-bg .section-title p {
  font-size: 1.2rem;
  margin-bottom: 0;
  opacity: 0.9;
}

/* ===== CONTENEDOR DE BÚSQUEDA Y CONTADOR ===== */
.search-counter-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.search-box-wrapper {
  flex: 1;
  min-width: 300px;
}

.counter-wrapper {
  width: auto;
}

/* ===== CONTADOR DE MUNICIPIOS (VERSIÓN COMPACTA) ===== */
.municipios-counter {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  padding: 10px 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.municipios-counter .counter-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
}

.municipios-counter .counter-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  line-height: 1;
  margin: 0 5px;
}

.municipios-counter .counter-label-sub {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
}

/* ===== FILTROS Y BÚSQUEDA (GLASSMORPHISM CONSISTENTE) ===== */
.search-box {
  position: relative;
  margin-bottom: 0;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 16px 50px 16px 25px;
  border: none;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-box input:focus {
  outline: none;
  background: white;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.search-box input::placeholder {
  color: #999;
  font-weight: 400;
}

.search-box i {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #39b54a;
  font-size: 1.3rem;
}

/* ===== BOTÓN VOLVER (ESTILO CONSISTENTE) ===== */
.volver-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 30px;
}

.btn-volver {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  padding: 12px 25px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-volver:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  color: white;
  text-decoration: none;
}

.btn-volver i {
  transition: transform 0.3s ease;
}

.btn-volver:hover i {
  transform: translateX(-5px);
}

/* ===== SECCIÓN DE CARDS ===== */
.light-background {
  background-color: #f8f9fa;
  padding-top: 60px; /* Reducido para que se vean las cards */
  padding-bottom: 80px;
}

/* ===== CARDS DE MUNICIPIOS (MANTENER COMO ESTÁN) ===== */
.municipio-card {
  background: linear-gradient(145deg, #ffffff, #f8f9fa);
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  height: 100%;
  margin-bottom: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
}

.municipio-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #39b54a, #2d8f3a, #39b54a);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.municipio-card:hover::before {
  opacity: 1;
}

.municipio-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15), 0 12px 24px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(57, 181, 74, 0.1);
}

/* Enlace del municipio */
.municipio-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.municipio-image {
  position: relative;
  overflow: hidden;
  height: 220px;
  background: linear-gradient(135deg, #254934 0%, #39b54a 50%, #2d8f3a 100%);
}

.municipio-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.municipio-card:hover .municipio-image::before {
  transform: translateX(100%);
}

.municipio-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: all 0.5s ease;
  padding: 25px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  margin: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.municipio-card:hover .municipio-image img {
  transform: scale(1.08) rotate(2deg);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.municipio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(37, 73, 52, 0.1) 50%, rgba(37, 73, 52, 0.2) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.municipio-card:hover .municipio-overlay {
  opacity: 1;
}

/* Indicador de visita */
.visit-indicator {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.9);
  color: #39b54a;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.municipio-card:hover .visit-indicator {
  opacity: 1;
  transform: translateY(0);
}

.cursor-pointer {
  cursor: pointer;
}

.cursor-default {
  cursor: default;
}

.municipio-info {
  padding: 25px 30px; /* Reducido el padding vertical */
  background: linear-gradient(145deg, #ffffff, #f8f9fa);
}

.municipio-nombre {
  font-size: 1.4rem;
  font-weight: 700;
  color: #254934;
  margin-bottom: 10px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
}

.municipio-nombre::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #39b54a, #2d8f3a);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.municipio-card:hover .municipio-nombre::after {
  width: 60px;
}

/* Estilo para la provincia */
.municipio-provincia {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 15px;
  font-weight: 500;
}

.municipio-provincia i {
  color: #39b54a;
  font-size: 1rem;
}

/* ===== ESTADO VACÍO ===== */
.municipios-empty {
  text-align: center;
  padding: 80px 40px;
  background: linear-gradient(145deg, #ffffff, #f8f9fa);
  border-radius: 25px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(57, 181, 74, 0.1);
}

.municipios-empty i {
  font-size: 5rem;
  background: linear-gradient(135deg, #39b54a, #2d8f3a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 25px;
  display: block;
}

.municipios-empty h3 {
  color: #254934;
  margin-bottom: 20px;
  font-size: 1.8rem;
  font-weight: 700;
}

.municipios-empty p {
  color: #666;
  font-size: 1.2rem;
  line-height: 1.6;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets grandes */
@media (max-width: 992px) {
  .municipios-section-bg {
    padding: 160px 0 70px 0;
  }

  .municipios-section-bg .section-title h2 {
    font-size: 2.5rem;
  }

  .municipio-image {
    height: 200px;
  }

  .municipio-info {
    padding: 25px;
  }

  .municipio-nombre {
    font-size: 1.3rem;
  }
}

/* Tablets */
@media (max-width: 768px) {
  .municipios-section-bg {
    padding: 140px 0 60px 0;
  }

  .municipios-section-bg .section-title h2 {
    font-size: 2.2rem;
  }

  .municipio-image {
    height: 180px;
  }

  .municipio-info {
    padding: 20px 22px; /* Ajustado */
  }

  .municipio-nombre {
    font-size: 1.2rem;
  }

  .search-counter-container {
    flex-direction: column;
    gap: 15px;
  }

  .search-box-wrapper {
    width: 100%;
  }

  .counter-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .volver-container {
    justify-content: center;
  }
}

/* Móviles */
@media (max-width: 576px) {
  .municipios-section-bg {
    padding: 120px 0 50px 0;
  }

  .municipios-section-bg .section-title h2 {
    font-size: 1.9rem;
  }

  .municipio-card {
    margin-bottom: 30px;
  }

  .municipio-image {
    height: 160px;
  }

  .municipio-info {
    padding: 18px 20px; /* Ajustado */
  }

  .municipio-nombre {
    font-size: 1.1rem;
  }

  .btn-volver {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  .municipios-section-bg {
    padding: 110px 0 40px 0;
  }

  .municipios-section-bg .section-title h2 {
    font-size: 1.7rem;
  }

  .municipio-image {
    height: 250px;/* Aumentado para mejor visualización */
  }
}

/* Móviles muy pequeños */
@media (max-width: 400px) {
  .municipios-section-bg {
    padding: 100px 0 30px 0;
  }

  .municipios-section-bg .section-title h2 {
    font-size: 1.5rem;
  }

  .municipio-image {
    height: 120px;
  }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.municipio-card {
  animation: fadeInUp 0.6s ease-out;
}
