/* Products Section Styles */
.products-section {
  padding: 2rem 0;
  background: var(--surface);
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2rem;
}

/* Category Filters */
.category-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  padding: 0 1rem;
}

.category-filter {
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--brand);
  background: transparent;
  color: var(--brand);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.9rem;
}

.category-filter:hover,
.category-filter.active {
  background: var(--brand);
  color: white;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 0 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Product Card */
.product-card {
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--border);
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Product Image */
.product-image {
  position: relative;
  padding-top: 75%;
  background: var(--surface);
  overflow: hidden;
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

/* Quick View Button */
.quick-view-btn {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-card:hover .quick-view-btn {
  opacity: 1;
}

/* Product Info */
.product-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card-bg);
}

.product-info h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0.5rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.price-original {
  text-decoration: line-through;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: normal;
}

.description {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Add to Cart Button */
.add-to-cart-btn {
  width: 100%;
  padding: 0.6rem 1rem;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  margin-top: auto;
}

.add-to-cart-btn i {
  font-size: 0.9rem;
}

.add-to-cart-btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Loading State */
.product-loading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 968px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
  }
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 1rem;
  }

  .category-filters {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
  }

  .category-filter {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }

  .product-details {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .modal-content {
    width: 95%;
    padding: 1rem;
    margin: 5vh auto;
  }

  .product-card {
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .category-filters {
    padding: 0 0.5rem;
  }

  .products-section {
    padding: 1.5rem 0;
  }

  .section-title {
    font-size: 1.5rem;
    padding: 0 1rem;
  }

  .modal-content {
    width: 98%;
    padding: 0.75rem;
    margin: 2vh auto;
    max-height: 96vh;
  }

  .close-modal {
    top: 0.5rem;
    right: 0.5rem;
  }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
  .product-card:hover {
    transform: none;
  }

  .quick-view-btn,
  .add-to-cart-btn {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
}