/* Shop — grid rapat tanpa tepi (2 kolom di mobile), tile abu muda, caption di bawah.
   Filter = dropdown Category + Sort di toolbar. */

.page-shop{
  --shop-tile:#f7f7f7;
  --shop-gap:4px;
  --shop-pad:16px;
  --shop-spring:cubic-bezier(.2,.9,.25,1.05);
  --shop-ease:cubic-bezier(.22,1,.36,1);
}

.shop{padding:0 0 clamp(56px,8vw,96px)}

/* ── toolbar ──────────────────────────────────────────── */
.shop-bar{
  display:flex;align-items:center;gap:8px;
  padding:14px var(--shop-pad);
  font-size:12px;font-weight:500;
  text-transform:uppercase;letter-spacing:.06em;
  background:#fff;
}
.shop-count{margin-right:auto;color:var(--mute);font-variant-numeric:tabular-nums}

/* ── dropdown (Category, Sort): teks polos, tanpa garis bulat ─────────── */
.shop-menu{position:relative}
.shop-menu summary{
  list-style:none;display:flex;align-items:center;gap:6px;
  height:36px;padding:0 4px;margin:0 2px;cursor:pointer;user-select:none;
  border:0;background:none;color:var(--ink);
  transition:opacity .2s ease,transform .12s ease-out;
  -webkit-tap-highlight-color:transparent;
}
.shop-menu summary::-webkit-details-marker{display:none}
.shop-menu summary:hover{opacity:.6}
.shop-menu summary:active{transform:scale(.96)}
.shop-menu summary:focus-visible{outline:2px solid var(--ink);outline-offset:2px;border-radius:4px}

.shop-menu__value{max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--mute)}
.shop-menu__value::before{content:'/';margin-right:6px;color:var(--mute)}
.shop-menu__chev,.shop-menu__plus{
  width:9px;height:9px;fill:none;stroke:currentColor;stroke-width:1.6;
  stroke-linecap:round;stroke-linejoin:round;
  transition:transform .35s var(--shop-spring);
}
.shop-menu[open] .shop-menu__chev{transform:rotate(180deg)}
.shop-menu[open] .shop-menu__plus{transform:rotate(45deg)}

/* panel: putih bersih, garis rambut, satu bayangan lembut */
.shop-menu__panel{
  position:absolute;right:0;top:calc(100% + 6px);z-index:30;
  min-width:200px;max-height:min(70vh,440px);overflow:auto;overscroll-behavior:contain;
  padding:4px;border-radius:12px;
  background:rgba(255,255,255,.94);
  -webkit-backdrop-filter:blur(20px) saturate(160%);backdrop-filter:blur(20px) saturate(160%);
  border:1px solid rgba(0,0,0,.08);
  box-shadow:0 12px 32px rgba(0,0,0,.10);
  transform-origin:top right;
  animation:shop-pop .22s var(--shop-spring) both;
}
.shop-menu__panel a{
  display:flex;align-items:center;gap:12px;
  padding:7px 10px;border-radius:8px;
  font-size:13px;font-weight:400;letter-spacing:.005em;text-transform:none;color:var(--ink);
  transition:background-color .15s ease;
}
.shop-menu__panel a:hover,.shop-menu__panel a:focus-visible{background:rgba(0,0,0,.05);outline:0}
.shop-menu__panel a:active{background:rgba(0,0,0,.08)}
.shop-menu__panel a.is-active{font-weight:600}
.shop-menu__panel a.is-active::after{content:"";margin-left:auto;width:5px;height:5px;border-radius:50%;background:var(--ink)}

/* item kategori: thumbnail kecil + nama + jumlah */
.shop-menu--category .shop-menu__panel{min-width:248px}
.shop-menu__thumb{
  flex:none;width:28px;height:35px;border-radius:3px;overflow:hidden;background:var(--shop-tile);
}
.shop-menu__thumb img{width:100%;height:100%;object-fit:cover;mix-blend-mode:multiply;display:block}
.shop-menu__text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shop-menu__n{
  flex:none;min-width:20px;text-align:right;
  font-size:11px;font-weight:400;color:var(--mute);font-variant-numeric:tabular-nums;letter-spacing:0;
}
.shop-menu__panel a.shop-menu__cat.is-active::after{content:none}
.shop-menu__panel a.shop-menu__cat.is-active .shop-menu__n{color:var(--ink)}

@keyframes shop-pop{
  from{opacity:0;transform:scale(.96) translateY(-4px)}
  to{opacity:1;transform:none}
}

.shop-filter{margin:0;padding:0 var(--shop-pad) 12px;color:var(--mute)}
.shop-filter strong{color:var(--ink);font-weight:500}
.shop-filter a{margin-left:10px;color:var(--ink)}
.page-shop .empty-text{padding:40px var(--shop-pad)}

/* ── grid: rapat, tanpa tepi ──────────────────────────── */
.shop-grid{
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:var(--shop-gap);
}
@media (max-width:1100px){.shop-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:700px){.shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}   /* mobile: 2 per baris */

/* kartu: tile abu 3:4, caption di bawah dengan padding sejajar toolbar */
.page-shop .product-card{display:block;background:#fff}
.page-shop .product-tile{aspect-ratio:3/4;background:var(--shop-tile);border-radius:0}
.page-shop .product-tile img{object-fit:cover;mix-blend-mode:multiply}
.page-shop .product-info{padding:14px var(--shop-pad) 26px;gap:2px}
.page-shop .product-name{font-size:13px;font-weight:400;letter-spacing:.02em;line-height:1.35;-webkit-line-clamp:2}
.page-shop .product-price{font-size:13px;letter-spacing:.02em}
.page-shop .product-badges{top:10px;left:10px}
.page-shop .product-badge{font-size:9.5px;padding:3px 7px}

@media (max-width:700px){
  .shop-bar{padding-top:12px;padding-bottom:12px}
  .shop-menu__value{max-width:72px}
  .page-shop .product-info{padding:12px 12px 22px}
  .page-shop .product-name,.page-shop .product-price{font-size:12px}

  /* panel kategori selebar toolbar, tidak melewati tepi layar */
  .shop-bar{position:relative}
  .shop-menu--category{position:static}
  .shop-menu--category .shop-menu__panel{left:8px;right:8px;width:auto;min-width:0;top:calc(100% - 2px);transform-origin:top center}
}

@media (prefers-reduced-motion:reduce){
  .shop-menu__panel{animation:none}
  .shop-menu__chev,.shop-menu__plus,.shop-menu summary,.shop-menu__panel a{transition:none}
}
@media (prefers-reduced-transparency:reduce){
  .shop-menu__panel{background:#fff;-webkit-backdrop-filter:none;backdrop-filter:none}
}

html[data-theme="dark"] .shop-bar,html[data-theme="dark"] .page-shop .product-card{background:var(--bg)}
html[data-theme="dark"] .shop-menu__panel{background:rgba(28,28,28,.94);border-color:rgba(255,255,255,.1);box-shadow:0 12px 32px rgba(0,0,0,.5)}
html[data-theme="dark"] .shop-menu__panel a:hover,html[data-theme="dark"] .shop-menu__panel a:focus-visible{background:rgba(255,255,255,.08)}
html[data-theme="dark"] .shop-menu__panel a:active{background:rgba(255,255,255,.12)}
