/* Estilos unificados para cards de productos */

/* Sección de búsqueda */
.search-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 2rem 0;
  border-bottom: 1px solid #dee2e6;
  /* margin-top: 110px; */
}

.search-container {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.search-input-group {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  z-index: 2;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.search-input:focus {
  outline: none;
  border-color: #007bff;
  background: white;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filter-select {
  padding: 0.75rem 1rem;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  background: #f8f9fa;
  font-size: 1rem;
  min-width: 200px;
  transition: all 0.3s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #007bff;
  background: white;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-btn {
  /* background: linear-gradient(135deg, #007bff, #0056b3); */
  background-color: #f1990b;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.search-results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
}

.results-count {
  color: #495057;
  font-weight: 500;
}

.clear-filters {
  color: #dc3545;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.clear-filters:hover {
  color: #c82333;
}

/* Sección de productos */
.products-section {
  padding: 3rem 0;
  background: #f8f9fa;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Card de producto unificada */
.product-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.4s ease;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
}

.product-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Badges */
.discount-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.availability-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.availability-badge.available {
  /* background: linear-gradient(135deg, #28a745, #20c997); */
  background-color: #f1990b !important;
  color: white;
  /* box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3); */
  box-shadow: 0 2px 8px rgba(32, 33, 32, 0.3);
}

.availability-badge.unavailable {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  color: white;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

/* Imagen del producto */
.product-image {
  position: relative;
  height: 250px;
  overflow: hidden;
  background: #f8f9fa;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
  padding: 1rem;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover .image-overlay {
  opacity: 1;
}

.quick-view-btn {
  background: white;
  color: #333;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-view-btn:hover {
  background: #f1990b;
  color: white;
  transform: scale(1.05);
}

/* Información del producto */
.product-info {
  padding: 1.5rem;
}

.product-category {
  color: #007bff;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  /* letter-spacing: 0.5px; */
  margin-bottom: 0.5rem;
}

.product-title {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  height: 50px;
  overflow-y: auto;
}

.product-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.product-title a:hover {
  color: #007bff;
}

.product-pricing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.price-main {
  font-size: 1.2rem;
  font-weight: 700;
  /* color: #28a745; */
  color: #2f200795;
}

.price-original {
  font-size: 1.2rem;
  color: #6c757d;
  text-decoration: line-through;
}

.precioQuincena {
  font-size: 1.3rem;
  color: #d6380c;
  font-weight: bold;
  padding: 0;
}

.installment-info {
  /* background: linear-gradient(135deg, #e3f2fd, #f3e5f5); */
  background-color: #fad73bcd;
  padding: 0.75rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #383c3f;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  /* border-left: 3px solid #007bff; */
}

.installment-info i {
  color: #007bff;
}

/* Acciones del producto */
.product-actions {
  padding: 0 1.5rem 1.5rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
}

.btn-primary,
.btn-secondary {
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-weight: bold;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.btn-primary {
  /* background: linear-gradient(135deg, #007bff, #0056b3); */
  background-color: #f1990b;
  color: white;
}

.btn-primary:hover {
  /* background: linear-gradient(135deg, #0056b3, #004085); */
  background-color: #d38302;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
  color: white;
}

.btn-secondary {
  background: #f8f9fa;
  color: #495057;
  border: 2px solid #e9ecef;
}

.btn-secondary:hover {
  background: #e9ecef;
  border-color: #007bff;
  color: #007bff;
  transform: translateY(-2px);
}

/* Sin productos */
.no-products {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.no-products-icon {
  font-size: 4rem;
  color: #6c757d;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.no-products h3 {
  color: #495057;
  margin-bottom: 1rem;
}

.no-products p {
  color: #6c757d;
  margin-bottom: 2rem;
}

/* Paginación */
.pagination-section {
  padding: 2rem 0;
  background: white;
  border-top: 1px solid #e9ecef;
}

.pagination-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pagination-info {
  color: #6c757d;
  font-weight: 500;
}

.pagination {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.page-item {
  margin: 0;
}

.page-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: #495057;
  text-decoration: none;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.page-link:hover {
  background: #007bff;
  color: white;
  border-color: #007bff;
  transform: translateY(-2px);
}

.page-item.active .page-link {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

/* Modal de compartir */
.share-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.share-btn {
  padding: 0.75rem;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.share-btn.whatsapp {
  background: #25d366;
  color: white;
}

.share-btn.facebook {
  background: #1877f2;
  color: white;
}

.share-btn.copy {
  background: #6c757d;
  color: white;
}

.share-btn.copied {
  background: #28a745;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
  .search-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .filter-select {
    min-width: auto;
  }

  .search-results-info {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
  }

  .product-card {
    margin: 0 1rem;
    display: flex;
    flex-direction: row;
    height: 150px;
    border-radius: 15px;
  }

  .product-image {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    border-radius: 15px 0 0 15px;
  }

  .product-image img {
    padding: 0.5rem;
  }

  .product-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0;
  }

  .product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .product-title {
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;

  }

  .product-category {
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
  }

  .product-pricing {
    margin-bottom: 0.5rem;
    justify-content: flex-start;
  }

  .price-main {
    font-size: 1rem;
  }

  .price-original {
    font-size: 0.9rem;
  }

  .precioQuincena {
    font-size: 1.2rem;
  }

  .installment-info {
    padding: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
  }

  .product-actions {
    padding: 0 1rem 1rem 1rem;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    margin-top: auto;
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  /* Ajustar badges para layout horizontal */
  .discount-badge {
    top: 0.5rem;
    left: 0.5rem;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }

  .availability-badge {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
  }

  .pagination-nav {
    flex-direction: column;
    gap: 1rem;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .share-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .search-container {
    padding: 1.5rem;
    margin: 0 1rem;
    border-radius: 10px;
  }

  .products-section {
    padding: 2rem 0;
  }

  .product-card {
    margin: 0 0.5rem;
    height: auto;
  }

  .product-image {
    width: 130px;
    height: 140px;
  }

  .product-info {
    padding: 0.75rem;
    display: block;
  }

  .product-title {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
    height: auto;
  }

  .product-pricing {
    /* flex-direction: column; */
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.25rem;
  }

  .price-main {
    font-size: 0.90rem;
  }

  .precioQuincena {
    font-size: 1.1rem;
  }

  .installment-info {
    font-size: 0.75rem;
    padding: 0.4rem;
  }

  .product-actions {
    padding: 0 0.75rem 0.75rem 0.75rem;
    grid-template-columns: 1fr;
    gap: 0.4rem;
    display: none;
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.35rem 0.6rem;
    font-size: 0.7rem;
  }
}

/* Animaciones adicionales */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeInUp 0.6s ease-out forwards;
}

.product-card:nth-child(even) {
  animation-delay: 0.1s;
}

.product-card:nth-child(3n) {
  animation-delay: 0.2s;
}

/* Estados de carga */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
