/* store.css — Nawasena Official Store */

:root {
  --ns-gold: #d8b364;
  --ns-gold-dark: #b9954c;
  --ns-ink: #0b0b0d;
  --ns-panel: #141418;
  --ns-panel-2: #1c1c21;
  --ns-line: #2c2c33;
  --ns-text: #e8e6e1;
  --ns-muted: #9b978e;
  --ns-white: #ffffff;
}

* { box-sizing: border-box; }

body.store-body {
  margin: 0;
  background: var(--ns-ink);
  color: var(--ns-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}

.store-wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- bar toko ---------- */

.store-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 11, 13, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ns-line);
}

.store-bar__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.store-bar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ns-white);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.store-bar__brand img { height: 34px; width: auto; display: block; }

.store-search {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ns-panel);
  border: 1px solid var(--ns-line);
  border-radius: 10px;
  padding: 0 12px;
}
.store-search input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: 0;
  color: var(--ns-text);
  font: inherit;
  font-size: 14px;
  padding: 10px 0;
}
.store-search input:focus { outline: none; }
.store-search input::placeholder { color: var(--ns-muted); }

.store-bar__actions { display: flex; align-items: center; gap: 10px; }

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--ns-line);
  background: var(--ns-panel);
  color: var(--ns-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.store-btn:hover { border-color: var(--ns-gold); }

.store-btn--gold {
  background: var(--ns-gold);
  border-color: var(--ns-gold);
  color: #1a1405;
}
.store-btn--gold:hover { background: var(--ns-gold-dark); border-color: var(--ns-gold-dark); }

.store-btn--ghost { background: none; }

.store-btn--block { width: 100%; justify-content: center; padding: 13px 16px; }

.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ns-gold);
  color: #1a1405;
  font-size: 12px;
  font-weight: 700;
}
.store-btn--gold .cart-count { background: #1a1405; color: var(--ns-gold); }

/* ---------- kepala halaman ---------- */

.store-head { padding: 34px 0 20px; }
.store-head__label {
  color: var(--ns-gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.store-head h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.2; color: var(--ns-white); }
.store-head p { margin: 0; color: var(--ns-muted); font-size: 15px; }

.store-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--ns-line);
  margin-bottom: 24px;
}
.store-count { color: var(--ns-muted); font-size: 14px; margin: 0; }
.store-sort {
  background: var(--ns-panel);
  border: 1px solid var(--ns-line);
  border-radius: 10px;
  color: var(--ns-text);
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
}

/* ---------- grid katalog ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 18px;
  padding-bottom: 56px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--ns-panel);
  border: 1px solid var(--ns-line);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.product-card:hover { border-color: var(--ns-gold); transform: translateY(-2px); }

.product-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.product-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card__media .no-photo { color: #9a9a9a; font-size: 13px; }

.product-card__body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; }
.product-card__name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ns-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card__price { margin: 0; font-size: 17px; font-weight: 700; color: var(--ns-gold); }
.product-card__meta { margin: 2px 0 0; font-size: 12px; color: var(--ns-muted); }

.product-card__foot { padding: 0 14px 14px; }

.store-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ns-muted);
}

/* ---------- halaman detail ---------- */

.crumb { padding: 22px 0 18px; font-size: 13px; color: var(--ns-muted); }
.crumb a { color: var(--ns-muted); text-decoration: none; }
.crumb a:hover { color: var(--ns-gold); }
.crumb span { margin: 0 8px; }

.detail {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr) minmax(0, 300px);
  gap: 32px;
  align-items: start;
  padding-bottom: 60px;
}

.gallery__main {
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gallery__thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery__thumb {
  width: 64px;
  height: 64px;
  border-radius: 9px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #fff;
  padding: 0;
  cursor: pointer;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__thumb.is-active { border-color: var(--ns-gold); }

.detail__info h1 { margin: 0 0 10px; font-size: 24px; line-height: 1.3; color: var(--ns-white); }
.detail__price { font-size: 30px; font-weight: 800; color: var(--ns-gold); margin: 0 0 18px; }

.detail__tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--ns-line); margin: 22px 0 16px; }
.detail__tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 0;
  color: var(--ns-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.detail__tab.is-active { color: var(--ns-gold); border-bottom-color: var(--ns-gold); }

.detail__panel { font-size: 14px; line-height: 1.8; color: var(--ns-text); }
.detail__panel p { margin: 0 0 1em; }
.detail__panel ul { margin: 0 0 1em; padding-left: 1.3em; }
.detail__panel li { margin: .35em 0; }
.detail__panel li::marker { color: var(--ns-gold); }
.detail__panel[hidden] { display: none; }

.spec { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec th, .spec td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--ns-line); vertical-align: top; }
.spec th { color: var(--ns-muted); font-weight: 500; width: 140px; }

