@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap");

:root {
  /* colours */
  --primary: #00a9e0;
  --secondary: #54585a;
  --accent: #00b140;
  --attention: #ff7376;
  --dark: #231f20;
  --light: #f8f8f8;
  --lightgray: #e9e9e9;
  --lighter: #fff;
  /* fonts */
  --font-primary: "Bricolage Grotesque", sans-serif;
  /* shadows */
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
  font-size: 1rem;
}

a {
  color: var(--dark);
  text-decoration: none;
}

.container {
  max-width: 90rem;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  position: relative;
  background: var(--primary);
  background: radial-gradient(
    circle,
    rgba(233, 233, 233, 1) 0%,
    rgba(116, 201, 228, 1) 50%,
    rgba(0, 169, 224, 1) 100%
  );
  text-align: center;
  overflow: hidden;
  padding: 25px 0;
}

/* Monedas flotantes decorativas con efecto 3D */
.floating-coin {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffd700;
  border: 3px solid #b8860b;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b8860b;
  font-weight: bold;
  font-size: 28px;
  z-index: 0;
  animation: floatCoin 12s infinite ease-in-out;
  /*box-shadow: 0 0 25px rgba(255, 215, 0, 0.7), 0 8px 15px rgba(0, 0, 0, 0.2),
    inset 0 -5px 15px rgba(0, 0, 0, 0.1);*/
  transform-style: preserve-3d;
}

@keyframes floatCoin {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg) rotateX(0) rotateY(0);
    /*box-shadow: 0 0 25px rgba(255, 215, 0, 0.7), 0 8px 15px rgba(0, 0, 0, 0.3);*/
  }
  25% {
    transform: translate(30px, -40px) rotate(15deg) rotateX(10deg)
      rotateY(10deg);
    /*box-shadow: 0 0 35px rgba(255, 215, 0, 0.9), 0 15px 20px rgba(0, 0, 0, 0.4);*/
  }
  50% {
    transform: translate(-20px, -30px) rotate(-10deg) rotateX(5deg)
      rotateY(15deg);
    /*box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 10px 18px rgba(0, 0, 0, 0.35);*/
  }
  75% {
    transform: translate(20px, 30px) rotate(5deg) rotateX(15deg) rotateY(5deg);
    /*box-shadow: 0 0 32px rgba(255, 215, 0, 0.85),
      0 12px 22px rgba(0, 0, 0, 0.38);*/
  }
}

/* Posiciones monedas flotantes */
.coin1 {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}
.coin2 {
  top: 15%;
  right: 15%;
  animation-delay: 2s;
}
.coin3 {
  bottom: 10%;
  left: 12%;
  animation-delay: 4s;
}
.coin4 {
  bottom: 15%;
  right: 10%;
  animation-delay: 6s;
}
.coin5 {
  top: 30%;
  left: 5%;
  animation-delay: 1s;
}
.coin6 {
  top: 25%;
  right: 5%;
  animation-delay: 3s;
}
.coin7 {
  bottom: 30%;
  left: 3%;
  animation-delay: 5s;
}
.coin8 {
  bottom: 25%;
  right: 3%;
  animation-delay: 7s;
}

.logo-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  margin-bottom: 1rem;
}

.logo {
  position: relative;
  z-index: 10;
  max-width: 100%;
  vertical-align: middle;
  max-height: 12rem;
}

.logo-text {
  font-size: 2rem;
  color: var(--secondary);
  margin: 0;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.logo-subtext {
  font-size: 1.2rem;
  color: var(--dark);
  margin: 0;
  font-weight: 500;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/*
.presentation {
  padding: 2rem;
  width: 100%;
  text-align: center;
  background-color: var(--lightgray);
}

.presentation h2 {
  font-size: 1.8rem;
  margin: 0 0 15px 0;
}

.presentation p {
  font-size: 1rem;
  max-width: 60rem;
  margin: 0 auto;
  line-height: 1.2;
}
*/
.filters {
  background: var(--lightgray);
  padding: 2rem 1rem;
  width: 100%;
  border: 1px solid var(--lightgray);
  text-align: center;
}

.filters h2 {
  font-size: 1.5rem;
  margin: 0 0 15px 0;
}

.search-container {
  position: relative;
  width: calc(100% - 40px);
  max-width: 53rem;
  margin: auto;
  padding: 0 25px 25px;
}

.search-input {
  width: 100%;
  padding: 15px 20px 15px 50px;
  border: 0px solid var(--lightgray);
  border-radius: 50px;
  font-size: 1rem;
  font-family: var(--font-primary);
  transition: all 0.3s;
  background: var(--lighter);
  box-shadow: var(--shadow);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 169, 224, 0.2);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--secondary);
  font-size: 1.2rem;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 58rem;
  margin: auto;
}

