/* =============== PRODUCT PAGE SPECIFIC STYLES =============== */

/* Page Hero Section - Products Page */
#page-hero {
  background-color: var(--primary-light);
  padding: var(--space-xxl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(74, 111, 238, 0.12), transparent 70%);
}

#page-hero .page-hero-content {
  max-width: 800px;
  margin: 0 auto;
}

#page-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

#page-hero p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Products Main Section */
#products-main {
  padding: 3rem 0;
}

.products-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

/* Filter Sidebar */
.filter-sidebar {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  height: fit-content;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.sidebar-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.mobile-filter-close {
  display: none;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
}

.filter-group {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 1.5rem;
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 1rem;
}

.filter-group h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #333;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-option {
  display: flex;
  align-items: center;
}

.filter-option input[type="checkbox"] {
  margin-right: 0.5rem;
  cursor: pointer;
}

.filter-option label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  font-size: 0.9rem;
  padding-left: 0.5rem;
}

.count-badge {
  background: #f0f0f0;
  color: #666;
  padding: 0.1rem 0.4rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Price Range Slider */
.price-range {
  width: 100%;
}

.price-inputs {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.price-input {
  width: 45%;
}

.price-input label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  color: #666;
}

.price-input input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.price-slider {
  width: 100%;
  height: 5px;
  -webkit-appearance: none;
  background: #ddd;
  outline: none;
  border-radius: 5px;
  margin: 1rem 0;
}

.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

.price-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
}

/* Filter Actions */
.filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.filter-reset,
.filter-apply {
  flex: 1;
  padding: 0.6rem 0.5rem;
  font-size: 0.85rem;
}

/* Stars Rating */
.stars {
  color: #ffb700;
  letter-spacing: 1px;
}

/* Products Content Area */
.products-content {
  background: #f6f5ff;
  padding: 1rem;
  border-radius: var(--radius-md);

}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.products-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.products-info p {
  margin: 0;
  font-size: 0.9rem;
  color: #555;
}

.product-count {
  font-weight: 600;
  color: #333;
}

.mobile-filter-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.mobile-filter-toggle svg {
  width: 16px;
  height: 16px;
}

.products-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-label {
  font-size: 0.9rem;
  color: #555;
}

.sort-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Product Card */
.product-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-badge {
  position: absolute;
  top: 1rem;
  left: 0;
  padding: 0.25rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  z-index: 1;
}

.product-badge.bestseller {
  background-color: #ff6b6b;
}

.product-badge.new {
  background-color: #51cf66;
}

.product-badge.sale {
  background-color: #339af0;
}

.product-image {
  height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f8f8;
  border-radius: 8px 8px 0 0;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-details {
  padding: 1.25rem;
}

.product-details h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.product-rating .count {
  font-size: 0.8rem;
  color: #777;
}

.product-price {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.current-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
}

.original-price {
  font-size: 0.9rem;
  color: #999;
  text-decoration: line-through;
}

.product-actions {
  display: flex;
  gap: 0.5rem;
}

.view-btn,
.add-cart-btn {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  flex: 1;
  text-align: center;
}

.view-btn {
  background-color: #f8f8f8;
  color: #333;
  border: 1px solid #ddd;
}

.view-btn:hover {
  background-color: #eee;
}

.add-cart-btn {
  background-color: var(--primary-color);
  color: #fff;
  border: 1px solid var(--primary-color);
}

.add-cart-btn:hover {
  background-color: var(--primary-hover);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 3rem;
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not([disabled]) {
  background-color: #f5f5f5;
  color: #333;
}

.pagination-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-numbers {
  display: flex;
  align-items: center;
  margin: 0 1rem;
}

.pagination-numbers a,
.pagination-numbers span {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  margin: 0 0.25rem;
  color: #555;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
}

.pagination-numbers a:hover {
  background-color: #f5f5f5;
}

.pagination-numbers a.active {
  background-color: var(--primary-color);
  color: #fff;
}

/* Recently Viewed Section */
#recently-viewed {
  padding: 3rem 0;
  background-color: #f8f8f8;
}

.recent-products-slider {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .recent-products-slider {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .products-wrapper {
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .products-wrapper {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    transition: left 0.3s ease;
    border-radius: 0;
  }

  .filter-sidebar.active {
    left: 0;
  }

  .mobile-filter-close {
    display: block;
  }

  .mobile-filter-toggle {
    display: flex;
  }

  .products-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .products-info {
    width: 100%;
    justify-content: space-between;
  }

  .products-sort {
    width: 100%;
  }

  .sort-select {
    flex: 1;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .recent-products-slider {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .recent-products-slider {
    grid-template-columns: 1fr;
  }

  .pagination-numbers {
    display: none;
  }

  .pagination {
    justify-content: space-between;
  }

  .filter-actions {
    flex-direction: column;
  }
}
