/* Shared structure. Each storefront carries its own type and colours. */
:root {
  color-scheme: light;
  --canvas: #f6f7f8;
  --paper: #ffffff;
  --ink: #16283b;
  --muted: #516375;
  --edge: #d4dde4;
  --soft: #edf3f8;
  --accent: #204caa;
  --accent-hover: #163c8d;
  --display: "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 12px;
}
body.snack {
  --canvas: #fff9ed;
  --paper: #fffdf6;
  --ink: #421e16;
  --muted: #735244;
  --edge: #e1cfb5;
  --soft: #f8eacb;
  --accent: #9d341f;
  --accent-hover: #792817;
  --display: Georgia, "Times New Roman", serif;
}
body.admin {
  --canvas: #f4f7f5;
  --ink: #18322c;
  --muted: #4e665d;
  --edge: #cddbd3;
  --soft: #e7f1eb;
  --accent: #155548;
  --accent-hover: #103e34;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1rem/1.55 var(--body);
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
:where(h1,h2,h3,p,figure,fieldset,ul,ol) { margin: 0; }
h1, h2, h3 {
  color: var(--ink);
  font-family: var(--display);
  line-height: 1.15;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 7vw, 3.7rem); letter-spacing: -.055em; font-weight: 740; }
h2 { font-size: clamp(1.5rem, 4vw, 2.05rem); letter-spacing: -.033em; }
h3 { font-size: 1.16rem; letter-spacing: -.022em; }
body.snack :where(h1,h2,h3) { font-weight: 700; }
body.admin h1 { font-size: clamp(1.95rem, 5vw, 2.8rem); }
body.unit {
  --canvas: #f2f5fa;
  --ink: #101e3a;
  --accent: #1d4caa;
  --accent-hover: #193985;
  --edge: #ced9e8;
  --soft: #e7eefb;
}
.unit .bar { border-top: 4px solid var(--accent); }
.unit .brand-logo { height: 3.5rem; }
.unit .unit-offer { border-color: #b9cbed; color: var(--accent-hover); }
.unit .catalog-back {
  gap: .7rem;
  color: var(--accent-hover);
  background: var(--soft);
  border-color: #afc3e4;
}
.catalog-back::before {
  content: "";
  width: .48rem;
  height: .48rem;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: rotate(45deg);
}
.unit main:has(.unit-catalog) { padding-top: .9rem; }
.unit-masthead {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.15rem, 3vw, 2.6rem);
  border-radius: 12px;
  background: linear-gradient(112deg, #152b70 12%, #1d4caa 65%, #1e70ba);
}
.unit-masthead::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 13rem;
  height: 13rem;
  top: -8rem;
  right: -5rem;
  transform: rotate(35deg);
  border: 1rem solid #ffffff14;
  box-shadow: 0 0 0 1.4rem #ffffff08, 0 0 0 1.5rem #ffffff25, 0 0 0 3rem #ffffff08;
}
.unit-masthead h1 {
  color: white;
  font-size: clamp(2.35rem, 8vw, 4.2rem);
  line-height: 1;
  letter-spacing: -.05em;
}
.unit-search { margin-top: 1.1rem; max-width: 34rem; color: #f1f5ff; font-size: .875rem; }
.unit-search input:focus-visible { outline-color: #a7dfff; }
.unit-catalog .unit-filters { gap: .35rem; }
.unit-filters button { border-radius: 2rem; }
.unit-catalog .unit-filters + .grid { margin-top: 0; }
.unit .device-card { padding: 0; gap: 0; }
.device-card > img.photo { border-radius: 11px 11px 0 0; }
.device-info, .device-buy { padding: .95rem 1rem; }
.device-code { font: 600 .78rem/1.35 ui-monospace, monospace; letter-spacing: .04em; color: var(--accent-hover); }
.device-info h2 { margin: .45rem 0 .28rem; line-height: 1.15; }
.device-note { color: var(--muted); line-height: 1.45; }
.device-buy { border-top: 1px solid var(--edge); }
.device-buy .price { display: block; color: var(--accent-hover); font-size: 1.4rem; line-height: 1.2; }
.device-buy .primary { min-width: 6.5rem; }
.device-title { border-left: 4px solid var(--accent); padding-left: .85rem; }
.device-title h1 { margin-top: .5rem; }
.unit .unit-prices { border-top: 4px solid var(--accent); }
.unit-prices .price { color: var(--accent-hover); }
a { color: var(--accent); text-underline-offset: .2em; }
img { display: block; max-width: 100%; }
p, .card, label, li, .notice, .error { overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; }
button, select, input[type="file"] { cursor: pointer; }
:where(a,button,input,textarea,select):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.shell, .wrap {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
}
.shell .wrap, .wrap .shell { width: 100%; }
main { padding-block: clamp(1.25rem, 4vw, 3rem) 4rem; }
main > * + * { margin-top: 1.35rem; }
.bar {
  border-bottom: 1px solid var(--edge);
  background: var(--paper);
  color: var(--ink);
}
.bar :is(.wrap,.shell), .bar.wrap, .bar.shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem 1rem;
  min-height: 4.25rem;
  padding-block: .55rem;
}
.brand {
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 810;
  letter-spacing: -.075em;
  line-height: 1.1;
  text-decoration: none;
}
.snack .brand { font-style: italic; }
.brand-logo { display:block; height:4rem; width:auto; object-fit:contain; }
.bar nav, .actions, .tabs, .tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
}
.bar nav a { font-size: .94rem; font-weight: 600; }
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: clamp(1.45rem, 5.5vw, 3.8rem) 0 clamp(1rem, 3.5vw, 2rem);
  border-bottom: 1px solid var(--edge);
}
.hero p { max-width: 57ch; color: var(--muted); margin-top: .6rem; }
.hero .actions, .hero .tabs { margin-top: 1rem; }
.snack .bar {
  background: #ffcd57;
  border-bottom: 3px solid var(--ink);
}
.hero.snack-menu { padding-block: .5rem 1rem; gap: .6rem; border-color: var(--ink); }
.snack-menu h1 { color: var(--accent-hover); font-size: clamp(1.9rem, 7.5vw, 3.6rem); }
.card.snack-product { padding: 0; gap: 0; background: #fffcf5; }
.snack-product > img.photo { border-radius: 11px 11px 0 0; }
.snack-product-heading { padding: 1rem 1rem .85rem; }
.snack-product-heading h2 { margin-bottom: .2rem; }
.snack-options { padding: 0 1rem .25rem; }
.snack-option {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .7rem 0;
  border-top: 1px dashed var(--edge);
}
.snack-option .meta { margin-inline-start: .25rem; }
.option-price { display: block; color: var(--accent-hover); font-weight: 650; }
.snack-option .choose-variant { min-width: 5rem; min-height: 46px; border-radius: 9px; }
.snack-option .choose-variant:active { background: var(--accent-hover); }
.option-sold { color: var(--muted); font-weight: 600; text-align: center; min-width: 5rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  align-items: start;
  gap: 1rem;
}
.grid > *, .row > *, .stock-row > *, .tools > *, .card, .field { min-width: 0; }
.card, .variant, fieldset {
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--paper);
  padding: clamp(1rem, 2.5vw, 1.4rem);
}
.card { display: grid; gap: .65rem; align-content: start; }
.card > img:only-of-type, .card .photo { width: 100%; }
.card :is(h2,h3) a { color: var(--ink); text-decoration: none; }
.card :is(h2,h3) a:hover { text-decoration: underline; }
.stack { display: grid; gap: 1rem; align-content: start; }
main.stack > * + * { margin-top: 0; }
main.stack > form.stack { width: min(100%, 46rem); }
.row, .stock-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .55rem 1rem; }
.stock-row { padding: 1rem 0; border-bottom: 1px solid var(--edge); }
.stock-row:last-child { border-bottom: 0; }
.stock-row.stack { display: grid; justify-content: stretch; gap: .55rem; }
.stock-row h2 { font-size: 1.24rem; }
.meta, small, .muted { color: var(--muted); font-size: .875rem; }
.price { font-size: 1.25rem; font-weight: 720; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.price small, .price .meta { display: block; font-weight: 500; letter-spacing: normal; }
.pill {
  display: inline-block;
  max-width: 100%;
  padding: .16rem .56rem;
  background: var(--soft);
  color: var(--ink);
  border-radius: 5px;
  font-weight: 650;
  font-size: .82rem;
}
.photo, img.photo, .gallery img, .photos img, img.cover {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  background: var(--soft);
  object-fit: contain;
  border-radius: calc(var(--radius) - 3px);
}
.gallery, .photos, [data-previews] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: .65rem;
}
.gallery:empty, .photos:empty { display: none; }
.gallery img:only-child { max-height: 27rem; }
.preview-image {
  display: inline-block;
  vertical-align: top;
  width: 5.25rem;
  height: 5.25rem;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--edge);
  margin: .45rem .45rem 0 0;
}
.field, label:has(input,select,textarea) { display: grid; gap: .35rem; }
label.variant:has(input[type="radio"]) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
  min-height: 48px;
  cursor: pointer;
}
label.variant:has(input:checked) { border-color: var(--accent); background: var(--soft); }
label.variant:has(input:disabled) { color: var(--muted); cursor: default; }
label:has(> input[type="checkbox"]) { display: flex; align-items: center; gap: .55rem; min-height: 44px; }
label, legend { font-weight: 620; }
fieldset { min-width: 0; }
legend { padding-inline: .3rem; }
input:not([type="hidden"],[type="checkbox"],[type="radio"]), textarea, select {
  width: 100%;
  min-height: 46px;
  padding: .62rem .8rem;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
textarea { min-height: 5.6rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .88; }
input[type="file"] { overflow: hidden; }
input[type="file"]::file-selector-button {
  background: var(--soft);
  color: var(--ink);
  border: 0;
  border-radius: 4px;
  padding: .35rem .7rem;
  margin-right: .65rem;
}
.tools > label:has(input), .tools > input[type="search"] { flex: 1 1 16rem; }
.actions form, .row > form, .tabs form { margin: 0; }
button, .primary, .secondary, .button, .tabs a, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 44px;
  padding: .58rem .94rem;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: .96rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
.primary, button.primary, .tabs [aria-pressed="true"], .tabs [aria-current="page"], .tabs .active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button:disabled, button[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.notice, .error, .empty {
  padding: .86rem 1rem;
  background: var(--soft);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  color: var(--ink);
}
.error { background: #fff0eb; border-color: #ac3d26; color: #712719; }
.empty { border: 1px dashed var(--edge); background: var(--paper); }
.tools + .grid, .tabs + .grid, .tools + .stack, .tabs + .stack { margin-top: 1rem; }
footer { margin-top: 2rem; padding-block: 1rem 2rem; color: var(--muted); border-top: 1px solid var(--edge); }
@media (hover: hover) {
  button:not(:disabled):hover, .secondary:hover, .tabs a:hover { border-color: var(--accent); }
  .primary:hover, button.primary:hover { background: var(--accent-hover); color: #fff; }
}
@media (min-width: 48rem) {
  .shell, .wrap { width: min(100% - 4rem, 72rem); }
  .grid { gap: 1.4rem; }
  .bar :is(.wrap,.shell) { min-height: 4.75rem; }
  .stock-row .actions { margin-left: auto; }
}
@media (max-width: 24rem) {
  .shell, .wrap { width: calc(100% - 1.4rem); }
  .actions { gap: .5rem; }
  .stock-row .actions { width: 100%; }
}
.admin .bar { border-top: 4px solid var(--accent); }
.admin .brand-logo { height: 3.15rem; }
.admin main.wrap { max-width: 54rem; padding-top: .9rem; }
.admin-account { font-weight: 650; }
.admin-account small { display: block; font-weight: 400; }
.inventory { gap: .7rem; }
.inventory-head {
  display: grid;
  gap: .85rem;
  padding: clamp(1rem, 3vw, 1.6rem);
  background: #174f44;
  color: #fff;
  border-radius: 12px;
}
.inventory-head h1 { color: inherit; }
.inventory-head label { font-size: .9rem; }
.inventory-head :is(input,a):focus-visible { outline-color: #a6eed4; }
.inventory-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 9px; background: #103c33; }
.inventory-tabs a { background: transparent; border: 0; color: #e1f4ec; }
.inventory-tabs a[aria-current="page"] { background: #e6f6ec; color: #123f34; }
.inventory-heading { margin-top: .45rem; }
.inventory-heading h2 { font-size: 1.25rem; }
.inventory-card { background: var(--paper); padding: 1rem; border: 1px solid var(--edge); border-radius: 12px; }
.inventory-item { display: flex; align-items: center; gap: .85rem; overflow-wrap: anywhere; }
.stock-thumb { flex: none; width: 4rem; height: 4rem; object-fit: cover; border-radius: 7px; }
.inventory-item h3 { margin: .15rem 0 .3rem; }
.stock-state { display: inline-block; border-radius: 4px; padding: .1rem .5rem; color: #245e48; background: #e4f3e9; font-size: .8rem; font-weight: 650; }
.stock-state[data-state="Terjual"], .stock-state[data-state="Habis"] { color: #773824; background: #f7e9e0; }
.stock-state[data-state="Dipesan"] { color: #674e16; background: #faf0ce; }
.inventory-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; margin-top: .9rem; }
.inventory-actions form { margin: 0; }
.inventory-actions > :first-child, .inventory-actions > :last-child:nth-child(2) { grid-column: 1 / -1; }
.inventory-actions button, .inventory-actions a { width: 100%; min-height: 46px; }
.inventory-tools { border-top: 1px solid var(--edge); }
.inventory-tools summary { padding: .8rem .2rem; font-weight: 650; cursor: pointer; }
.inventory-tools nav { margin: .3rem 0; }