.category-btn,
.mobile-filter-btn {
  padding: 8px 15px;
  background: var(--lightgray);
  border: 1px solid #ddd;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
  font-family: var(--font-primary);
  cursor: pointer;
  color: var(--dark);
}

.category-btn:hover,
.category-btn.active {
  background: var(--accent);
  color: var(--lighter);
  border-color: var(--accent);
}
/*
.comercios {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 30px;
  width: calc(100% - 40px);
  max-width: 1200px;
  margin: 20px;
}*/

.comercios {
  width: 100%;
  max-width: 1200px;
  margin: 25px auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 2rem 1rem;
}

.comercio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--lighter);
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  justify-content: space-between;
}

.comercio-card:hover {
  box-shadow: var(--shadow);
}

/* Fondos mejorados con mejor contraste 
.comercio-card:nth-child(3n + 1) {
  background: linear-gradient(
    to bottom,
    #e3f7ff,
    #f0fbff
  ); /* azul claro mejorado 
}*/ /*
.comercio-card:nth-child(3n + 2) {
  background: linear-gradient(
    to bottom,
    #e8f9f0,
    #f4fdf7
  ); /* verde claro mejorado 
}

.comercio-card:nth-child(3n + 3) {
  background: linear-gradient(
    to bottom,
    #fff8e6,
    #fffbf0
  ); /* naranja claro mejorado 
}*/

