/* =========================
   SECTION: Page heading
   NOTE:
   - Ganti inline style pada tajuk & subtitle catalog
   ========================= */
.catalog-page-title {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: 'Playfair Display', serif;
}

.catalog-page-subtitle {
  margin-bottom: 14px;
  color: var(--muted);
}

.catalog-nav-current {
  font-weight: 700;
}

.catalog-muted-top {
  margin-top: 6px;
  color: var(--muted);
}

.catalog-hours-pill-offset {
  margin-left: 8px;
}

.catalog-hours-note,
.catalog-social-dot {
  color: var(--muted);
}

.catalog-disabled-btn {
  pointer-events: none;
  opacity: 0.7;
}

.catalog-load-more-hidden {
  display: none;
}

/* =========================
   SECTION: Grid / cards
   DEPENDENCY:
   - HTML gunakan .grid.cards dari styles global
   - Tambahan ini scoped kepada body.catalog-page
   DEBUG-POINT:
   - Kalau card layout pecah, semak minmax dan image height di bawah
   ========================= */
.catalog-page .grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.catalog-page .card > img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 16px;
}

.catalog-page .p-title {
  display: -webkit-box;
  min-height: calc(1.25em * 2);
  margin: 0 0 8px;
  overflow: hidden;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-page .price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.catalog-page .meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.catalog-page .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.catalog-page .badge-pill {
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-gold { background: #fff4cc; color: #7a5a00; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #374151; }

/* =========================
   SECTION: Toolbar
   NOTE:
   - Search + sort preserve layout asal
   DEBUG-POINT:
   - Kalau input/search icon lari, semak positioning di sini
   ========================= */
.catalog-toolbar-card {
  margin-bottom: 16px;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.55fr);
  align-items: center;
  gap: 12px;
}

.catalog-search-box {
  position: relative;
}

.catalog-search-box i {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.catalog-search-input {
  width: 100%;
  height: 52px;
  padding: 0 52px 0 42px;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: #fff;
  color: #3f3f46;
  font: inherit;
  outline: none;
  transition: 0.2s ease;
}

.catalog-search-input:focus {
  border-color: rgba(244, 196, 48, 0.9);
  box-shadow: 0 0 0 4px rgba(244, 196, 48, 0.12);
}

.catalog-search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  display: none;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: #f4f4f5;
  color: #52525b;
  cursor: pointer;
}

.catalog-search-clear.show {
  display: inline-flex;
}

.catalog-sort-select {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: #fff;
  color: #3f3f46;
  font: inherit;
  outline: none;
}

/* =========================
   SECTION: Filter chips / meta pills
   ========================= */
.catalog-filter-card {
  margin-bottom: 16px;
}

.catalog-filter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.catalog-filter-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.catalog-meta-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.catalog-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff7d8;
  color: #8a6500;
  font-size: 0.85rem;
  font-weight: 600;
}

.catalog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.catalog-chip {
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: #fff;
  color: #444;
  cursor: pointer;
  font: inherit;
  transition: 0.2s ease;
}

.catalog-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.catalog-chip.active {
  border-color: #f4c430;
  background: #f4c430;
  color: #2f2300;
  font-weight: 700;
}

/* =========================
   SECTION: States
   DEPENDENCY:
   - JS toggle class .show
   DEBUG-POINT:
   - Kalau loading/error/empty tak muncul, semak toggle class ni di JS
   ========================= */
.catalog-status {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.catalog-empty,
.catalog-loading,
.catalog-error {
  display: none;
  margin-top: 8px;
}

.catalog-empty.show,
.catalog-loading.show,
.catalog-error.show {
  display: block;
}

.catalog-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.catalog-item {
  height: 100%;
  opacity: 0;
  transform: translateY(10px);
  animation: catalogFadeUp 0.35s ease forwards;
}

.catalog-item.hidden {
  display: none !important;
}

/* =========================
   SECTION: Skeleton loading
   ========================= */
.catalog-skeleton {
  position: relative;
  overflow: hidden;
  min-height: 420px;
}

.catalog-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  animation: hbShimmer 1.3s infinite;
}

.catalog-skeleton .sk-img {
  height: 260px;
  border-radius: 16px;
  background: #ececec;
}

.catalog-skeleton .sk-line {
  height: 14px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #ececec;
}

.catalog-skeleton .sk-line.sm { width: 45%; }
.catalog-skeleton .sk-line.md { width: 68%; }
.catalog-skeleton .sk-line.lg { width: 88%; }

#catalogScrollSentinel {
  width: 100%;
  height: 1px;
}

/* =========================
   SECTION: Animations
   ========================= */
@keyframes hbShimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes catalogFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   SECTION: Responsive
   NOTE:
   - Tilt effect desktop only, preserve asal
   DEBUG-POINT:
   - Kalau mobile image glitch, cuba matikan tilt terus
   ========================= */
@media (min-width: 768px) {
  .catalog-page .tilt.tilt--l { transform: rotate(-1.5deg); }
  .catalog-page .tilt.tilt--r { transform: rotate(1.5deg); }
}

@media (max-width: 991px) {
  .catalog-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .catalog-page .meta-row {
    align-items: flex-start;
  }

  .catalog-filter-head {
    flex-direction: column;
    align-items: flex-start;
  }
}