/* ==============================================
   Products — Featured Grid, Modal
   ============================================== */

/* ========== FEATURED GRID (2 rows x 3 cols) ========== */
.featured-section {
  padding: 4rem 0;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Category Filters */
.products-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.products-filters::-webkit-scrollbar {
  height: 4px;
}
.products-filters::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.filter-btn {
  padding: 8px 18px;
  border: 1px solid var(--accent);
  border-radius: 50px;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.filter-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
}
.filter-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
}

/* Product Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 2rem;
}

/* Product Card */
a.product-card {
  text-decoration: none;
  color: inherit;
  display: block;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-secondary);
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-info {
  padding: 14px;
}
.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  min-height: 36px;
}
.product-price {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.price-sale {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}
.price-original {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
}
.product-category-tag {
  display: inline-block;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Products Footer */
.products-footer {
  text-align: center;
  padding: 1rem 0;
}
.load-more-btn {
  padding: 12px 40px;
  border: 2px solid var(--accent);
  border-radius: 50px;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.load-more-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ========== PRODUCT MODAL ========== */
.product-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.product-modal.open {
  display: flex;
}

.product-modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  max-width: 950px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid var(--border);
}

.product-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-elevated);
  transition: all 0.2s;
}
.product-modal-close:hover {
  color: var(--text-primary);
  background: var(--border);
}

.product-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

/* Modal Gallery */
.product-modal-gallery {
  padding: 24px;
  border-right: 1px solid var(--border);
}
.product-modal-main-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: var(--bg-secondary);
  margin-bottom: 12px;
}
.product-modal-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.product-modal-thumbs .thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s;
  flex-shrink: 0;
}
.product-modal-thumbs .thumb:hover,
.product-modal-thumbs .thumb.active {
  border-color: var(--accent);
  opacity: 1;
}

/* Modal Info */
.product-modal-info {
  padding: 32px 24px;
  overflow-y: auto;
}
.product-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 12px;
  padding-right: 40px;
}
.product-modal-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 20px;
}
.product-modal-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .product-info {
    padding: 10px;
  }
  .product-name {
    font-size: 12px;
    min-height: 32px;
  }
  .price-sale {
    font-size: 14px;
  }

  /* Modal mobile */
  .product-modal {
    padding: 0;
    align-items: flex-end;
  }
  .product-modal-content {
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    max-width: 100%;
  }
  .product-modal-body {
    grid-template-columns: 1fr;
  }
  .product-modal-gallery {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .product-modal-info {
    padding: 20px 16px;
  }
  .product-modal-title {
    font-size: 17px;
  }
  .product-modal-price {
    font-size: 20px;
  }
  .product-modal-thumbs .thumb {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 480px) {
  .featured-section {
    padding: 2rem 0;
  }
  .featured-grid {
    gap: 10px;
  }
}
