/* products.css */

/* Wrapper for product section */
.products-page {
  background: #f9f9f9;
  min-height: 100vh;
  padding-bottom: 2rem;
}

.products-page .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Section heading */
.trending-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-top: 2rem;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #001a6e;
}

.section-underline {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.section-underline .line {
  width: 50px;
  height: 2px;
  background: #001a6e;
  margin: 0 10px;
}

.section-underline .icon {
  color: #007bff;
  font-size: 20px;
}

/* Product grid using suggested style */
.suggested-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 1rem 4rem;
  max-width: 100%;
}

.suggest-card {
  background: white;
  border: 1px solid #ddd;
  padding: 1.2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  will-change: transform;
  transform: translateZ(0);
  overflow: hidden;
  position: relative;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.suggest-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.suggest-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
  will-change: transform;
  flex-shrink: 0;
}

.suggest-card:hover img {
  transform: scale(1.05);
}

.suggest-card h3 {
  margin: 1rem 0;
  font-size: 1.1rem;
  color: #333;
  font-weight: 600;
  line-height: 1.4;
  flex-grow: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Button */
.blue-btn {
  display: inline-block;
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  will-change: transform, background-color;
}

.blue-btn:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* No products state */
.no-products {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.no-products-content {
  text-align: center;
  padding: 2rem;
}

.no-products-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-products-content h3 {
  color: #333;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.no-products-content p {
  color: #666;
  font-size: 1rem;
  line-height: 1.5;
}

/* Pagination Styles */
.pagination-section {
  margin: 3rem 0;
  padding: 2rem 1rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid #007bff;
}

.pagination-btn:hover {
  background: #0056b3;
  border-color: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.pagination-btn span {
  font-size: 0.9rem;
}

.pagination-numbers {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 1rem;
  flex-wrap: wrap;
}

.pagination-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: white;
  color: #001a6e;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid #e9ecef;
}

.pagination-number:hover {
  background: #f8f9fa;
  border-color: #007bff;
  color: #007bff;
  transform: translateY(-2px);
}

.pagination-number.active {
  background: #001a6e;
  color: white;
  border-color: #001a6e;
  box-shadow: 0 4px 12px rgba(0, 26, 110, 0.3);
}

.pagination-dots {
  color: #6c757d;
  padding: 0 0.5rem;
  font-weight: 500;
}

/* Responsive pagination */
@media (max-width: 768px) {
  .pagination {
    gap: 0.25rem;
  }
  
  .pagination-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .pagination-number {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
  
  .pagination-numbers {
    margin: 0 0.5rem;
  }
}

@media (max-width: 480px) {
  .pagination-section {
    margin: 2rem 0;
    padding: 1.5rem 0.5rem;
  }
  
  .pagination {
    flex-direction: column;
    gap: 1rem;
  }
  
  .pagination-numbers {
    margin: 0;
  }
}

/* Lazy loading styles */
.suggest-card img.lazy,
.suggest-card img.loading {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.suggest-card img.loaded {
  opacity: 1;
}

.suggest-card img.error {
  opacity: 0.5;
  background: #f0f0f0;
}

/* Loading placeholder animation */
.suggest-card img.loading {
  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;
  }
}

/* Image optimization */
.suggest-card img {
  will-change: opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Mobile Responsive Styles */
@media (max-width: 1024px) {
  .suggested-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
    margin: 1.5rem 0.8rem 3rem;
  }
  
  .suggest-card {
    padding: 1rem;
    min-height: 280px;
  }
  
  .suggest-card img {
    height: 180px;
  }
  
  .suggest-card h3 {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .products-page {
    padding: 0 0.5rem;
  }
  
  .trending-header {
    padding-top: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .suggested-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0.5rem 2rem;
  }
  
  .suggest-card {
    padding: 0.8rem;
    min-height: 240px;
    border-radius: 10px;
  }
  
  .suggest-card img {
    height: 140px;
    border-radius: 6px;
  }
  
  .suggest-card h3 {
    margin: 0.8rem 0;
    font-size: 0.95rem;
    line-height: 1.3;
  }
  
  .blue-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .products-page {
    padding: 0;
    background: #f9f9f9;
  }
  
  .trending-header {
    padding: 1rem 0.5rem;
    margin-bottom: 1rem;
  }
  
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  .section-underline .line {
    width: 30px;
    margin: 0 8px;
  }
  
  .section-underline .icon {
    font-size: 16px;
  }
  
  .suggested-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.8rem;
    margin: 0.8rem 0.3rem 1.5rem;
  }
  
  .suggest-card {
    padding: 0.6rem;
    min-height: 200px;
    border-radius: 8px;
  }
  
  .suggest-card img {
    height: 110px;
    border-radius: 4px;
  }
  
  .suggest-card h3 {
    margin: 0.6rem 0;
    font-size: 0.85rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .blue-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
  }
  
  .no-products {
    min-height: 200px;
    margin: 0 0.3rem;
  }
  
  .no-products-content {
    padding: 1.5rem;
  }
  
  .no-products-icon {
    font-size: 3rem;
  }
  
  .no-products-content h3 {
    font-size: 1.2rem;
  }
  
  .no-products-content p {
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  .suggested-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
    margin: 0.6rem 0.2rem 1rem;
  }
  
  .suggest-card {
    padding: 0.5rem;
    min-height: 180px;
  }
  
  .suggest-card img {
    height: 100px;
  }
  
  .suggest-card h3 {
    margin: 0.5rem 0;
    font-size: 0.8rem;
  }
  
  .blue-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .suggested-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  
  .suggest-card {
    min-height: 220px;
  }
  
  .suggest-card img {
    height: 120px;
  }
}

/* Very small screens */
@media (max-width: 320px) {
  .suggested-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin: 0.4rem 0.1rem 0.8rem;
  }
  
  .suggest-card {
    padding: 0.4rem;
    min-height: 160px;
  }
  
  .suggest-card img {
    height: 90px;
  }
  
  .suggest-card h3 {
    font-size: 0.75rem;
    margin: 0.4rem 0;
  }
  
  .blue-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
}
