/* Layout general */
.row {
  display: flex;
  flex-wrap: wrap;
}

.col-md-6 {
  width: 50%;
  box-sizing: border-box;
}

#main_container_2 {
  padding: 18% 2% 2% 2%;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.state-col {
  width: 48%;
  margin-bottom: 10px;
  box-sizing: border-box;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Mobile styles - Una sola columna */
@media (max-width: 768px) {
  .row {
    flex-direction: column;
  }

  .col-md-6 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  /* En mobile: una sola columna */
  .state-btn-row {
    flex-direction: column;
  }

  .state-col {
    width: 100% !important;
    margin-bottom: 10px;
  }

  .sucursales-list {
    flex-basis: 100%;
  }

  #top-image {
    width: 80%;
    margin: 0 auto 30px auto;
    display: block;
  }
}

/* Contenedor general de los estados */
.state-btn-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

/* Cada fila agrupa dos estados y dos listas */
.state-btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 15px;
}



/* Botón de estado */
.state-btn {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  width: 98%;
  padding: 20px 30px;
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 60px;
}

.state-btn .sucursal-count {
  color: #1e293b;
}

/* Efecto shimmer en hover */
.state-btn::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.5s ease;
}

.state-btn:hover::before {
  left: 100%;
}

/* Flecha por defecto */
.state-btn::after {
  content: "❯";
  font-size: 20px;
  color: #6366f1;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: bold;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Si el botón está "abierto", gira flecha 90° */
.state-btn.open::after {
  transform: translateY(-50%) rotate(90deg);
}

/* Hover del botón */
.state-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Estado activo/abierto */
.state-btn.open {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Lista de sucursales con animación */
.sucursales-list {
  display: none;
  flex-basis: 95%;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px;
  margin: 5px 0;
  padding: 15px 10px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.sucursales-list.open {
  display: block;
  animation: fadeInDown 0.4s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cada sucursal */
.sucursales-list li {
  display: block;
  width: auto;
  list-style: none;
  background: #fff;
  border-radius: 12px;
  margin: 8px 5px;
  padding: 16px 20px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border-left: 4px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  animation: slideInLeft 0.4s ease forwards;
}

/* Stagger para items de sucursales */
.sucursales-list.open li:nth-child(1) {
  animation-delay: 0.05s;
}

.sucursales-list.open li:nth-child(2) {
  animation-delay: 0.1s;
}

.sucursales-list.open li:nth-child(3) {
  animation-delay: 0.15s;
}

.sucursales-list.open li:nth-child(4) {
  animation-delay: 0.2s;
}

.sucursales-list.open li:nth-child(5) {
  animation-delay: 0.25s;
}

.sucursales-list.open li:nth-child(6) {
  animation-delay: 0.3s;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sucursales-list li:hover {
  transform: translateX(8px);
  border-left-color: #fbbf24;
}

.sucursales-list li h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  transition: color 0.3s ease;
}

.sucursales-list li p {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
  transition: color 0.3s ease;
}

/* El mapa */
#map {
  width: 100%;
  height: 454px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease 0.3s forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Badge de cantidad de sucursales */
.sucursal-count {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #1e293b;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-left: 10px;
  display: inline-block;
}

/* Top image animation */
#top-image {
  opacity: 0;
  transform: translateY(-20px);
  animation: fadeInDown 0.6s ease 0.1s forwards;
}