.buybox {
  position: sticky;
  top: 90px;
  background: var(--ns-panel);
  border: 1px solid var(--ns-line);
  border-radius: 14px;
  padding: 20px;
}
.buybox h2 { margin: 0 0 16px; font-size: 15px; color: var(--ns-white); }

.buybox__item { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.buybox__item img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: #fff; }
.buybox__item span { font-size: 13px; color: var(--ns-muted); line-height: 1.4; }

.qty { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.qty button {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--ns-line);
  background: var(--ns-panel-2);
  color: var(--ns-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.qty button:hover:not(:disabled) { border-color: var(--ns-gold); }
.qty button:disabled { opacity: .4; cursor: default; }
.qty output { min-width: 32px; text-align: center; font-weight: 600; font-size: 15px; }

.buybox__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid var(--ns-line);
  margin-bottom: 16px;
}
.buybox__total span { color: var(--ns-muted); font-size: 13px; }
.buybox__total strong { font-size: 20px; color: var(--ns-gold); }

.buybox__actions { display: grid; gap: 10px; }

.buybox__note { margin: 14px 0 0; font-size: 12px; color: var(--ns-muted); line-height: 1.6; }

/* ---------- keranjang ---------- */

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 28px;
  align-items: start;
  padding-bottom: 60px;
}

.cart-list { display: grid; gap: 14px; }

.cart-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: var(--ns-panel);
  border: 1px solid var(--ns-line);
  border-radius: 14px;
  padding: 14px;
}
.cart-row__media { width: 82px; height: 82px; border-radius: 10px; overflow: hidden; background: #fff; }
.cart-row__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-row__name { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--ns-text); }
.cart-row__price { margin: 0; font-size: 14px; color: var(--ns-gold); font-weight: 600; }
.cart-row__side { display: grid; gap: 10px; justify-items: end; }

.link-danger {
  background: none;
  border: 0;
  padding: 0;
  color: #d98b8b;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.summary {
  position: sticky;
  top: 90px;
  background: var(--ns-panel);
  border: 1px solid var(--ns-line);
  border-radius: 14px;
  padding: 20px;
}
.summary h2 { margin: 0 0 16px; font-size: 15px; color: var(--ns-white); }
.summary__row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; color: var(--ns-muted); }
.summary__row strong { color: var(--ns-text); }
.summary__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 14px;
  border-top: 1px solid var(--ns-line);
  margin: 14px 0 18px;
}
.summary__total span { font-size: 14px; color: var(--ns-muted); }
.summary__total strong { font-size: 22px; color: var(--ns-gold); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--ns-gold);
  color: #1a1405;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 60;
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }

/* ---------- skeleton ---------- */

.skeleton {
  background: linear-gradient(90deg, var(--ns-panel) 25%, var(--ns-panel-2) 50%, var(--ns-panel) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 14px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- responsif ---------- */

@media (max-width: 1040px) {
  .detail { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
  .buybox { grid-column: 1 / -1; position: static; }
}

@media (max-width: 760px) {
  .store-bar__inner { flex-wrap: wrap; gap: 12px; }
  .store-search { order: 3; flex-basis: 100%; }
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 64px minmax(0, 1fr); }
  .cart-row__media { width: 64px; height: 64px; }
  .cart-row__side { grid-column: 1 / -1; justify-items: stretch; }
  .store-head h1 { font-size: 24px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

/* ---------- varian produk ---------- */
.varian-grup { margin: 18px 0; }
.varian-label { margin: 0 0 8px; font-size: 14px; color: var(--ns-muted); }
.varian-label b { color: var(--ns-text); font-weight: 600; }
.varian-pilihan { display: flex; flex-wrap: wrap; gap: 8px; }
.varian-btn {
  padding: 9px 14px; border-radius: 9px;
  border: 1px solid var(--ns-line); background: var(--ns-panel);
  color: var(--ns-text); font: inherit; font-size: 14px; cursor: pointer;
}
.varian-btn:hover { border-color: var(--ns-gold); }
.varian-btn.is-active { border-color: var(--ns-gold); background: rgba(216,179,100,.14); color: var(--ns-gold); font-weight: 600; }
.buybox__stok { margin: 0 0 12px; font-size: 13px; color: var(--ns-muted); }
.buybox__stok.is-habis { color: #d98b8b; font-weight: 600; }
.buybox__item span b { color: var(--ns-text); }
.cart-row__varian { margin: 2px 0 4px; font-size: 13px; color: var(--ns-muted); }
.store-btn:disabled { opacity: .5; cursor: default; }
.buybox__catatan{margin:0 0 12px;font-size:13px;color:var(--ns-muted);font-style:italic}
.varian-btn.is-habis{opacity:.45;text-decoration:line-through;cursor:not-allowed}
.buybox__catatan{margin:0 0 12px;font-size:13px;color:var(--ns-muted);font-style:italic}
