/* cupones.css: estilos para los cupones reutilizables */
.cupones-lista{
  display: flex;
    flex-direction: row;
    flex-flow: wrap;
    gap: 8px;
}

.cupones-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  width: calc(33% - 3px);
  
  vertical-align: top;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display:flex;
  flex-direction: column;
    padding: 8px;
    justify-content: space-between;
}
.cupones-card-img {
  width: 100%;
  height: auto;
  max-height: 100px;
  object-fit: cover;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.cupones-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  height: auto;
  justify-content: space-between;
}
.cupones-card-title {
  font-size: 1.1rem;
  margin: 0 0 4px 0;
}
.cupones-card-text {
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 8px;
}
.cupones-btn {
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}
.cupones-btn:hover {
  background: #0056b3;
}
.cupones-spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.cupones-vacio {
  text-align: center;
  color: #888;
  margin: 24px 0;
}
.cupones-error {
  color: #c00;
  text-align: center;
  margin: 24px 0;
}
/* Botón de filtros oculto por defecto (solo se muestra en móviles) */
.cupones-filtros-btn { display: none; }
/* Título móvil oculto por defecto */
.mobile-cats-title { display: none; }

/* Diálogo de Filtros: centrado y estilo general */
#filtrosDialog {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 480px;
  border: none;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  max-height: 80vh;
  overflow: auto;
  z-index: 1000;
}
#filtrosDialog::backdrop { background: rgba(0,0,0,0.4); }
#filtrosDialog .dialog-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 8px; 
}
.breadcrumb{
  margin-top: 30px;
}
#cerrarFiltros {
  background: #f1f1f1;
  color: #333;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
#cerrarFiltros:hover { background: #e2e2e2; }
#cerrarFiltros:active { transform: scale(0.96); }
/* Categorías */
.cupones-categoria-link {
  display: inline-block;
  margin: 4px 8px 4px 0;
  padding: 6px 14px;
  background: #f5f5f5;
  color: #007bff;
  border-radius: 16px;
  text-decoration: none;
  font-size: 1rem;
  border: 1px solid #ddd;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
}
.cupones-categoria-link:hover {
  background: #007bff;
  color: #fff;
}
.cupones-categoria-link.active {
  background: #007bff;
  color: #fff;
  font-weight: bold;
  border-color: #0056b3;
}

@media (max-width: 575px){
  /* Evitar desbordes horizontales en esta página (mantiene el carrusel) */
  #beneficios-page { overflow-x: hidden; }
  #beneficios-page .container { padding-left: 0; padding-right: 0; }
  #beneficios-page .container .row { gap: 0; }
  #beneficios-page .container .row .col-9 { flex: 0 0 100%; max-width: 100%; }
  /* Ocultar completamente la columna de categorías en móvil */
  #beneficios-cats-col { display: none; }
  /* Ocultar el título original y mostrar el título móvil junto al botón */
  #beneficios-cats-title { display: none; }
  .mobile-cats-header { display: flex; align-items: center; justify-content: space-between; margin-top: 100px; }
  .mobile-cats-title { display: block; margin: 0; }
  .cupones-filtros-btn { display: block; margin: 0; }
  
  .cupones-lista{
    margin-top: 0;
    justify-content: space-between;  /* dos columnas equilibradas */
    flex-wrap: wrap;                 /* envolver a dos columnas */
    overflow: visible;               /* sin scroll horizontal */
    padding: 0;                      /* sin padding extra */
    gap: 8px;                        /* mismo gap que desktop */
  }

  
  .cupones-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    width: calc(50% - 4px);     /* dos columnas */
    flex: 0 0 calc(50% - 4px);  /* ancho fijo para 2 col */
    margin: 0; 
    vertical-align: top;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display:flex;
    flex-direction: column;
    padding: 8px;
    justify-content: space-between;
  }

  /* (Opcional) mantener scrollbar por si hay contenido extra */
  .cupones-lista::-webkit-scrollbar { display: initial; }

  /* Ajuste de estilo del botón en móvil */
  .cupones-filtros-btn {
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
  }

  /* Diálogo de filtros para móvil */
  #filtrosDialog {
    width: 90%;
    max-width: 480px;
    border: none;
    border-radius: 8px;
    padding: 12px;
  }
  #filtrosDialog::backdrop { background: rgba(0,0,0,0.35); }
  #filtrosDialog .dialog-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 8px; 
  }

  /* Ocultar el div de categorías (filtros) y expandir cupones en móviles */
  .filtros { display: none; }
  .container .row .col-9 { flex: 0 0 100%; max-width: 100%; }
}
