/* shop.css — komponen bersama TAPAK & WASTRA NUSA.
   Token warna/font didefinisikan di assets/theme.css tiap toko. */
/* ============================================================
   TAPAK — layer fungsional di atas desain Stitch
   Berisi: token, komponen belanja (chip, kartu, PDP, keranjang),
   dan penyesuaian kecil supaya halaman jalan tanpa CDN.
   Semua warna/font mengikuti design system Stitch: #FBF9F6 / #151616
   / #75593B / #5C6350, Fraunces + Plus Jakarta Sans.
   ============================================================ */


html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- angka & harga ---------- */
.angka { font-variant-numeric: tabular-nums; }

/* ---------- chip kategori ---------- */
.chips-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.chips-row::-webkit-scrollbar { display: none; }
.chip-btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chip-btn .n { font-size: 12px; opacity: 0.65; }

/* ---------- grid produk ---------- */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 24px;
}
.pcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.pcard:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.pcard-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  overflow: hidden;
}
.pcard-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.pcard:hover .pcard-media img { transform: scale(1.04); }
.pcard-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.pcard-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pcard-name {
  font-family: var(--head);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0;
}
.pcard-name a:hover { color: var(--accent); }
.pcard-fabric { font-size: 13px; color: var(--ink-3); }
.pcard-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.price { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.price small { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-right: 2px; }
.sizes-left { font-size: 12px; color: var(--ink-3); }
.sizes-left.low { color: var(--warn); }
.sizes-left.out { color: var(--danger); }

/* ---------- PDP ---------- */
.pdp-media { position: sticky; top: 96px; }
.pdp-main {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
}
.pdp-main img { width: 100%; height: 100%; object-fit: cover; }
.pdp-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.pdp-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  padding: 0;
}
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp-thumb[aria-pressed="true"] { border-color: var(--accent); }

.opt-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.opt-label h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0;
}
.opt-label a { font-size: 13px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.size-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.size-btn {
  min-width: 54px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-size: 14.5px;
  font-weight: 600;
}
.size-btn:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.size-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.size-btn[disabled] {
  color: var(--ink-3);
  border-style: dashed;
  text-decoration: line-through;
  cursor: not-allowed;
  background: var(--surface-2);
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}
.qty button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 18px; line-height: 1; }
.qty button:hover { background: var(--surface-2); }
.qty span { min-width: 38px; text-align: center; font-weight: 600; font-size: 15px; }

.buy-row { display: grid; gap: 10px; margin-bottom: 14px; }
.stock-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ok);
  margin: 0 0 24px;
}
.stock-line::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stock-line.low { color: var(--warn); }
.stock-line.out { color: var(--danger); }

/* ---------- accordion ---------- */
.acc { border-top: 1px solid var(--line); margin-top: 8px; }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 20px; font-weight: 400; color: var(--ink-3); }
.acc details[open] summary::after { content: "\2212"; }
.acc .acc-body { padding: 0 0 18px; font-size: 14.5px; color: var(--ink-2); line-height: 1.7; max-width: 56ch; }

/* ---------- keranjang ---------- */
.line-item {
  display: grid;
  grid-template-columns: 104px 1fr auto;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.line-item:first-child { padding-top: 0; }
.line-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.line-thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-name { font-family: var(--head); font-weight: 600; font-size: 18px; margin: 0 0 4px; }
.line-meta { font-size: 13px; color: var(--ink-3); margin: 0 0 12px; }
.line-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.line-actions .qty button { width: 38px; height: 38px; font-size: 16px; }
.line-actions .qty span { min-width: 32px; font-size: 14px; }
.remove-btn {
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 0;
}
.remove-btn:hover { color: var(--danger); }
.line-total { font-weight: 700; font-size: 16px; white-space: nowrap; }

.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  position: sticky;
  top: 96px;
}
.summary-card h2 { font-family: var(--head); font-size: 22px; font-weight: 600; margin: 0 0 18px; }
.sum-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14.5px;
  padding: 8px 0;
  color: var(--ink-2);
}
.sum-row.total {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 16px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.sum-note {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 14px 0 20px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: 8px;
}

/* ---------- form ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--accent); outline: none; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 5px; display: none; }
.field.invalid input,
.field.invalid textarea { border-color: var(--danger); }
.field.invalid .err { display: block; }

/* ---------- state kosong ---------- */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-3);
}
.empty-state h3 { font-family: var(--head); color: var(--ink); margin: 0 0 8px; font-size: 22px; }

