/* ==========================================
   SECCIÓN CATEGORÍAS (ESTILO IMAGEN DE APOYO)
   ========================================== */
.categories-section {
  max-width: 1200px;
  margin: 50px auto;
  padding: 0 20px;
  position: relative;
}

/* Encabezado Centrado */
.section-header-centered {
  text-align: center;
  margin-bottom: 35px;
}

.section-top-subtitle {
  font-size: 15px;
  color: #475569;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.section-title {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.3px;
}

.section-title .text-blue {
  color: #0052cc; /* Azul principal */
}

/* Envoltorio con posición relativa para las flechas flotantes */
.categories-carousel-wrapper {
  position: relative;
  width: 100%;
}

/* Flechas Flotantes a los Lados */
.cat-arrow {
  position: absolute;
  top: 40%; /* Alineadas con el centro de la imagen */
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.cat-arrow:hover {
  background-color: #0052cc;
  color: #ffffff;
  border-color: #0052cc;
}

.cat-prev { left: -20px; }
.cat-next { right: -20px; }

/* Pista desplegable horizontal */
.categories-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 10px 0 20px 0;
  scrollbar-width: none;
}

.categories-track::-webkit-scrollbar {
  display: none;
}

/* Tarjeta individual */
.category-card {
  flex: 0 0 calc(20% - 16px); /* 5 columnas en escritorio */
  min-width: 200px;
  text-decoration: none;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}

.category-card:hover {
  transform: translateY(-4px);
}

/* Contenedor de la Imagen */
.category-image-box {
  position: relative;
  width: 100%;
  height: 220px; /* Mantiene la altura deseada */
  border-radius: 18px;
  overflow: visible; /* Permite que el badge azul sobresalga en la base */
  margin-bottom: 24px;
}

.category-image {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  background-color: #f1f5f9;
  transition: transform 0.4s ease;
  overflow: hidden;
}

.category-card:hover .category-image {
  transform: scale(1.03);
}

/* Icono Azul en la base de la tarjeta */
.category-badge-icon {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  background-color: #0052cc;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 82, 204, 0.3);
  z-index: 2;
}

/* Textos abajo de la tarjeta */
.category-card-text {
  text-align: center;
}

.category-name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
}
.category-name:hover {
    color: #0052cc;
    font-size: 18px;
}

.category-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

/* Responsivo */
@media (max-width: 1024px) {
  .category-card {
    flex: 0 0 calc(33.33% - 14px); /* 3 tarjetas en tablets */
  }
}

@media (max-width: 640px) {
  .category-card {
    flex: 0 0 calc(50% - 10px); /* 2 tarjetas en celulares */
  }
  
  .cat-prev { left: 0; }
  .cat-next { right: 0; }
}