.comercio-card .perfil {
  position: relative;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.comercio-card figure {
  height: 5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.comercio-card .logo-comercio {
  max-width: 100%;
  height: auto;
  max-height: 100%;
}

.title-section {
  width: 100%;
  padding: 0 10px;
  text-align: center;
}

.comercio-card .title-section h3 {
  font-size: 1.25rem;
  color: var(--secondary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.25rem;
}

.comercio-card h4 {
  background: var(--attention);
  color: var(--lighter);
  text-align: center;
  margin: 0;
  padding: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: capitalize;
}

.comercio-card .title-section .category {
  font-size: 1.1rem;
  color: var(--primary);
  display: inline-block;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.5px;
}

.comercio-card .contact {
  width: 100%;
  padding: 1rem 1.5rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  padding: 0px;
}

.info-item:last-child {
  margin-bottom: 0px;
}

.info-item span {
  color: var(--dark);
  font-weight: 500;
  flex: 1;
  text-transform: capitalize;
}

.card-actions {
  width: 100%;
  padding: 15px 25px;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.comercio-card svg {
  max-height: 1.25rem;
  max-width: 1.25rem;
}

.location-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: var(--lightgray);
  color: var(--secondary);
  border: none;
  border-radius: 50px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
  width: auto;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  margin: auto;
}

.location-btn:hover {
  background: var(--attention);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  color: var(--lighter);
}

footer {
  background: var(--lighter);
  text-align: center;
  margin-top: 50px;
  border-top: 1px solid var(--lightgray);
}

footer .bg-footer {
  padding: 1rem;
  color: var(--lighter);
  background-color: var(--attention);
  background-image: url(https://lerma.gob.mx/wp-content/uploads/patron.svg);
}

.bg-footer a {
  color: var(--lighter);
}

footer .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-section {
  padding: 1.5rem 1rem;
}

.footer-section h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
  font-weight: 700;
}

.footer-section p {
  margin-bottom: 20px;
  opacity: 0.9;
  line-height: 1.7;
  font-size: 1rem;
}

.survey-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: var(--lighter);
  padding: 12px 25px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s;
  font-size: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.survey-btn:hover {
  background: #008c36;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.social-icons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  padding: 1.25rem;
  justify-content: center;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

footer nav {
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  padding: 1rem;
}

footer nav a {
  margin: 0 1rem;
  color: #004aad;
  text-decoration: none;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--lighter);
  padding: 1rem;
  max-width: 400px;
  width: 90%;
  border-radius: 8px;
  overflow-y: scroll;
  max-height: 90vh;
}
/* Spinner de carga */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.loading-spinner {
  width: 80px;
  height: 80px;
  border: 8px solid var(--lightgray);
  border-top: 8px solid var(--primary);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  text-align: center;
  max-width: 300px;
}

.loading-subtext {
  font-size: 1rem;
  color: var(--secondary);
  margin-top: 10px;
  text-align: center;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .floating-coin {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .logo {
    max-height: 6rem;
  }

  .logo-text {
    font-size: 1.4rem;
  }

  .logo-subtext {
    font-size: 0.95rem;
  }

  .filters h2 {
    font-size: 1.2rem;
  }

  .search-container {
    padding: 0px;
    width: 100%;
  }
  .category-btn {
    font-size: 0.8rem;
  }
  .comercios {
    gap: 25px;
  }
  .comercio-card .perfil {
    padding: 1rem;
  }
  .comercio-card .title-section h3 {
    font-size: 1rem;
  }

  .comercio-card .title-section .category {
    font-size: .9rem;
  }
  .comercio-card h4 {
    font-size: .9rem;
  }
  .comercio-card .contact {
    padding: 1rem;
  }
  .comercio-card svg {
    max-height: 0.75rem;
    max-width: 0.75rem;
  }
  .info-item {
    gap: 5px;
    font-size: 0.8rem;
    padding: 0px;
  }
  .card-actions {
    padding: 1rem;
  }
  .location-btn {
    gap: 5px;
    font-size: 0.8rem;
  }
  footer .bg-footer .container {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  footer nav a {
    display: block;
    margin: 15px 0;
    text-align: center;
  }
}

/* Estilos para el encabezado de región */
.region-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 1rem;
}

.region-title {
  font-size: 1.5rem;
  margin: 0; /* Eliminar margen predeterminado */
  text-transform: capitalize;
}

.carousel-controls {
  display: flex;
  gap: 8px;
}

/* Botones más pequeños */
.carousel-btn {
  background: transparent;
  color: var(--secondary);
  border: 1px solid #ddd;
  width: 32px; /* Reducido de 40px */
  height: 32px; /* Reducido de 40px */
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem; /* Reducido de 1.2rem */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
}

.carousel-btn:hover {
  background: var(--secondary);
  color: var(--lighter);
  transform: scale(1.1);
}

/* Contenedor del carrusel */
.carousel-container {
  padding: 0 10px;
}

.carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  padding: 10px 0;
  width: 100%;
}

/* Ocultar scrollbar en Chrome, Safari, Opera */
.carousel::-webkit-scrollbar {
  display: none;
}

/* Tarjetas dentro del carrusel */
.carousel .comercio-card {
  flex: 0 0 auto;
  width: calc((100% - 100px) / 4);
  margin: 0;
}

@media (max-width: 768px) {
  .carousel-controls {
    display: none;
  }

  .carousel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
  }

  .carousel-container {
    padding: 0px;
  }
  /* Para móviles, ajusta el ancho de las tarjetas */
  .carousel .comercio-card {
    width: calc((100% - 10px) / 1.25);
  }

  .region-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 0;
  }

  .region-title {
    font-size: 1.2rem;
  }
}

/* Botón para móviles */
.mobile-filter-btn {
  display: none;
  margin: 1.5rem auto 0;
  transition: all 0.3s;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.mobile-filter-btn:hover {
  background: #008c36;
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  color: var(--lighter);
}

/* Ventana desplegable para móviles - CORREGIDA */

.mobile-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--lightgray);
}

.mobile-filter-header h3 {
  font-size: 1rem;
  color: var(--dark);
}

.mobile-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.mobile-categories-grid .category-btn {
  padding: 15px;
}

/* Responsive */
@media (max-width: 900px) {
  .category-filters {
    display: none;
  }

  .mobile-filter-btn {
    display: flex;
  }
}
