/* ═══ PRODUK ═════════════════════════════════════════════════════ */

/* ── Filter kategori ─────────────────────────────────────────────── */
.filter {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--clr-white);
  border: 1px solid var(--clr-gray-200);
  border-radius: var(--r-pill);
  margin-bottom: var(--sp-4);
  overflow-x: auto;
  scrollbar-width: none;
  width: fit-content;
  max-width: 100%;
}
.filter::-webkit-scrollbar { display: none; }

.filter__btn {
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--clr-gray-600);
  white-space: nowrap;
  transition: var(--t-fast);
}
.filter__btn:hover { background: var(--clr-gray-100); color: var(--clr-dark); }
.filter__btn.is-active { background: var(--clr-primary); color: #fff; font-weight: 600; }
.filter__btn span {
  font-size: 0.75rem;
  opacity: 0.65;
  margin-left: 5px;
}

.filter-meta {
  font-size: 0.875rem;
  color: var(--clr-gray-500);
  margin-bottom: var(--sp-3);
}
.filter-meta strong { color: var(--clr-dark); font-weight: 600; }

/* Kartu produk yang tersembunyi saat difilter */
.prod-card.is-hidden { display: none; }

/* ── Detail produk ───────────────────────────────────────────────── */
.pd { display: grid; gap: var(--sp-4); }
@media (min-width: 900px) {
  .pd { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
}

.pd__media {
  position: relative;
  background: var(--clr-white);
  border: 1px solid var(--clr-gray-200);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.pd__media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
@media (min-width: 900px) { .pd__media { position: sticky; top: calc(var(--nav-h) + 24px); } }

.pd__info { display: grid; gap: var(--sp-2); align-content: start; justify-items: start; }
.pd__info h1 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
.pd__info > p { font-size: 1.02rem; line-height: 1.7; }

.pd__facts {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: var(--sp-1);
}
.pd__fact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--clr-white);
  border: 1px solid var(--clr-gray-200);
  border-radius: var(--r-md);
  font-size: 0.9rem;
}
.pd__fact svg { width: 17px; height: 17px; color: var(--clr-primary); flex: none; }
.pd__fact strong { margin-left: auto; color: var(--clr-dark); font-weight: 600; text-align: right; }

.pd__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--sp-2); }

/* Mobile: label & nilai spesifikasi ditumpuk supaya keduanya tidak sama-sama
   ter-wrap dan saling berdesakan; tombol dibuat selebar penuh agar seragam. */
@media (max-width: 560px) {
  .pd__fact {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 10px;
    align-items: start;
    padding: 12px 14px;
    font-size: 0.85rem;
  }
  .pd__fact svg { margin-top: 2px; }
  .pd__fact strong {
    grid-column: 2;
    margin-left: 0;
    text-align: left;
    font-size: 0.92rem;
  }
  .pd__actions { gap: 10px; }
  .pd__actions .btn { width: 100%; justify-content: center; }
}

/* ── Tabs ────────────────────────────────────────────────────────── */
.tabs { margin-top: clamp(48px, 6vw, 80px); }

.tabs__nav {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--clr-white);
  border: 1px solid var(--clr-gray-200);
  border-radius: var(--r-pill);
  margin-bottom: var(--sp-4);
  overflow-x: auto;
  scrollbar-width: none;
  width: fit-content;
  max-width: 100%;
}
.tabs__nav::-webkit-scrollbar { display: none; }

.tabs__btn {
  padding: 11px 22px;
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--clr-gray-600);
  white-space: nowrap;
  transition: var(--t-fast);
}
.tabs__btn:hover { background: var(--clr-gray-100); color: var(--clr-dark); }
.tabs__btn.is-active { background: var(--clr-dark); color: #fff; font-weight: 600; }

.tabs__panel { display: none; }
.tabs__panel.is-active { display: block; animation: tab-in 0.35s var(--ease); }

@keyframes tab-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.panel-card {
  background: var(--clr-white);
  border: 1px solid var(--clr-gray-200);
  border-radius: var(--r-lg);
  padding: clamp(24px, 3.5vw, 40px);
}

/* Konten kaya dari admin */
.rich { color: var(--clr-gray-700); font-size: 0.975rem; line-height: 1.8; max-width: 78ch; }
.rich > * + * { margin-top: 1em; }
.rich h2, .rich h3, .rich h4 { margin-top: 1.6em; }
.rich strong { color: var(--clr-dark); font-weight: 600; }
.rich a { color: var(--clr-primary); text-decoration: underline; text-underline-offset: 3px; }
.rich ul, .rich ol { padding-left: 0; display: grid; gap: 12px; counter-reset: step; }
.rich ul li { position: relative; padding-left: 30px; }
.rich ul li::before {
  content: '';
  position: absolute;
  left: 8px; top: 0.72em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--clr-primary);
}
.rich ol li { position: relative; padding-left: 46px; counter-increment: step; min-height: 32px; }
.rich ol li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--clr-primary-light);
  color: var(--clr-primary);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Tabel data teknis */
.spec-table { font-size: 0.925rem; }
.spec-table tr { border-bottom: 1px solid var(--clr-gray-200); }
.spec-table tr:last-child { border-bottom: 0; }
.spec-table th, .spec-table td { padding: 15px 4px; text-align: left; vertical-align: top; }
.spec-table th { color: var(--clr-gray-600); font-weight: 500; width: 45%; }
.spec-table td { color: var(--clr-dark); font-weight: 600; }
@media (max-width: 560px) {
  .spec-table th, .spec-table td { display: block; width: 100%; padding-block: 4px; }
  .spec-table th { padding-top: 14px; font-size: 0.82rem; }
  .spec-table td { padding-bottom: 14px; }
}

/* Grid dokumentasi 480×360 (4:3) */
.docs-grid {
  display: grid;
  gap: var(--sp-2);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.doc-item {
  position: relative;
  display: block;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--clr-gray-100);
  border: 1px solid var(--clr-gray-200);
}
.doc-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.5s var(--ease); }
.doc-item:hover img { transform: scale(1.05); }
.doc-item__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(17, 17, 17, 0.25);
}
.doc-item__play span {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--clr-primary);
  color: #fff;
}
.doc-item__play svg { width: 18px; height: 18px; margin-left: 2px; }
.doc-item__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 14px 12px;
  background: linear-gradient(to top, rgba(17,17,17,.8), transparent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: var(--sp-3);
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: var(--t);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__inner { width: min(980px, 100%); }
.lightbox__inner img { width: 100%; border-radius: var(--r-lg); }
.lightbox__inner iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--r-lg); }
.lightbox__close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transition: var(--t-fast);
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.26); }
.lightbox__close svg { width: 20px; height: 20px; }
