/* ===== PRODUCTS PAGE STYLES ===== */

/* Page Header */
.page-header {
  background: linear-gradient(135deg, var(--ui-light-accent-color) 0%, var(--ui-media-bg) 100%);
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(247, 189, 0, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 15s ease-in-out infinite;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(235, 109, 47, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 20s ease-in-out infinite reverse;
}

.page-header__content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.page-header__breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.breadcrumb__link {
  color: var(--ui-text-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s ease;
}

.breadcrumb__link:hover {
  color: var(--ui-brand-color);
}

.breadcrumb__separator {
  color: var(--ui-subtitle-color);
  font-size: 0.8rem;
}

.breadcrumb__current {
  color: var(--ui-dark-shade-color);
  font-weight: 500;
}

.page-header__title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--ui-dark-shade-color);
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-header__subtitle {
  font-size: 1.2rem;
  color: var(--ui-text-color);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* Products Controls */
.products-controls {
  background: var(--ui-light-shade-color);
  padding: 30px 0;
  border-bottom: 1px solid rgba(90, 55, 51, 0.1);
  /* position: sticky; */
  top: 80px;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.products-controls__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.filters {
  display: flex;
  gap: 20px;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-label,
.sort-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ui-dark-shade-color);
  white-space: nowrap;
}

.filter-select,
.sort-select {
  padding: 8px 15px;
  border: 2px solid rgba(90, 55, 51, 0.1);
  border-radius: 8px;
  background: var(--ui-light-shade-color);
  color: var(--ui-dark-shade-color);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.filter-select:focus,
.sort-select:focus {
  outline: none;
  border-color: var(--ui-brand-color);
  box-shadow: 0 0 0 3px rgba(247, 189, 0, 0.1);
}

.sort-view {
  display: flex;
  align-items: center;
  gap: 20px;
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-toggle {
  display: flex;
  gap: 5px;
  background: rgba(90, 55, 51, 0.05);
  padding: 5px;
  border-radius: 10px;
}

.view-btn {
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--ui-text-color);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.view-btn--active {
  background: var(--ui-brand-color);
  color: var(--ui-dark-shade-color);
  box-shadow: 0 2px 8px rgba(247, 189, 0, 0.3);
}

.view-btn:hover:not(.view-btn--active) {
  background: rgba(90, 55, 51, 0.1);
  color: var(--ui-dark-shade-color);
}

.results-info {
  font-size: 0.9rem;
  color: var(--ui-text-color);
}

/* Products Section */
.products-section {
  padding: 60px 0;
  background: var(--ui-light-shade-color);
  min-height: 60vh;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.products-grid--list {
  grid-template-columns: 1fr;
  gap: 20px;
}

/* Product Card */
.product-card {
  background: var(--ui-light-shade-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(90, 55, 51, 0.08);
  transition: all 0.4s ease;
  position: relative;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(90, 55, 51, 0.15);
}

.product-card--list {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

.product-card--list .product__image-wrapper {
  width: 200px;
  height: 150px;
  flex-shrink: 0;
}

.product-card--list .product__content {
  flex: 1;
  padding: 0;
}

.product__image-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--ui-light-accent-color), var(--ui-media-bg));
}

.product__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product__image {
  transform: scale(1.1);
}

.product__badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--ui-brand-color);
  color: var(--ui-dark-shade-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.product__badge--sale {
  background: var(--ui-dark-accent-color);
  color: var(--ui-light-shade-color);
}

.product__badge--new {
  background: #28a745;
  color: var(--ui-light-shade-color);
}

.product__badge--organic {
  background: #6f42c1;
  color: var(--ui-light-shade-color);
}

.product__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 60%,
    rgba(90, 55, 51, 0.8) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover .product__overlay {
  opacity: 1;
}

.product__actions {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
}

.product-card:hover .product__actions {
  opacity: 1;
  transform: translateX(0);
}

.product__action-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ui-dark-shade-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.product__action-btn:hover {
  background: var(--ui-brand-color);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(247, 189, 0, 0.4);
}

.product__action-btn--favorite.active {
  background: var(--ui-dark-accent-color);
  color: var(--ui-light-shade-color);
}

.product__quick-view {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ui-dark-shade-color);
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-card:hover .product__quick-view {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.product__quick-view:hover {
  background: var(--ui-brand-color);
  transform: translateX(-50%) translateY(-5px);
  box-shadow: 0 8px 25px rgba(247, 189, 0, 0.4);
}

.product__content {
  padding: 25px;
}

.product__category {
  color: var(--ui-text-color);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 500;
}

.product__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ui-dark-shade-color);
  margin-bottom: 12px;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.product-card:hover .product__title {
  color: var(--ui-brand-color);
}

.product__description {
  color: var(--ui-text-color);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.product__rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product__stars {
  display: flex;
  gap: 2px;
}

.product__star {
  color: #ffd700;
  font-size: 0.9rem;
}

.product__star--empty {
  color: #ddd;
}

.product__rating-count {
  color: var(--ui-text-color);
  font-size: 0.85rem;
}

.product__availability {
  font-size: 0.85rem;
  font-weight: 500;
}

.product__availability--in-stock {
  color: #28a745;
}

.product__availability--low-stock {
  color: #ffc107;
}

.product__availability--out-stock {
  color: #dc3545;
}

.product__price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.product__price-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product__price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ui-brand-color);
}

.product__price--original {
  font-size: 1.1rem;
  color: var(--ui-text-color);
  text-decoration: line-through;
  font-weight: 400;
}

.product__discount {
  background: var(--ui-dark-accent-color);
  color: var(--ui-light-shade-color);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.product__add-to-cart {
  width: 100%;
  background: linear-gradient(135deg, var(--ui-brand-color), var(--ui-link-hover-color));
  color: var(--ui-dark-shade-color);
  border: none;
  padding: 15px 25px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.product__add-to-cart::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transition: all 0.4s ease;
  transform: translate(-50%, -50%);
}

.product__add-to-cart:hover::before {
  width: 300px;
  height: 300px;
}

.product__add-to-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(247, 189, 0, 0.4);
}

.product__add-to-cart:active {
  transform: translateY(0);
}

.product__add-to-cart--added {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: var(--ui-light-shade-color);
}

/* Load More */
.load-more {
  text-align: center;
}

.load-more__btn {
  background: transparent;
  border: 2px solid var(--ui-brand-color);
  color: var(--ui-brand-color);
  padding: 15px 40px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.load-more__btn:hover {
  background: var(--ui-brand-color);
  color: var(--ui-dark-shade-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(247, 189, 0, 0.3);
}

.load-more__icon {
  transition: transform 0.3s ease;
}

.load-more__btn:hover .load-more__icon {
  transform: translateY(3px);
}

/* Loading Spinner */
.loading-spinner {
  display: none;
  text-align: center;
  padding: 40px 0;
}

.loading-spinner.show {
  display: block;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(247, 189, 0, 0.2);
  border-left: 4px solid var(--ui-brand-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.loading-spinner p {
  color: var(--ui-text-color);
  font-size: 0.9rem;
}

/* Quick View Modal */
.quick-view-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.quick-view-modal.show {
  opacity: 1;
  visibility: visible;
}

.quick-view__content {
  background: var(--ui-light-shade-color);
  border-radius: 20px;
  padding: 40px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.quick-view-modal.show .quick-view__content {
  transform: scale(1);
}

.quick-view__close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--ui-text-color);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.quick-view__close:hover {
  background: rgba(90, 55, 51, 0.1);
  color: var(--ui-dark-shade-color);
}

.quick-view__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.quick-view__image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.quick-view__image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.quick-view__details h3 {
  font-size: 2rem;
  color: var(--ui-dark-shade-color);
  margin-bottom: 15px;
}

.quick-view__details p {
  color: var(--ui-text-color);
  line-height: 1.6;
  margin-bottom: 20px;
}

.quick-view__price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ui-brand-color);
  margin-bottom: 25px;
}

.quick-view__actions {
  display: flex;
  gap: 15px;
}

.quick-view__btn {
  flex: 1;
  padding: 15px 25px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quick-view__btn--primary {
  background: var(--ui-brand-color);
  color: var(--ui-dark-shade-color);
}

.quick-view__btn--secondary {
  background: transparent;
  color: var(--ui-brand-color);
  border: 2px solid var(--ui-brand-color);
}

.quick-view__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(247, 189, 0, 0.3);
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-header__title {
    font-size: 2.5rem;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
  }
  
  .quick-view__body {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 100px 0 60px;
  }
  
  .page-header__title {
    font-size: 2rem;
  }
  
  .page-header__subtitle {
    font-size: 1.1rem;
  }
  
  .products-controls__content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filters {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .sort-view {
    justify-content: space-between;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }
  
  .product-card--list {
    flex-direction: column;
    gap: 15px;
  }
  
  .product-card--list .product__image-wrapper {
    width: 100%;
    height: 200px;
  }
  
  .quick-view__content {
    padding: 30px 20px;
  }
}

@media (max-width: 480px) {
  .page-header {
    padding: 90px 0 50px;
  }
  
  .page-header__title {
    font-size: 1.8rem;
  }
  
  .page-header__breadcrumb {
    gap: 5px;
    text-align: center;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .product__content {
    padding: 20px;
  }
  
  .filter-select,
  .sort-select {
    min-width: 100px;
    font-size: 0.85rem;
  }
  
  .view-toggle {
    order: -1;
    margin-bottom: 10px;
  }
  
  .results-info {
    text-align: center;
  }
}

/* High Performance Optimizations */
.product-card {
  contain: layout style paint;
}

.product__image {
  will-change: transform;
}

.product__overlay {
  will-change: opacity;
}

.product__actions {
  will-change: opacity, transform;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Styles */
.filter-select:focus,
.sort-select:focus,
.view-btn:focus,
.product__action-btn:focus,
.product__add-to-cart:focus,
.load-more__btn:focus {
  outline: 3px solid var(--ui-brand-color);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .products-controls,
  .product__actions,
  .product__overlay,
  .load-more,
  .cart-sidebar {
    display: none !important;
  }
  
  .product-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
