@import './vars.css';

.catalog-page { padding: 100px 40px 80px; min-height: 100vh; }

.catalog-header { margin-bottom: 48px; }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.search-field {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.search-field input {
  width: 100%;
  padding: 14px 18px 14px 50px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  color: #fff;
  font-size: 0.95rem;
  font-family: var(--fb);
  outline: none;
  transition: all 0.2s;
}

.search-field input:focus { border-color: var(--p5); background: rgba(255,255,255,0.1); box-shadow: 0 0 0 3px rgba(230,26,26,.12); }

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.4);
  font-size: 1rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.product-card {
  border-radius: var(--bloom-radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--ethereal-blur));
  -webkit-backdrop-filter: blur(var(--ethereal-blur));
  overflow: hidden;
  cursor: pointer;
  transition: all 0.5s var(--bloom-transition);
  position: relative;
  transform-style: preserve-3d;
  perspective: 1000px;
  scroll-margin-top: 140px;
}

.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-shine);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.product-card:hover {
  transform: translateY(-12px) rotateX(4deg) rotateY(2deg);
  border-color: rgba(230, 26, 26, 0.45);
  box-shadow: 
    0 40px 100px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(230, 26, 26, 0.2);
}

.product-card:hover::before {
  opacity: 1;
}

.product-img-wrap {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(230, 26, 26, 0.15), rgba(11, 5, 22, 0.4));
  margin: 12px;
  border-radius: calc(var(--bloom-radius) - 8px);
  transform: translateZ(20px);
  transition: transform 0.5s var(--bloom-transition);
}

.product-card:hover .product-img-wrap {
  transform: translateZ(40px);
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.product-card:hover .product-img-wrap img { transform: scale(1.08); }

.product-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.product-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-fresh       { background: rgba(0,212,170,0.25);  color: var(--bloom-mint);   border: 1px solid rgba(0,212,170,0.4); }
.badge-dried       { background: rgba(255,215,0,0.2);   color: var(--gd);           border: 1px solid rgba(255,215,0,0.3); }
.badge-branded     { background: rgba(124,58,237,0.25); color: #A78BFA;             border: 1px solid rgba(124,58,237,0.4); }
.badge-bundled     { background: rgba(255,107,107,0.2); color: var(--bloom-coral);  border: 1px solid rgba(255,107,107,0.3); }
.badge-merchandise { background: rgba(56,189,248,0.2);  color: var(--bloom-sky);    border: 1px solid rgba(56,189,248,0.3); }

.product-wishlist {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(26,10,46,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  transform: translateZ(50px);
  z-index: 10;
}

.product-wishlist:hover,
.product-wishlist.active { background: rgba(230,26,26,.2); color: var(--p5); border-color: var(--p5); }

.product-body { padding: 20px; }

.product-name {
  font-family: var(--fd);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
  line-height: 1.2;
}

.product-desc { font-size: 0.83rem; color: rgba(255,255,255,0.5); line-height: 1.5; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.product-meta { display: flex; align-items: center; justify-content: space-between; }

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gd);
}

.product-rating { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: rgba(255,255,255,0.5); }

.product-actions { display: flex; gap: 10px; margin-top: 16px; }
.product-actions .btn { flex: 1; justify-content: center; padding: 10px; font-size: 0.85rem; }

.ai-rec-bar {
  padding: 32px;
  border-radius: var(--bloom-radius);
  background: linear-gradient(135deg, rgba(230,26,26,.1), rgba(124,58,237,0.12));
  border: 1px solid rgba(230,26,26,.22);
  margin-bottom: 48px;
}

.ai-rec-bar h3 { font-family: var(--fd); font-size: 1.1rem; margin-bottom: 20px; }

.rec-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.rec-scroll::-webkit-scrollbar { display: none; }

.rec-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 100px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s var(--bloom-transition);
  text-decoration: none;
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  font-weight: 500;
  flex-shrink: 0;
  min-width: max-content;
}

.rec-chip > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

.rec-chip-name {
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.rec-chip-price {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

.rec-chip:hover { background: rgba(230,26,26,.18); border-color: var(--p5); color: #fff; transform: translateY(-4px); }

.rec-chip img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.rec-chip-emoji { font-size: 1.4rem; }

.category-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 48px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  padding: 10px 24px;
  border-radius: 100px;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: transparent;
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s var(--bloom-transition);
  font-family: var(--fb);
  letter-spacing: 0.3px;
}

.cat-tab:hover {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

.cat-tab.active {
  background: linear-gradient(135deg, rgba(230,26,26,.22), rgba(188,49,148,.16));
  border-color: rgba(230,26,26,.4);
  color: #fff;
  box-shadow: 0 4px 20px rgba(230,26,26,.3);
}

.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 48px; }

.page-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: var(--fb);
  transition: all 0.2s;
}

.page-btn:hover { border-color: var(--p5); color: #fff; }
.page-btn.active { background: var(--p5); border-color: var(--p5); color: #fff; }
