/* Fuente Poppins elegante */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');

/* Contenedor Título + Botón */
.titulo-filtro-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

/* Título más pequeño */
.titulo-ofertas {
  font-family: 'Poppins', sans-serif;
  font-size: 1.75rem; /* Más pequeño */
  font-weight: 600;
  color: #222;
  margin: 0;
}

/* Botón filtrar grande y elegante */
.btn-filtrar {
  background: transparent;
  border: 2px solid #ccc;
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 1rem;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-filtrar i {
  font-size: 1.25rem;
}

.btn-filtrar:hover {
  border-color: #ff6600;
  color: #ff6600;
}

/* Botón aplicar filtros */
.btn-aplicar {
  background-color: #ff6600;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%;
}

.btn-aplicar:hover {
  background-color: #e55a00;
}

/* Botón cerrar filtros */
.btn-cerrar {
  background-color: #ddd;
  color: #333;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  margin-top: 0.5rem;
}

/* Etiquetas */
.etiqueta {
  background-color: #eeeeee;
  color: #333;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
}

.etiqueta-categoria {
  background-color: #ff9800;
  color: #fff;
}

.etiqueta-tipo {
  background-color: #4caf50;
  color: #fff;
}

/* Botones de oferta */
.botones-oferta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  font-size: 1.5rem;
}

.botones-oferta button {
  background: none;
  border: none;
  cursor: pointer;
  color: #444;
}

/* Modal filtros - animaciones */
#modal-filtro {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#modal-filtro.show {
  opacity: 1;
  visibility: visible;
}

/* Modal contenido */
.modal-filtro-contenido {
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Grid de Ofertas: 5 columnas en PC */
.contenedor-ofertas {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  padding: 2rem 0;
}

/* Título de cada oferta estilo Amazon/eBay */
.titulo-oferta-card {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #222;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Animación de zoom suave para las tarjetas de ofertas */
@keyframes fadeInZoom {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animaciones iniciales y hover en tarjetas */
.contenedor-ofertas > * {
  animation: fadeInZoom 0.6s ease forwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover en tarjetas */
.contenedor-ofertas > *:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Loader Spinner */
.loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #ff6600;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
  display: none;
}

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

/* Responsive tablet */
@media (max-width: 1024px) {
  .contenedor-ofertas {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Responsive móvil grande */
@media (max-width: 768px) {
  .contenedor-ofertas {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .titulo-filtro-wrapper {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .btn-filtrar {
    width: auto;
    padding: 8px 24px;
  }

  .oferta-acciones {
      flex-direction: row !important;
      width: 100% !important;
      justify-content: center;
      gap: 1rem;
      height: auto !important;
      padding: 0.5rem !important;
  }

  .oferta-acciones button {
      font-size: 1.6rem;
  }
}

/* Responsive móvil pequeño */
@media (max-width: 480px) {
  .contenedor-ofertas {
    grid-template-columns: 1fr;
  }
}

.imagen-expirada {
  opacity: 0.4;
  filter: grayscale(100%);
}

.oferta-detalle.fondo-blanco {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
}

.oferta-imagen {
  width: 230px;
  height: 230px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.oferta-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
