/* ===================================
   PÁGINA DE RESULTADOS DE BÚSQUEDA
   =================================== */

/* ===== HEADER DE BÚSQUEDA ===== */
.resultados-header {
  padding: 2rem 0 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 2px solid #e9ecef;
  margin-top: var(--header-height);
}

.resultados-header__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.resultados-header__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1px solid #dee2e6;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
  width: fit-content;
}

.resultados-header__back:hover {
  background: #f8f9fa;
  border-color: #007bff;
  color: #007bff;
  transform: translateX(-4px);
}

.resultados-header__back i {
  font-size: 1.125rem;
}

.resultados-header__info {
  text-align: center;
}

.resultados-header__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.resultados-header__title span {
  color: #007bff;
}

.resultados-header__count {
  font-size: 1rem;
  color: #6c757d;
  font-weight: 500;
}

.resultados-header__count span {
  color: #007bff;
  font-weight: 700;
}

/* ===== FILTROS ===== */
.resultados-filtros {
  padding: 1.5rem 0;
  background: white;
  border-bottom: 1px solid #e9ecef;
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filtros-container {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.filtro-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: white;
  border: 1.5px solid #dee2e6;
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.filtro-btn:hover {
  border-color: #007bff;
  color: #007bff;
  background: #f0f8ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.filtro-btn.active {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.filtro-btn.active:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-2px);
}

.filtro-btn i {
  font-size: 1.125rem;
}

/* ===== GRID DE RESULTADOS ===== */
.resultados-grid {
  padding: 2rem 0 4rem;
  min-height: 60vh;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 1.5rem;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-container p {
  font-size: 1rem;
  color: #6c757d;
  font-weight: 500;
}

/* Grid de productos */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== TARJETA DE PRODUCTO MEJORADA ===== */
.producto-card-new {
  position: relative;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.producto-card-new:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

/* Badge del producto */
.producto-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 4;
  letter-spacing: 0.5px;
}

.producto-badge.promo {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.producto-badge.nuevo {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  }
}

/* Carrusel de imágenes */
.producto-carrusel {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: #f8f9fa;
}

.carrusel-imagen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imagen-principal {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.producto-card-new:hover .imagen-principal {
  transform: scale(1.05);
}

/* Botones del carrusel */
.carrusel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 1;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 3;
}

.carrusel-btn i {
  font-size: 1.25rem;
  color: #2c3e50;
}

.carrusel-prev {
  left: 10px;
}

.carrusel-next {
  right: 10px;
}

.carrusel-btn:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
}

/* Indicador del carrusel */
.carrusel-indicador {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
}

/* Información del producto */
.producto-info-new {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.producto-marca-new {
  font-size: 0.8125rem;
  color: #6c757d;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.producto-nombre-new {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.producto-descripcion-new {
  font-size: 0.875rem;
  color: #6c757d;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
  transition: all 0.3s ease;
}

.producto-descripcion-new.expandida {
  max-height: none;
}

.leer-mas {
  color: #007bff;
  font-weight: 500;
  cursor: pointer;
  margin-left: 0.25rem;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.leer-mas:hover {
  text-decoration: underline;
  color: #0056b3;
}

/* Footer del producto */
.producto-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
}

.footer-izquierda {
  flex: 1;
}

/* Precio */
.producto-precio-container {
  margin-bottom: 0.75rem;
}

.producto-precio {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.precio-actual {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2c3e50;
}

.precio-actual.promo {
  color: #dc3545;
}

.precio-anterior {
  font-size: 1.125rem;
  color: #6c757d;
  text-decoration: line-through;
  opacity: 0.7;
}

.precio-descuento {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Colores */
.producto-colores {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.color-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #dee2e6;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-option:hover {
  transform: scale(1.2);
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.color-more {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 500;
}

/* Acciones */
.producto-acciones {
  display: flex;
  gap: 0.5rem;
}

.btn-accion {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid #dee2e6;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-accion i {
  font-size: 1.25rem;
  color: #495057;
}

.btn-wishlist:hover {
  border-color: #dc3545;
  background: #fff5f5;
}

.btn-wishlist:hover i {
  color: #dc3545;
}

.btn-wishlist.favorito-activo,
.btn-wishlist.favorito-activo:hover {
  border-color: #dc3545;
  background: #ffe4ec;
}

.btn-wishlist.favorito-activo i {
  color: #dc3545;
}

.btn-cart {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border-color: #007bff;
}

.btn-cart i {
  color: white;
}

.btn-cart:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* ===== SIN RESULTADOS ===== */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  gap: 1.5rem;
}

.no-results i {
  font-size: 4rem;
  color: #dee2e6;
}

.no-results h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #495057;
  margin-bottom: 0.5rem;
}

.no-results p {
  font-size: 1rem;
  color: #6c757d;
  max-width: 400px;
  line-height: 1.6;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.3);
  color: white;
}

.btn-primary i {
  font-size: 1.125rem;
}

/* ===== FOOTER ===== */
.footer {
  background: #2c3e50;
  color: white;
  padding: 2rem 0 1rem;
  margin-top: auto;
}

.footer__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #007bff;
}

.footer__subtitle {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #ecf0f1;
}

.footer__description {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #bdc3c7;
}

.footer__links,
.footer__contact {
  list-style: none;
  padding: 0;
}

.footer__links li,
.footer__contact li {
  margin-bottom: 0.75rem;
}

.footer__links a,
.footer__contact a {
  color: #bdc3c7;
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.2s ease;
}

.footer__links a:hover,
.footer__contact a:hover {
  color: #007bff;
}

.footer__contact li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer__contact i {
  color: #007bff;
  font-size: 1.125rem;
}

.footer__bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #95a5a6;
  font-size: 0.875rem;
}

/* ===== SCROLL UP ===== */
.scrollup {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  background: #007bff;
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
}

.scrollup:hover {
  background: #0056b3;
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

.scrollup.show-scroll {
  opacity: 1;
  visibility: visible;
}

/* ===== RESPONSIVE ===== */

/* Tablets */
@media screen and (max-width: 768px) {
  .resultados-header {
    padding: 1.5rem 0 1rem;
  }
  
  .resultados-header__title {
    font-size: 1.5rem;
  }
  
  .filtros-container {
    gap: 0.5rem;
  }
  
  .filtro-btn {
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
  }
  
  .productos-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  
  .producto-carrusel {
    height: 240px;
  }
  
  .producto-info-new {
    padding: 1rem;
  }
  
  .precio-actual {
    font-size: 1.5rem;
  }
  
  .footer__content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Mobile */
@media screen and (max-width: 480px) {
  .resultados-header {
    padding: 1rem 0;
  }
  
  .resultados-header__title {
    font-size: 1.25rem;
  }
  
  .resultados-header__count {
    font-size: 0.875rem;
  }
  
  .filtros-container {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }
  
  .filtro-btn {
    flex-shrink: 0;
  }
  
  .productos-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .producto-carrusel {
    height: 220px;
  }
  
  .carrusel-btn {
    width: 32px;
    height: 32px;
  }
  
  .carrusel-btn i {
    font-size: 1rem;
  }
  
  .producto-info-new {
    padding: 0.875rem;
  }
  
  .producto-nombre-new {
    font-size: 1rem;
  }
  
  .precio-actual {
    font-size: 1.375rem;
  }
  
  .producto-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .producto-acciones {
    width: 100%;
    justify-content: flex-end;
  }
  
  .scrollup {
    right: 1rem;
    bottom: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.125rem;
  }
}