/* ---------- tombol tambahan ---------- */
.btn-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-solid:hover { background: var(--accent-dark); }
.btn-solid:active { transform: translateY(1px); }
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-solid.w-full, .btn-outline.w-full { width: 100%; }
.btn-solid[disabled], .btn-outline[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 24px);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 90;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- breadcrumb ---------- */
.crumb-row { display: flex; gap: 8px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.crumb-row a:hover { color: var(--accent); }
.crumb-row span { display: inline-flex; gap: 8px; }
.crumb-row span::before { content: "/"; color: var(--line-strong); }

/* ---------- nav mobile (hanya < 900px) ---------- */
.mobile-nav { display: none; }

/* ---------- select urutkan ---------- */
.sort-select {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
}


/* ---------- kelas bantu tema (dipakai halaman yang dibangun skrip) ---------- */
.font-head { font-family: var(--head); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.text-muted { color: var(--ink-2); }
.text-faint { color: var(--ink-3); }

/* ---------- daftar spesifikasi ---------- */
.def-list {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}
.def-list > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.def-list > div:nth-child(odd) { padding-right: 18px; }
.def-list > div:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line); }
.def-list dt {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.def-list dd { margin: 0; font-size: 14.5px; font-weight: 500; }

@media (max-width: 720px) {
  .def-list { grid-template-columns: 1fr; }
  .def-list > div:nth-child(odd) { padding-right: 0; }
  .def-list > div:nth-child(even) { padding-left: 0; border-left: 0; }
}


/* ---------- target sentuh: minimal 44px di layar sentuh ----------
   Diukur lewat getBoundingClientRect: tautan nav, nama produk, dan tautan
   topbar hanya 19-28px. Di HP itu terlalu kecil untuk jari. Padding vertikal
   dipasang pada elemen tautannya sendiri, bukan pada kontainer, supaya area
   klik ikut membesar (bukan cuma jaraknya). */
@media (hover: none) and (pointer: coarse) {
  .mobile-nav a { padding: 11px 0; font-size: 15px; }
  .pcard-name a { display: block; padding: 6px 0; }
  .pcard-kicker { padding-bottom: 2px; }
}
.mobile-nav a { padding: 12px 0; min-height: 44px; display: inline-flex; align-items: center; }
.pcard-name a { display: flex; align-items: center; padding: 8px 0; margin: -8px 0; min-height: 44px; }
.pcard-name { line-height: 1.3; }
.topbar a, aside a[href*="panduan"], header a[href*="panduan"] {
  padding: 10px 0;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
/* ikon bulat di header: 34px terlalu kecil untuk jari */
header a[aria-label], header button[aria-label] { min-width: 44px; min-height: 44px; }
footer a { display: inline-flex; align-items: center; padding: 6px 0; min-height: 44px; }
.brand-link, header a[href="index.html"]:first-of-type { min-height: 44px; display: inline-flex; align-items: center; }


/* breadcrumb & tautan kecil: area klik tetap 40px+ walau teksnya 13px */
.crumb-row a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 2px; }
.opt-label a { display: inline-flex; align-items: center; min-height: 40px; }


/* tautan "Cara Merawat Kulit" di hero: area klik 44px */
a.group[href*="perawatan"] { min-height: 44px; }

/* ---------- responsif ---------- */
@media (max-width: 1080px) {
  .prod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pdp-media, .summary-card { position: static; }
  /* nav horizontal Stitch disembunyikan di layar kecil; diganti baris tautan */
  header nav.hidden { display: none !important; }
  .mobile-nav {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 10px 20px 12px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    scrollbar-width: none;
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav a {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
  }
  .mobile-nav a:hover { color: var(--accent); }
}
@media (max-width: 720px) {
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .pcard-body { padding: 12px 13px 16px; }
  .pcard-name { font-size: 15.5px; }
  .line-item { grid-template-columns: 84px 1fr; }
  .line-total { grid-column: 2; }
  .btn-solid, .btn-outline { min-height: 46px; padding: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
