/* ═══════════════════════════════════════════════════════════
   Abona Shop — Main Shop Page
   ═══════════════════════════════════════════════════════════ */

.category-bar {
  position: sticky;
  top: 72px;
  z-index: 90;
  margin-top: 72px;
  background: #1e1040;
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }

html.dark .category-bar { background: #0d0820; }

.cat-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.15s;
}
.cat-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.cat-btn.active { background: #c73060; color: #fff; border-color: #c73060; font-weight: 600; }

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 16px;
  background: var(--abona-card);
  border-bottom: 1px solid var(--abona-border);
  flex-wrap: wrap;
  font-size: 13px;
  transition: background 0.3s;
}

html.dark .filter-bar { background: #1a1030; border-bottom-color: #2a2040; }

.filter-bar-label {
  font-weight: 600;
  color: var(--abona-text);
  flex-shrink: 0;
}

.filter-price-group,
.filter-rating-group {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--abona-sub);
}

.price-filter-input {
  width: 76px;
  padding: 4px 8px;
  border: 1px solid var(--abona-border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: var(--abona-input-bg);
  color: var(--abona-text);
}
.price-filter-input:focus { outline: none; border-color: #c73060; }

.filter-sep { color: var(--abona-sub); }

.filter-chip {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--abona-border);
  background: var(--abona-card);
  color: var(--abona-text);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.filter-chip:hover { background: var(--abona-rose-light); border-color: #c73060; color: #c73060; }
.filter-chip.active { background: #1e1040; color: #fff; border-color: #1e1040; }
.rating-chip.active { background: #c73060; color: #fff; border-color: #c73060; }
.filter-chip.apply-chip { background: #c73060; border-color: #a8264f; color: #fff; font-weight: 600; }
.filter-chip.apply-chip:hover { background: #d9406d; }

html.dark .filter-chip { background: #1e1834; border-color: #2a2040; color: #f0eaf8; }
html.dark .filter-chip:hover { background: #2d1f50; border-color: #c73060; color: #f78fb3; }
html.dark .filter-chip.active { background: #2d1a5e; border-color: #4a2080; }
html.dark .rating-chip.active { background: #c73060; border-color: #a8264f; color: #fff; }
html.dark .filter-chip.apply-chip { background: #c73060; color: #fff; }

/* ── Search status ────────────────────────────────────────── */
.search-status {
  padding: 10px 16px 0;
  font-size: 14px;
  color: var(--abona-sub);
}

/* ── Main grid layout ─────────────────────────────────────── */
.main { padding: 20px 16px 40px; }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

@media (max-width: 1400px) { .products-grid { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); } }
@media (max-width: 800px)  { .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; } }
@media (max-width: 480px)  { .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* ── Product cards ────────────────────────────────────────── */
.product-container {
  padding: 16px 14px 18px;
  border: 1px solid var(--abona-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  background: var(--abona-card);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 1px 4px var(--abona-shadow);
}
.product-container:hover {
  box-shadow: 0 6px 24px var(--abona-shadow);
  transform: translateY(-3px);
  border-color: #c73060;
}

.product-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  margin-bottom: 14px;
  position: relative;
  background: var(--abona-bg);
  border-radius: 8px;
  overflow: hidden;
}

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }

/* Stock badges */
.stock-tag {
  position: absolute;
  top: 6px; left: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}
.stock-tag-out { background: #fee2e2; color: #c40000; }
.stock-tag-low { background: #fef9c3; color: #92400e; }

/* Wishlist heart button */
.wishlist-btn {
  position: absolute;
  top: 6px; right: 6px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  color: #ccc;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, transform 0.1s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  padding: 0;
}
.wishlist-btn:hover { color: #e53935; background: #fff; transform: scale(1.1); }
.wishlist-btn.wishlisted { color: #e53935; }

html.dark .wishlist-btn { background: rgba(30,24,52,0.85); color: #6b6480; }
html.dark .wishlist-btn:hover { background: #1e1834; color: #f78fb3; }
html.dark .wishlist-btn.wishlisted { color: #f78fb3; }

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.2s;
  padding: 6px;
}
.product-image:hover { transform: scale(1.06); }

.product-name {
  height: 44px;
  margin-bottom: 6px;
  color: var(--abona-text);
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-rating-container {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.product-rating-stars { width: 100px; margin-right: 6px; }

.product-rating-count {
  color: var(--abona-rose, #c73060);
  cursor: pointer;
  margin-top: 3px;
  font-size: 13px;
}

.product-price {
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--abona-rose, #c73060);
}

.product-quantity-container { margin-bottom: 17px; }

.product-spacer { flex: 1; }

.added-to-cart {
  color: #16a34a;
  font-size: 13px;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
.added-to-cart img { height: 20px; margin-right: 5px; }

.add-to-cart-button {
  width: 100%;
  padding: 8px;
  border-radius: 50px;
}

/* ── Responsive filter bar ────────────────────────────────── */
@media (max-width: 700px) {
  .filter-bar { gap: 10px; padding: 8px 12px; }
  .filter-bar-label { display: none; }
  .price-filter-input { width: 64px; }
}
@media (max-width: 480px) {
  .filter-bar { flex-direction: column; align-items: flex-start; }
  .filter-price-group, .filter-rating-group { flex-wrap: wrap; }
}
