/* Products Page & Product Cards */

/* Product Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

/* Product Card */
.product-card {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(179, 27, 27, 0.05);
  overflow: hidden;
}

.product-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border: 2px solid transparent;
  border-radius: 20px;
  pointer-events: none;
  transition: border-color 0.4s ease;
}

.product-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 40px rgba(179, 27, 27, 0.12);
}

.product-card:hover::after {
  border-color: var(--primary-red);
}

.product-badge {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: linear-gradient(135deg, var(--accent-green), #1b5e20);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(46, 125, 50, 0.4);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.product-image-wrap {
  width: 100%;
  padding-bottom: 110%; /* Slightly taller aspect ratio to better fit the boxes */
  position: relative;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  background-color: transparent; /* Changed from dark bg so boxes blend in seamlessly */
}

.product-image-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* Changed from cover so the full tall box is visible without cropping */
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sprite-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:hover .sprite-image {
  transform: scale(1.08);
}

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

.product-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.product-category {
  font-size: 0.85rem;
  color: var(--secondary-orange);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.product-title {
  font-family: var(--font-secondary);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.product-desc {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-red);
}

.add-to-cart-btn {
  background: var(--glass-bg);
  color: var(--primary-red);
  border: 1px solid var(--primary-red);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
}

.product-card:hover .add-to-cart-btn {
  background: var(--primary-red);
  color: white;
}

/* Filter System */
.products-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filters-container {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.5rem;
  border-radius: 30px;
  background: var(--bg-white);
  color: var(--text-dark);
  font-weight: 500;
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.filter-btn.active, .filter-btn:hover {
  background: var(--primary-red);
  color: white;
  border-color: var(--primary-red);
  box-shadow: 0 4px 10px rgba(179, 27, 27, 0.2);
}

.search-container {
  position: relative;
  max-width: 300px;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.5rem;
  border-radius: 30px;
  border: 1px solid var(--border-light);
  background: var(--bg-white);
  font-family: var(--font-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-input:focus {
  border-color: var(--secondary-orange);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

/* ═══════════════════ PRODUCTS RESPONSIVE ═══════════════════ */

@media (max-width: 992px) {
  .products-header {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-container {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .search-container {
    max-width: 100%;
  }
}

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

  .product-card {
    padding: 0.8rem;
    border-radius: 14px;
  }

  .product-image-wrap {
    margin-bottom: 0.8rem;
    border-radius: 10px;
  }

  .product-badge {
    top: 0.8rem;
    left: 0.8rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.65rem;
  }

  .product-title {
    font-size: 1rem;
  }

  .product-desc {
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
    /* Clamp to 2 lines on mobile */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-category {
    font-size: 0.7rem;
    margin-bottom: 0.3rem;
  }

  .product-price {
    font-size: 1.05rem;
  }

  .add-to-cart-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .product-footer {
    padding-top: 0.6rem;
  }

  .product-card:hover {
    transform: translateY(-5px);
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .product-card {
    padding: 0.6rem;
  }

  .product-title {
    font-size: 0.9rem;
  }

  .product-desc {
    font-size: 0.75rem;
    -webkit-line-clamp: 2;
  }
}
