/*
  DheDame Digital storefront.
  Palette comes from the logo: red, white, and the black it sits on. Red is the one accent;
  black frames the logo in the header; everything else is white and grey.
  Identity motif: the logo's forward slant. Display headings use Barlow Condensed 800 italic,
  and section titles carry a slanted red tab, the same angle as the lettering.
*/

@font-face {
  font-family: "Display";
  src: url("/assets/fonts/barlow-condensed-latin-800-italic.woff2") format("woff2");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #141012;
  --paper: #ffffff;
  --wash: #f7f4f4;
  --line: #e4dcdc;
  --muted: #5f5759;
  --red: #c8000e;
  --red-deep: #9a000a;
  --red-tint: #fff0f0;
  --ok: #17683a;
  --focus: #141012;
  --radius-s: 4px;
  --radius-m: 8px;
  --gap: clamp(16px, 3vw, 28px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Display", "Arial Narrow", var(--font);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--red); text-underline-offset: 2px; }
a:hover { color: var(--red-deep); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.1; margin: 0 0 .5em; }
h1 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: clamp(2.1rem, 5.5vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

code { font-size: .9em; background: var(--wash); padding: .1em .3em; border-radius: var(--radius-s); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }
.narrow { max-width: 620px; }
.page { padding-top: 40px; padding-bottom: 56px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.break { word-break: break-all; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip { position: absolute; left: 8px; top: -60px; background: var(--paper); color: var(--ink); padding: 8px 12px; z-index: 10; border-radius: var(--radius-s); }
.skip:focus { top: 8px; }

/* ---------- Header ---------- */

.announce { margin: 0; background: var(--red); color: #fff; text-align: center; padding: 8px 16px; font-size: .92rem; font-weight: 600; }

.top { background: var(--ink); color: #fff; }
.top-row { display: flex; align-items: center; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; }
.brand img { border-radius: var(--radius-m); }
.brand span { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 1.5rem; letter-spacing: .01em; }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav-btn {
  color: #fff; text-decoration: none; padding: 10px 12px; border-radius: var(--radius-s);
  font: 600 .95rem/1.2 var(--font); background: none; border: 0; cursor: pointer;
}
.nav a:hover, .nav-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--ink); }
.nav .nav-wa { background: var(--red); }
.nav .nav-wa:hover { background: var(--red-deep); }
.nav :focus-visible, .nav-toggle:focus-visible, .brand:focus-visible { outline-color: #fff; }
.nav-form { margin: 0; }

.nav-toggle {
  display: none; background: none; color: #fff; border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--radius-s); padding: 8px 14px; font: 600 .95rem var(--font); cursor: pointer; min-height: 44px;
}
.nav-toggle:hover { border-color: #fff; }

@media (max-width: 760px) {
  .js .nav-toggle { display: block; }
  .js .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .js .nav.is-open { display: flex; }
  .nav a, .nav-btn { padding: 12px; text-align: left; width: 100%; }
}

/* ---------- Buttons & fields ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border: 2px solid var(--red); border-radius: var(--radius-s);
  background: var(--red); color: #fff; font: 700 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-quiet { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn-quiet:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-wa { background: var(--ink); border-color: var(--ink); }
.btn-wa:hover { background: #000; border-color: #000; }
.btn-danger { background: var(--paper); color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-ghost {
  background: none; border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--ink);
  font: 600 .85rem var(--font); padding: 6px 10px; cursor: pointer; vertical-align: middle; min-height: 36px;
}
.btn-ghost:hover { border-color: var(--ink); }
.linkish { background: none; border: 0; padding: 0; color: var(--red); font: inherit; text-decoration: underline; cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; margin-bottom: 16px; }
.field .hint, .field .optional { font-weight: 400; }
.optional { color: var(--muted); }
.hint { color: var(--muted); font-size: .9rem; }
.field-error { color: var(--red); font-weight: 600; font-size: .9rem; }

input, select, textarea {
  font: 400 1rem/1.4 var(--font); color: var(--ink); background: var(--paper);
  border: 1px solid #8a7f81; border-radius: var(--radius-s); padding: 10px 12px; min-height: 46px; width: 100%;
}
textarea { min-height: 0; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--ink); }
input[aria-invalid="true"], fieldset[aria-invalid="true"] { border-color: var(--red); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--red); cursor: pointer; }
input[type="file"] { padding: 8px; cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; min-height: 44px; }

.stack-form { max-width: 460px; }

/* ---------- Messages ---------- */

.flash { padding: 12px 16px; border-radius: var(--radius-m); margin: 16px 0; border: 1px solid; }
.flash p, .flash ul { margin: 0; }
.flash ul { padding-left: 20px; }
.flash-ok { background: #effaf2; border-color: #a9d9b8; color: var(--ok); }
.flash-error { background: var(--red-tint); border-color: #f0b3b6; color: var(--red-deep); }

.empty { background: var(--wash); border-radius: var(--radius-m); padding: 24px; color: var(--ink); }
.empty h3 { font-size: 1.15rem; }
.empty p:last-child { margin: 0; }
.empty-inline { margin-top: 16px; }

/* ---------- Section titles: the slanted red tab ---------- */

.tag-title {
  font-family: var(--display); font-style: italic; font-weight: 800;
  font-size: clamp(1.6rem, 3.6vw, 2.2rem); display: flex; align-items: center; gap: 12px;
}
.tag-title::before {
  content: ""; width: 14px; height: .9em; background: var(--red); transform: skewX(-14deg); flex: none;
}

/* ---------- Home: intro ---------- */

.intro { padding: clamp(40px, 7vw, 80px) 0 clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.intro-grid { display: grid; gap: 32px; align-items: end; }
@media (min-width: 900px) { .intro-grid { grid-template-columns: 1.25fr 1fr; gap: 56px; } }
.intro h1 { max-width: 15ch; }
.slash { color: var(--red); }
.lede { font-size: 1.1rem; max-width: 48ch; color: var(--muted); margin: 0; }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 4px; }
.steps li {
  counter-increment: step; display: grid; grid-template-columns: 44px 1fr; align-items: baseline;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.steps li::before {
  content: counter(step); font-family: var(--display); font-style: italic; font-weight: 800; font-size: 1.6rem; color: var(--red); line-height: 1;
}

/* ---------- Home: catalog ---------- */

.catalog { padding-top: 48px; padding-bottom: 32px; scroll-margin-top: 16px; }
.catalog-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.catalog-head h2 { margin: 0; }
.search { flex: 1 1 260px; max-width: 360px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: var(--radius-s);
  padding: 8px 14px; min-height: 40px; font: 600 .92rem var(--font); cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.card a {
  display: flex; flex-direction: column; height: 100%; color: var(--ink); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: var(--paper);
}
.card a:hover { border-color: var(--ink); color: var(--ink); }
.card a:hover .card-name { color: var(--red); }
.card[hidden] { display: none; }
.thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--wash); }
.thumb-blank, .product-img.thumb-blank { display: flex; align-items: center; justify-content: center; background: var(--ink); }
.thumb-blank span { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 4.2rem; color: var(--red); line-height: 1; }
.card.is-out .thumb { filter: grayscale(1); opacity: .55; }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.card-cat { color: var(--muted); font-size: .85rem; font-weight: 600; margin: 0; }
.card-name { font-weight: 700; font-size: 1.08rem; line-height: 1.3; }
.card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 10px; }
.price { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 1.35rem; color: var(--red); }
.stock { font-size: .85rem; color: var(--ok); font-weight: 600; }
.stock-out { color: var(--red-deep); font-weight: 600; }

/* ---------- Home: lookup ---------- */

.lookup { padding-top: 24px; padding-bottom: 64px; }
.lookup-box { display: grid; gap: 24px; background: var(--wash); border-radius: var(--radius-m); padding: clamp(20px, 4vw, 36px); }
@media (min-width: 900px) { .lookup-box { grid-template-columns: 1fr 1.3fr; align-items: end; } }
.lookup-box p { margin: 0; color: var(--muted); }
.lookup-form { display: grid; gap: 12px; }
.lookup-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
@media (min-width: 640px) { .lookup-form { grid-template-columns: 1fr 1fr auto; align-items: end; } }

/* ---------- Product ---------- */

.crumbs { padding-top: 20px; margin: 0; }
.crumbs a { font-weight: 600; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.product { display: grid; gap: 32px; padding-top: 16px; padding-bottom: 64px; }
@media (min-width: 900px) { .product { grid-template-columns: 1fr 440px; align-items: start; gap: 56px; } }
.product-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-m); margin-bottom: 20px; }
.product-img.thumb-blank span { font-size: 7rem; }
.prose { max-width: 62ch; }

.order-form { border: 1px solid var(--line); border-radius: var(--radius-m); padding: clamp(18px, 3vw, 28px); background: var(--paper); }
@media (min-width: 900px) { .order-form { position: sticky; top: 16px; } }
.variants { border: 0; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.variants legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.variant {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "radio label price" "radio stock price";
  column-gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-m); cursor: pointer;
}
.variant input { grid-area: radio; }
.variant-label { grid-area: label; font-weight: 700; }
.variant-stock { grid-area: stock; font-size: .85rem; color: var(--muted); }
.variant-price { grid-area: price; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 1.3rem; }
.variant:hover { border-color: var(--ink); }
.variant:has(input:checked) { border-color: var(--red); background: var(--red-tint); box-shadow: inset 0 0 0 1px var(--red); }
.variant:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.variant.is-out { cursor: not-allowed; color: var(--muted); background: var(--wash); }
.variant.is-out .variant-stock { color: var(--red-deep); font-weight: 600; }
.field-qty input { max-width: 120px; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding: 16px 0; margin-top: 4px; font-weight: 600; }
.total { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 2rem; color: var(--red); }

/* ---------- Order ---------- */

.order-page { padding-top: 24px; padding-bottom: 64px; }
.order-head { margin-bottom: 24px; }
.order-head p:last-child { color: var(--muted); max-width: 60ch; }
.order-id { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: clamp(2rem, 7vw, 3.2rem); }

.progress { list-style: none; margin: 0 0 32px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; counter-reset: p; }
.progress li {
  counter-increment: p; padding: 10px 8px 0; border-top: 4px solid var(--line); color: var(--muted); font-weight: 600; font-size: .9rem;
}
.progress li::before { content: counter(p) ". "; }
.progress li.done { border-color: var(--ink); color: var(--ink); }
.progress li.now { border-color: var(--red); color: var(--red); }

.order-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .order-grid { grid-template-columns: 1fr 340px; align-items: start; gap: 48px; } }
.order-main > section { margin-bottom: 32px; }
.pay-amount { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.pay-amount strong { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 2.4rem; color: var(--red); line-height: 1; }
.qr { width: min(100%, 320px); margin: 20px auto 8px; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px; background: #fff; }
.upload-form { display: grid; gap: 12px; }
.file { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.done-box { background: var(--wash); border-radius: var(--radius-m); padding: 20px; }

.summary { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; }
.summary h2 { font-size: 1.1rem; }
.summary dl, .facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.summary dt, .facts dt { color: var(--muted); }
.summary dd, .facts dd { margin: 0; }

.status { display: inline-block; padding: 3px 10px; border-radius: var(--radius-s); font-weight: 700; font-size: .85rem; border: 1px solid var(--line); white-space: nowrap; }
.status-menunggu_bayaran { background: var(--paper); color: var(--ink); }
.status-menunggu_semakan { background: var(--red); border-color: var(--red); color: #fff; }
.status-dibayar { background: var(--ink); border-color: var(--ink); color: #fff; }
.status-selesai { background: #effaf2; border-color: #a9d9b8; color: var(--ok); }
.status-dibatalkan, .status-tamat { background: var(--wash); color: var(--muted); }

/* ---------- Footer ---------- */

.foot { border-top: 1px solid var(--line); padding: 24px 0 32px; color: var(--muted); font-size: .92rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.foot p { margin: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.foot a { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
