/* Bestellen – GraveerCreatief. Zelfde opzet en kleuren als de kassa. Mobiel eerst. */

:root {
  --bg: #e8eeed;
  --vlak: #ffffff;
  --inkt: #16282b;
  --zacht: #5b6e70;
  --lijn: #cbd6d4;
  --accent: #0e5a5f;
  --accent-licht: #d5e8e6;
  --goed: #1d7a4a;
  --goed-licht: #d9efe2;
  --fout: #b3261e;
  --fout-licht: #f6dcda;
  --rand: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--inkt);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}
body.sheet-open { overflow: hidden; }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Kop ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--accent);
  color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 14px 12px;
  display: grid;
  gap: 8px;
}
.top-rij { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.top h1 { margin: 0; font-size: 1.35rem; letter-spacing: .01em; }
.top .zacht { color: #cfe5e3; font-size: .9rem; }
.top input[type="search"] {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--inkt);
}

/* ---------- Artikelen ---------- */
main { padding: 12px; }

.tegels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.tegel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--vlak);
  border: 1px solid var(--lijn);
  border-radius: var(--rand);
  overflow: hidden;
}

/* Foto: tik om te vergroten */
.foto-knop {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.tegel img,
.tegel .geen-foto {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--accent-licht);
}
.tegel .geen-foto {
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
}
.tegel .naam {
  padding: 8px 10px 0;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.25em + 8px);
}
.tegel .prijs { display: block; padding: 2px 10px 8px; color: var(--accent); font-weight: 700; font-size: 1.05rem; }

/* Knopje winkelmandje + : voegt één stuk toe */
.toevoeg {
  display: grid;
  place-items: center;
  min-height: 48px;
  margin: auto 10px 10px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
}
.toevoeg:active { transform: scale(.96); }

.tegel .teller {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 0 3px #fff;
  pointer-events: none;
}

.leeg { grid-column: 1 / -1; color: var(--zacht); padding: 24px 4px; }

/* ---------- Onderbalk ---------- */
.onderbalk {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 6;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--vlak);
  border-top: 1px solid var(--lijn);
}
.mandknop {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 18px;
  border: 0;
  border-radius: var(--rand);
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}
.mandknop:disabled { background: var(--lijn); color: var(--zacht); cursor: default; justify-content: center; }
.mand-links { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.mand-links small { font-size: .8rem; font-weight: 500; color: #cfe5e3; }

/* ---------- Venster onderin ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(22, 40, 43, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-vlak {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--vlak);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.sheet-kop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-kop h2 { margin: 0; font-size: 1.25rem; }
.tekstknop { min-height: 44px; padding: 0 8px; background: none; border: 0; color: var(--accent); font-weight: 600; }

.regels { list-style: none; margin: 0 0 14px; padding: 0; }
.regel {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--lijn);
}
.regel-naam { font-weight: 600; }
.regel-bedrag { min-width: 72px; text-align: right; }
.regel-wens { grid-column: 1 / -1; }
.stuks { display: inline-flex; align-items: center; gap: 8px; }
.stuks output { min-width: 24px; text-align: center; font-weight: 700; }
.rond {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--lijn);
  background: var(--vlak);
  font-size: 1.4rem;
  line-height: 1;
}

/* Keuze Verzenden/Afhalen en Tikkie/Achteraf */
.keuze { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 14px; }
.keuze-knop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 56px;
  margin: 0;
  padding: 6px 8px;
  text-align: center;
  border-radius: var(--rand);
  border: 2px solid var(--lijn);
  background: var(--vlak);
  font-weight: 700;
  cursor: pointer;
}
.keuze-knop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.keuze-knop small { display: block; font-weight: 500; color: var(--zacht); }
.keuze-knop.actief { border-color: var(--accent); background: var(--accent-licht); color: var(--accent); }
.keuze-knop:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Totalen */
.samenvatting { margin: 14px 0; }
.samenvatting > div { display: flex; justify-content: space-between; padding: 4px 0; }
.samenvatting .totaalregel {
  align-items: baseline;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 2px solid var(--inkt);
  font-weight: 700;
}
.samenvatting .totaalregel strong { font-size: 1.8rem; }

/* Knoppen */
.knoprij { display: flex; gap: 10px; margin-top: 14px; }
.knop {
  flex: 1;
  min-height: 56px;
  display: inline-grid;
  place-items: center;
  padding: 0 16px;
  border-radius: var(--rand);
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.knop.rand { background: var(--vlak); color: var(--inkt); border: 1px solid var(--lijn); flex: 0 0 auto; }
.knop.groot { flex: 1 1 auto; }
.knop.goed { background: var(--goed); }
.knop:disabled { background: var(--lijn); color: var(--zacht); cursor: default; }
.knop:active:not(:disabled) { transform: scale(.98); }

/* Formuliervelden */
.velden { display: grid; gap: 10px; margin: 8px 0; }
.velden label, .regel-wens { font-weight: 600; }
.velden input,
.velden textarea,
.regel-wens {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  padding: 10px 12px;
  font-weight: 400;
  border: 1px solid var(--lijn);
  border-radius: 10px;
  background: var(--vlak);
}
.regel-wens { margin-top: 0; }
.tussenkop { margin: 14px 0 0; font-weight: 700; }

.melding { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; }
.melding.fout { background: var(--fout-licht); color: var(--fout); font-weight: 600; }

.honing { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Bedankt ---------- */
.kaart { background: var(--vlak); border-radius: var(--rand); padding: 20px; max-width: 560px; margin: 0 auto; }
.klaar { text-align: center; }
.klaar h2 { margin: 6px 0 10px; }
.vink {
  margin: 0 auto 8px;
  width: 72px; height: 72px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--goed-licht);
  color: var(--goed);
  font-size: 2.4rem;
  font-weight: 700;
}
.klaar .knop { width: 100%; margin-top: 10px; }

/* ---------- Foto vergroten ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: rgba(0, 0, 0, .88);
}
.lightbox img { max-width: 100%; max-height: 78vh; border-radius: 8px; background: #fff; }
.lightbox .bijschrift { color: #fff; font-weight: 600; text-align: center; }
.lightbox .sluit {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  width: 48px; height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  font-size: 1.8rem;
  line-height: 1;
}

@media (min-width: 700px) {
  main { max-width: 900px; margin: 0 auto; }
  .sheet { align-items: center; }
  .sheet-vlak { border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .toevoeg:active, .knop:active:not(:disabled) { transform: none; }
}
