* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  background-color: #000;
  font-family: "Montserrat", sans-serif;
}

section {
  height: 100%;
}

.states-section {
  background-color: #000000;
  color: #ffffff;
  padding: 80px 40px;
  position: relative;
  overflow: hidden;
  z-index: 10;
}

/* Patrón decorativo con un mapa estilizado de México */
.states-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(255, 196, 0, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 69, 0, 0.1) 100%
  );
  opacity: 0.3;
  z-index: 0;
}

/* Animación de estrellas */
.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.stars span {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #ffffff;
  border-radius: 50%;
  animation: twinkle 5s infinite;
  opacity: 0.5;
}

@keyframes twinkle {
  0% {
    opacity: 0.2;
    transform: scale(0.5);
  }
  50% {
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    opacity: 0.2;
    transform: scale(0.5);
  }
}

.states-content {
  margin-top: 10em;
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}

.states-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffc400;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

.states-content p {
  font-size: 1.125rem;
  color: #d1d5db;
  max-width: 800px;
  margin: 0 auto 3rem;
  line-height: 1.6;
  opacity: 0;
  animation: fadeIn 1s ease 0.5s forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.states-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.state-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #ffc400;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  text-decoration: none;
}

.state-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  border-color: #ff4500;
}

.state-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.state-card:hover img {
  transform: scale(1.1);
}

.state-card .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.5),
    rgba(0, 0, 0, 0.8)
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.state-card:hover .overlay {
  opacity: 1;
}

.state-card .overlay h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
}

.state-card .cta {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  background-color: #ffc400;
  color: #000000;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.state-card:hover .cta {
  background-color: #ff4500;
  transform: scale(1.05) translateX(-50%);
}

.state-card .favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2rem;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 3;
}

.state-card .favorite.active {
  color: #ffc400;
}

/* Estilos para el ícono de advertencia */
.state-card .warning-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2rem;
  color: #ff4500;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
  z-index: 4;
}

.state-card .warning-icon:hover {
  color: #ffffff;
  transform: scale(1.2);
}

/* Estilos para el modal de advertencia */
.warning-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.warning-modal-content {
  background: #1a1a3d;
  padding: 20px;
  border-radius: 10px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  border: 2px solid #ffc400;
}

.warning-modal-content p {
  font-size: 1rem;
  color: #ffffff;
  margin-bottom: 20px;
}

.warning-modal-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #ffc400;
  color: #000000;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.warning-modal-button:hover {
  background-color: #ff4500;
  transform: scale(1.05);
}

.warning-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #ffc400;
  transition: color 0.3s ease;
}

.warning-modal-close:hover {
  color: #ff4500;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .states-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .states-section {
    padding: 60px 20px;
  }

  .states-content h2 {
    font-size: 2rem;
  }

  .states-content p {
    font-size: 1rem;
  }

  .states-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .state-card img {
    height: 160px;
  }

  .state-card .overlay h3 {
    font-size: 1.125rem;
  }

  .state-card .cta {
    font-size: 0.95rem;
    padding: 6px 16px;
  }

  .state-card .favorite,
  .state-card .warning-icon {
    font-size: 1rem;
  }

  .warning-modal-content {
    padding: 15px;
  }

  .warning-modal-content p {
    font-size: 0.95rem;
  }

  .warning-modal-button {
    font-size: 0.95rem;
    padding: 8px 16px;
  }
}

@media (max-width: 480px) {
  .states-section {
    padding: 40px 15px;
  }

  .states-content h2 {
    font-size: 1.75rem;
  }

  .states-content p {
    font-size: 0.9rem;
  }

  .states-grid {
    grid-template-columns: 1fr;
  }

  .state-card img {
    height: 140px;
  }

  .state-card .overlay h3 {
    font-size: 1rem;
  }

  .state-card .cta {
    font-size: 0.9rem;
  }

  .state-card .favorite,
  .state-card .warning-icon {
    font-size: 0.9rem;
  }

  .warning-modal-content {
    padding: 10px;
  }

  .warning-modal-content p {
    font-size: 0.9rem;
  }

  .warning-modal-button {
    font-size: 0.9rem;
    padding: 6px 12px;
  }
}