:root {
  --pink: #7a4a32;
  --pink-2: #c4a07a;
  --pink-deep: #4a2c1f;
  --peach: #c9a88a;
  --bg: #efe4d6;
  --bg-2: #f7efe6;
  --card: #fbf6f0;
  --ink: #3b2418;
  --muted: #8d6f5b;
  --line: #e6d4c4;
  --ok: #5c7a4a;
  --warn: #b06a2b;
  --danger: #9b3b2e;
  --cream: #f3e6d6;
  --gold: #d4b896;
  --shadow: 0 10px 24px rgba(74, 44, 31, 0.10);
  --font: "Nunito", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #f7efe6 0%, var(--bg) 40%, #e8d5c2 100%);
  min-height: 100vh;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }

.wrap {
  width: min(430px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 12px 14px 40px;
}

.shop-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.brand-mark, .avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #c4a07a, #7a4a32 55%, #5c3317);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
  overflow: hidden;
}
.brand-mark img, .avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { position: relative; }
.avatar.lg.has-photo .est,
.avatar-wrap:has(.has-photo) .est { text-shadow: 0 1px 4px rgba(0,0,0,.55); }
.brand-text { min-width: 0; }
.brand-title {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.brand-title em {
  font-style: normal;
  background: linear-gradient(90deg, #c4a07a, #7a4a32);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.handle-row {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dot-check {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6b8f5c;
  color: #fff;
  font-size: 8px;
  display: grid;
  place-items: center;
}
.header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.lang-switch {
  display: flex;
  background: var(--card);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 11px;
  padding: 7px 8px;
  cursor: pointer;
}
.lang-switch button.active {
  background: var(--pink);
  color: #fff;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--pink);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 15px;
}
.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, #5c3317, #8b5e3c);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px 8px 10px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.cart-count {
  background: var(--gold);
  color: #4a2c1f;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
}

.profile {
  text-align: center;
  padding: 10px 6px 4px;
}
.avatar-wrap { position: relative; width: 92px; margin: 0 auto 8px; }
.avatar.lg {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  font-size: 34px;
  box-shadow: 0 8px 20px rgba(92, 51, 23, 0.22);
}
.est {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.08em;
}
.est[hidden] { display: none !important; }
.verified {
  position: absolute;
  right: 2px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6b8f5c;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  border: 3px solid #f7efe6;
}
.profile h1 {
  margin: 8px 0 2px;
  font-size: 22px;
  letter-spacing: 0.04em;
}
.profile .handle { color: var(--pink); font-weight: 800; font-size: 13px; }
.profile .bio { color: var(--muted); font-size: 13px; margin: 8px 12px 12px; }

.socials { display: flex; justify-content: center; gap: 10px; margin: 8px 0 14px; }
.socials[hidden], .socials a[hidden] { display: none !important; }
.socials a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-items: center;
  color: var(--pink);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 8px 0 14px;
}
.view-tabs.four { grid-template-columns: 1fr 1fr 1fr 1fr; }
.view-tab {
  border: 0;
  background: var(--card);
  color: var(--pink);
  border-radius: 16px;
  padding: 12px 8px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.view-tab.active {
  background: linear-gradient(90deg, #5c3317, #8b5e3c);
  color: #fff;
}

.search {
  width: 100%;
  border: 0;
  background: var(--card);
  border-radius: 18px;
  padding: 13px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  outline: none;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 0;
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.chip.active {
  background: linear-gradient(90deg, #5c3317, #8b5e3c);
  color: #fff;
}
.chip b { margin-left: 4px; }

.promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(90deg, #5c3317, #8b5e3c 55%, #c4a07a);
  color: #fff;
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.promo small {
  display: inline-block;
  background: var(--gold);
  color: #4a2c1f;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  margin-bottom: 6px;
}
.promo h2 { margin: 0 0 4px; font-size: 18px; }
.promo p { margin: 0; font-size: 12px; opacity: 0.92; }
.promo-cta {
  background: var(--card);
  color: var(--pink-deep);
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 2px 10px;
  font-weight: 800;
}
.section-label span { color: var(--muted); font-size: 12px; font-weight: 700; }
.view-toggle { display: flex; gap: 6px; }
.view-toggle button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  background: var(--card);
  color: var(--pink);
  cursor: pointer;
  font-weight: 800;
}
.view-toggle button.active { background: var(--pink); color: #fff; }

.product-list { display: grid; gap: 10px; }
.product-list.grid-mode {
  grid-template-columns: 1fr 1fr;
}
.p-card {
  background: var(--card);
  border-radius: 22px;
  padding: 10px;
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 10px;
  align-items: center;
  box-shadow: var(--shadow);
}
.grid-mode .p-card {
  grid-template-columns: 1fr;
  align-items: stretch;
}
.thumb {
  width: 78px;
  height: 78px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: #ead9c8;
}
.grid-mode .thumb { width: 100%; height: 110px; }
.thumb img, .thumb .slider, .thumb .thumb-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-fallback {
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--pink);
}
.p-info { min-width: 0; }
.p-cat {
  color: var(--pink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.p-type { color: var(--muted); font-size: 11px; font-weight: 700; }
.p-name {
  margin: 2px 0 2px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}
.p-price { font-weight: 800; }
.p-price .was {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 12px;
  margin-left: 4px;
  font-weight: 700;
}
.p-actions { display: flex; flex-direction: column; gap: 8px; align-items: end; }
.grid-mode .p-actions { flex-direction: row; justify-content: end; }
.btn-info {
  border: 1.5px solid #d7c0a8;
  background: var(--card);
  color: var(--pink);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  cursor: pointer;
}
.btn-bag {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}
.btn-bag:disabled { opacity: 0.4; cursor: default; }

.empty {
  background: var(--card);
  border-radius: 22px;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}
.empty h3 { margin: 0 0 6px; color: var(--ink); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(59, 36, 24, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
  padding: 12px;
}
.overlay.open { display: flex; }
.modal, .drawer {
  width: min(430px, 100%);
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: var(--card);
  border-radius: 24px;
}
.modal-media {
  aspect-ratio: 16 / 10;
  background: #ead9c8;
  position: relative;
  overflow: hidden;
}
.modal-body { padding: 16px; }
.modal-headline { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.modal-name, .kicker { color: var(--pink); font-weight: 800; font-size: 12px; text-transform: uppercase; }
.desc p { white-space: pre-wrap; color: var(--muted); margin: 0 0 10px; }
.desc-head { margin: 14px 0 4px; font-size: 16px; font-weight: 800; color: var(--ink); }
.features { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.features li { background: var(--cream); border-radius: 12px; padding: 8px 10px; }
.row-btns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-primary { background: linear-gradient(90deg, #5c3317, #8b5e3c); color: #fbf6f0; }
.btn-ghost { background: var(--cream); color: var(--pink-deep); }
.btn-danger { background: #f3e0d8; color: var(--danger); }
.btn-ok { background: #e7efe0; color: var(--ok); }
.btn-warn { background: #f4e6d4; color: var(--warn); }
.btn-small { padding: 7px 10px; font-size: 13px; }
.hidden { display: none !important; }

.slider { position: absolute; inset: 0; }
.slider > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.slider > img.is-active { opacity: 1; }
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  color: var(--ink);
  z-index: 2;
  cursor: pointer;
}
.slider-btn.prev { left: 6px; }
.slider-btn.next { right: 6px; }
.slider-dots {
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 5px;
  z-index: 2;
}
.dot {
  width: 7px; height: 7px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,0.55); padding: 0; cursor: pointer;
}
.dot.is-active { width: 16px; border-radius: 99px; background: #fff; }
.badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--pink);
  color: #fff;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  z-index: 3;
}
.badge.habis { background: #6b7280; }
.badge.baru { background: #16a34a; }

.links-list, .help-box { display: grid; gap: 8px; }
.link-card, .help-box {
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  font-weight: 800;
}
.help-box { font-weight: 500; }
.help-box h4 { margin: 0 0 6px; }

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.qty {
  display: flex;
  gap: 6px;
  align-items: center;
}
.qty button {
  width: 26px; height: 26px; border: 0; border-radius: 8px;
  background: var(--cream); color: var(--pink); font-weight: 800; cursor: pointer;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 800; }
.field input, .field textarea, .field select {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
}
.field textarea { min-height: 90px; resize: vertical; }
.field textarea.tall { min-height: 160px; }
.field small { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.admin-shell { width: min(720px, calc(100% - 20px)); margin: 16px auto 40px; }
.login-box, .panel {
  background: var(--card);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.login-box { width: min(400px, 100%); margin: 10vh auto; }
.dash-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 18px;
}
@media (min-width: 700px) {
  .stats { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.stat-card b { display: block; font-size: 22px; margin-top: 6px; }
.stat-card.pending b { color: var(--warn); }
.order-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.order-table th { text-align: left; color: var(--pink); padding: 8px 4px; }
.order-table td { padding: 10px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.status-ok { color: var(--ok); font-weight: 800; }
.status-wait { color: var(--warn); font-weight: 800; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 800;
}
.tab.active { background: var(--pink); color: #fff; border-color: var(--pink); }
.admin-list { display: grid; gap: 8px; }
.admin-item, .image-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
}
.admin-item img, .admin-thumb, .image-row img {
  width: 72px; height: 56px; object-fit: cover; border-radius: 12px; background: #ead9c8;
}
.admin-thumb { display: grid; place-items: center; font-weight: 800; color: var(--pink); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: end; }
.image-list { display: grid; gap: 8px; }
.add-url-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.add-url-row input { flex: 1 1 180px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.notice {
  background: #f4e6d4;
  color: #6b4a2e;
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
  margin-bottom: 10px;
}
.meta { color: var(--muted); font-size: 12px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  z-index: 50;
}

.bars { display: grid; gap: 8px; margin-bottom: 16px; }
.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}
.bar-track {
  height: 10px;
  background: var(--cream);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #5c3317, #c4a07a);
  border-radius: 99px;
}
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.soft-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}
.order-card { margin-bottom: 8px; }
.pay-box {
  background: var(--cream);
  border-radius: 16px;
  padding: 12px;
  margin: 12px 0;
}
.pay-qr {
  width: min(220px, 100%);
  border-radius: 12px;
  margin: 8px auto;
  display: block;
  background: #fff;
}
.profile-preview { margin: 8px 0; }
.profile-preview .avatar.lg { margin: 0; }
.copy-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.copy-row strong { word-break: break-all; }
.receipt-preview, .receipt-view {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 12px;
  margin-top: 8px;
  background: #fff;
}
#periodSelect {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
}

@media (max-width: 800px) {
  .form-grid, .admin-item, .image-row, .split-grid { grid-template-columns: 1fr; }
}
