/* ==========================================================
   Mado Utrecht · Customer stylesheet
   Mobile-first, touch-optimized
   ========================================================== */

:root {
  --mado-red: #c8102e;
  --mado-red-dark: #a00d24;
  --mado-gold: #c9a227;
  --bg: #fafafa;
  --card: #ffffff;
  --ink: #1a1a1a;
  --ink-muted: #6b6b6b;
  --ink-light: #9b9b9b;
  --border: #e8e8e8;
  --border-strong: #d0d0d0;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #ea580c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --header-h: 56px;
  --cart-bar-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }

/* ===== HEADER ===== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex; align-items: center;
}
.header-inner {
  max-width: 720px; width: 100%; margin: 0 auto;
  padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.header-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
.header-title strong { font-size: 16px; font-weight: 700; color: var(--mado-red); }
.tafel-badge {
  background: var(--mado-red); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.header-right { display: flex; gap: 6px; align-items: center; }
.taal-switch, .rekening-link, .back-link {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--ink); font-size: 20px;
  transition: background 0.15s;
}
.taal-switch:active, .rekening-link:active, .back-link:active { background: var(--border); }
.back-link { font-size: 28px; font-weight: 300; color: var(--mado-red); }

/* ===== TAAL PAGE ===== */
.taal-page { background: linear-gradient(160deg, var(--mado-red) 0%, var(--mado-red-dark) 100%); min-height: 100vh; }
.taal-wrap {
  max-width: 420px; margin: 0 auto; padding: 40px 24px;
  min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between;
  color: #fff;
}
.taal-logo { text-align: center; margin-top: 30px; }
.taal-logo img { max-width: 140px; margin: 0 auto 20px; }
.taal-logo h1 { font-size: 32px; margin: 0 0 8px; letter-spacing: 0.5px; }
.taal-logo .tafel-line { opacity: 0.85; font-size: 15px; margin: 0; }
.taal-kop { text-align: center; margin: 40px 0 24px; }
.taal-kop h2 { font-size: 22px; margin: 0 0 6px; font-weight: 600; }
.taal-kop p { margin: 0; opacity: 0.85; font-size: 15px; }
.taal-form { display: flex; flex-direction: column; gap: 14px; }
.taal-knop {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 18px 20px;
  border-radius: var(--radius);
  font-size: 18px; font-weight: 600;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.15s;
  backdrop-filter: blur(10px);
}
.taal-knop:hover { background: rgba(255,255,255,0.2); }
.taal-knop:active { transform: scale(0.98); }
.taal-knop .vlag { font-size: 32px; }
.taal-foot { text-align: center; font-size: 12px; opacity: 0.7; }
.taal-foot a { color: #fff; text-decoration: underline; }

/* ===== CAT NAV ===== */
.cat-nav {
  position: sticky; top: var(--header-h); z-index: 50;
  background: #fff; border-bottom: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  white-space: nowrap; scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  display: inline-block; padding: 12px 14px;
  font-size: 13px; font-weight: 600; color: var(--ink-muted);
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.cat-nav a.active { color: var(--mado-red); border-bottom-color: var(--mado-red); }

/* ===== MENU ===== */
.menu { max-width: 720px; margin: 0 auto; padding: 8px 12px 100px; }
.cat-block { margin-top: 20px; scroll-margin-top: calc(var(--header-h) + 48px); }
.cat-block h2 { font-size: 20px; font-weight: 700; margin: 0 0 6px; color: var(--mado-red); }
.cat-desc { font-size: 13px; color: var(--ink-muted); margin: 0 0 12px; }
.product-list { display: flex; flex-direction: column; gap: 10px; }

.product {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: grid; grid-template-columns: 100px 1fr;
  gap: 0; min-height: 100px;
}
.product img, .product-img-placeholder {
  width: 100px; height: 100%;
  object-fit: cover; background: #f5f5f5;
  display: flex; align-items: center; justify-content: center;
}
.product-body {
  padding: 12px 14px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-width: 0;
}
.product-body h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.product-body p {
  font-size: 12.5px; color: var(--ink-muted);
  margin: 0 0 8px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.prijs { font-weight: 700; color: var(--mado-red); font-size: 15px; }
.add-btn {
  width: 36px; height: 36px;
  background: var(--mado-red); color: #fff;
  border-radius: 50%;
  font-size: 22px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(200, 16, 46, 0.3);
  transition: transform 0.15s;
}
.add-btn:active { transform: scale(0.9); }

/* ===== CART BAR ===== */
.cart-bar {
  position: fixed; left: 50%; bottom: 16px;
  transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 700px;
  background: var(--mado-red); color: #fff;
  border-radius: 50px;
  padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 24px rgba(200, 16, 46, 0.35);
  font-weight: 600; z-index: 90;
}
.cart-bar[hidden] { display: none; }
.cart-count {
  background: #fff; color: var(--mado-red); border-radius: 50%;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.cart-label { flex: 1; font-size: 15px; }
.cart-total { font-size: 15px; }

/* ===== CHECKOUT ===== */
.checkout { max-width: 720px; margin: 0 auto; padding: 16px; }
.cart-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cart-item {
  background: var(--card); padding: 12px; border-radius: var(--radius);
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
}
.ci-info { flex: 1; min-width: 0; }
.ci-info strong { display: block; font-size: 14.5px; font-weight: 600; }
.ci-prijs { font-size: 13px; color: var(--ink-muted); }
.ci-opmerking { font-size: 12px; color: var(--warning); margin-top: 4px; font-style: italic; }

.qty-box { display: flex; align-items: center; gap: 2px; background: #f5f5f5; border-radius: 50px; padding: 2px; }
.qty-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; color: var(--mado-red);
  font-size: 18px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.qty-btn:active { transform: scale(0.9); }
.qty { min-width: 24px; text-align: center; font-weight: 600; font-size: 15px; }

.opmerking-box { background: var(--card); padding: 14px; border-radius: var(--radius); margin-bottom: 16px; }
.opmerking-box label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-muted); }
.opmerking-box textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; font-size: 14px; font-family: inherit; resize: vertical;
}

.totalen { background: var(--card); padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.totalen .row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 15px; }
.totalen .row.small { font-size: 12px; color: var(--ink-muted); }
.totalen .row.totaal { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 18px; }
.totalen .row.totaal strong { color: var(--mado-red); }

.alert { background: #fef2f2; color: var(--danger); padding: 12px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; border-left: 4px solid var(--danger); }

.betaal-keuze h3 { font-size: 16px; margin: 0 0 12px; color: var(--ink); }
.betaal-optie { margin-bottom: 10px; }

.btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 16px 20px; border-radius: var(--radius);
  font-size: 16px; font-weight: 600; text-align: left;
  transition: all 0.15s; cursor: pointer; border: 0;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--mado-red); color: #fff; }
.btn-primary:hover { background: var(--mado-red-dark); }
.btn-secondary { background: #fff; color: var(--ink); border: 2px solid var(--border-strong); }
.btn-secondary:hover { border-color: var(--mado-red); color: var(--mado-red); }
.btn-groot { padding: 18px 24px; font-size: 17px; justify-content: center; }
.btn-icon {
  font-size: 22px; flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.15); border-radius: 50%;
}
.btn-secondary .btn-icon { background: #f5f5f5; }
.btn small { display: block; font-size: 12.5px; font-weight: 400; opacity: 0.85; margin-top: 2px; }
.btn span { display: block; flex: 1; }

/* ===== BEDANKT ===== */
.bedankt-page { min-height: 100vh; background: var(--bg); }
.bedankt { max-width: 480px; margin: 0 auto; padding: 40px 24px; text-align: center; }
.checkmark, .x-mark {
  width: 72px; height: 72px; border-radius: 50%;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 600; color: #fff;
}
.checkmark { background: var(--success); }
.x-mark { background: var(--danger); }
.spinner {
  width: 48px; height: 48px; margin: 0 auto 20px;
  border: 4px solid var(--border);
  border-top-color: var(--mado-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.bedankt h1 { font-size: 24px; margin: 0 0 8px; }
.bedankt .lead { color: var(--ink-muted); font-size: 15px; margin: 0 0 24px; }
.bestel-info { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.info-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.info-row span { color: var(--ink-muted); }
.regel-overzicht { background: var(--card); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; text-align: left; }
.regel { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.regel:last-child { border-bottom: 0; }
.actions { display: flex; gap: 10px; flex-direction: column; }
.actions .btn { justify-content: center; text-align: center; }
.retry-link { display: inline-block; margin-top: 16px; color: var(--mado-red); font-weight: 600; font-size: 14px; }

/* ===== REKENING ===== */
.rekening { max-width: 720px; margin: 0 auto; padding: 16px 16px 40px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-muted); }
.empty-state p { margin-bottom: 20px; }
.bestel-groepen { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.bestel-groep {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  border-left: 4px solid var(--border-strong);
}
.bestel-groep.status-betaald { border-left-color: var(--success); }
.bestel-groep.status-open    { border-left-color: var(--warning); }
.bestel-groep.status-mislukt,
.bestel-groep.status-geannuleerd { border-left-color: var(--danger); }
.bg-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.bg-head strong { font-size: 13px; }
.bg-head small { display: block; color: var(--ink-muted); font-size: 11px; }
.status-pil { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; background: #f0f0f0; }
.status-betaald .status-pil { background: #dcfce7; color: var(--success); }
.status-open .status-pil    { background: #ffedd5; color: var(--warning); }
.bg-regels { padding: 10px 14px; }
.bg-regels .regel { font-size: 13px; border-bottom: 0; padding: 3px 0; }
.bg-totaal {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--border);
  background: #fafafa; font-size: 14px;
}
.bg-totaal strong { color: var(--mado-red); }

.sessie-totaal { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.sessie-totaal .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 15px; }
.sessie-totaal .row.open { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 20px; }
.sessie-totaal .row.open strong { color: var(--mado-red); }
.afrekenen-form .hint { text-align: center; font-size: 12px; color: var(--ink-muted); margin-top: 12px; }
.alle-betaald { text-align: center; padding: 20px; background: #dcfce7; color: var(--success); font-weight: 600; border-radius: var(--radius); }

/* ===== ERROR / INFO PAGES ===== */
.error-page, .info-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.error-box, .info-wrap {
  background: var(--card); border-radius: var(--radius);
  padding: 32px; text-align: center;
  box-shadow: var(--shadow-lg); max-width: 400px;
}
.error-box h1, .info-wrap h1 { font-size: 20px; margin: 0 0 12px; color: var(--mado-red); }
.error-box .small { color: var(--ink-muted); font-size: 13px; margin-top: 16px; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: calc(var(--cart-bar-h) + 24px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: #2d2d2d; color: #fff;
  padding: 10px 18px; border-radius: 50px;
  font-size: 14px; font-weight: 500;
  opacity: 0; transition: all 0.25s;
  z-index: 110; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== RESPONSIVE ===== */
@media (min-width: 600px) {
  .product-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (min-width: 900px) {
  .product-list { grid-template-columns: repeat(3, 1fr); }
}

/* ===== LANDING PAGE (direct bezoek zonder QR) ===== */
.landing-page {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, var(--mado-red) 0%, var(--mado-red-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.landing-wrap {
  width: 100%;
  max-width: 460px;
}
.landing-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.landing-logo { margin-bottom: 24px; }
.landing-logo img {
  max-width: 120px;
  max-height: 80px;
  margin: 0 auto 12px;
  object-fit: contain;
}
.landing-logo h1 {
  font-size: 30px;
  font-weight: 700;
  color: var(--mado-red);
  letter-spacing: 0.5px;
  margin: 0;
}
.qr-icon {
  width: 90px;
  height: 90px;
  margin: 28px auto 20px;
  color: var(--mado-red);
  opacity: 0.85;
}
.qr-icon svg { width: 100%; height: 100%; }

.landing-kop {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.4;
}
.landing-kop-en {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.landing-info {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 8px;
}
.info-item {
  font-size: 14px;
  color: var(--text-muted);
}
.info-item a { color: var(--mado-red); font-weight: 600; }

/* ==========================================================
   MOBILE-FIRST OVERRIDES v2 — optimalisaties voor alle phones
   ========================================================== */

/* ===== Smooth scroll met respect voor reduced-motion ===== */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== Icon buttons in header ===== */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;                  /* Apple minimum tap target */
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.12);
  border: 0; cursor: pointer;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { background: rgba(255,255,255,.28); transform: scale(.92); }
.icon-btn:hover { background: rgba(255,255,255,.22); }

/* Header icons worden groter (44px ipv 40px voor tap target) */
.taal-switch, .rekening-link {
  width: 44px; height: 44px;
}

/* ===== ZOEKBALK ===== */
.zoekbalk {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  margin: 10px -4px 0 -4px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  height: 42px;
}
.zoekbalk[hidden] { display: none; }
.zoekbalk .zoek-icon { color: #fff; opacity: .85; flex-shrink: 0; }
.zoekbalk input[type="search"] {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  font-size: 16px;       /* 16px voorkomt iOS auto-zoom */
  height: 100%;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}
.zoekbalk input::placeholder { color: rgba(255,255,255,.6); }
.zoekbalk input::-webkit-search-cancel-button,
.zoekbalk input::-webkit-search-decoration { -webkit-appearance: none; }
.zoek-clear {
  background: rgba(255,255,255,.25);
  border: 0; color: #fff;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.zoek-clear[hidden] { display: none; }

/* ===== CATEGORIE NAV (verbeteringen) ===== */
.cat-nav {
  scroll-snap-type: x proximity;
  padding-left: 4px; padding-right: 4px;
}
.cat-nav a {
  scroll-snap-align: center;
  padding: 14px 16px;
  min-height: 44px;
  display: inline-flex; align-items: center;
}

/* ===== PRODUCT CARD — mobile verbeteringen ===== */
.product {
  min-height: 104px;                    /* consistente hoogte */
  touch-action: manipulation;           /* geen double-tap zoom */
}
.product.in-cart {
  border-color: var(--mado-red);
  box-shadow: 0 0 0 1px var(--mado-red) inset;
}
.product img, .product-img-placeholder {
  width: 104px; height: 104px;
  flex-basis: 104px;
}

/* Product body: betere spacing op alle schermen (FIX: links padding toegevoegd) */
.product-body {
  padding: 12px 14px 12px 14px;
}
.product-body h3 {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-body p {
  font-size: 12.5px;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--ink-muted);
}

/* ===== ADD BUTTON met quantity badge ===== */
.add-btn {
  position: relative;
  width: 44px; height: 44px;            /* groter tap target */
  border-radius: 50%;
  background: var(--mado-red);
  color: #fff;
  border: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .1s, background .15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(200,16,46,.3);
}
.add-btn:active { transform: scale(.88); }
.add-btn.added { background: #22c55e; }
.add-btn .add-plus { font-size: 24px; font-weight: 300; line-height: 1; }
.add-btn.has-qty .add-plus { font-size: 14px; }
.add-btn .add-qty {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  background: #fff;
  color: var(--mado-red);
  border: 2px solid var(--mado-red);
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.add-btn .add-qty[hidden] { display: none; }

/* ===== CART BAR verbeteringen ===== */
.cart-bar {
  display: flex;
  min-height: 56px;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(200,16,46,.35);
  transform: translateY(0);
  animation: cartSlideUp .3s cubic-bezier(.2,.8,.2,1);
  -webkit-tap-highlight-color: transparent;
}
@keyframes cartSlideUp {
  from { transform: translateY(120%); }
  to { transform: translateY(0); }
}
.cart-bar:active { transform: scale(.98); }
.cart-bar .cart-total { margin-right: 2px; }

/* ===== ZOEK: geen resultaten state ===== */
.zoek-leeg {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-muted);
}
.zoek-leeg[hidden] { display: none; }
.zoek-leeg svg { margin: 0 auto 12px; display: block; color: var(--ink-muted); }
.zoek-leeg p { font-size: 15px; }

/* ===== Gefilterde/verborgen producten ===== */
.product.is-hidden { display: none !important; }
.cat-block.is-hidden { display: none !important; }

/* ===== Kleine schermen (iPhone SE, oude Android) ===== */
@media (max-width: 374px) {
  .app-header { padding: 12px 12px; }
  .header-title strong { font-size: 15px; }
  .tafel-badge { font-size: 11px; padding: 2px 8px; }
  .icon-btn, .taal-switch, .rekening-link { width: 40px; height: 40px; }
  .header-right { gap: 4px; }
  .cat-nav a { padding: 12px 12px; font-size: 13px; }
  .menu { padding: 12px; }
  .cat-block h2 { font-size: 20px; }
  .product img, .product-img-placeholder { width: 88px; height: 88px; flex-basis: 88px; }
  .product { min-height: 92px; }
  .product-body { padding: 10px 12px 10px 12px; }
  .product-body h3 { font-size: 14px; }
  .product-body p { font-size: 12px; }
  .add-btn { width: 40px; height: 40px; }
  .cart-bar { padding: 12px 14px; font-size: 14px; left: 12px; right: 12px; }
}

/* ===== Middelgrote phones (iPhone 13/14/15, Pixel) ===== */
@media (min-width: 390px) and (max-width: 480px) {
  .menu { padding: 14px; }
  .product img, .product-img-placeholder { width: 108px; height: 108px; flex-basis: 108px; }
}

/* ===== Grote phones (iPhone Pro Max, grote Android) ===== */
@media (min-width: 481px) and (max-width: 639px) {
  .menu { padding: 16px; }
  .product img, .product-img-placeholder { width: 118px; height: 118px; flex-basis: 118px; }
  .product-body h3 { font-size: 16px; }
  .product-body p { font-size: 13px; -webkit-line-clamp: 3; }
}

/* ===== Landscape phones ===== */
@media (max-height: 500px) and (orientation: landscape) {
  .app-header { padding-top: 8px; padding-bottom: 8px; }
  .cat-nav a { padding: 10px 14px; }
  .cat-block { margin-bottom: 24px; }
  body { padding-bottom: 80px; }
}

/* ===== Tablet / desktop (2-kolom grid) ===== */
@media (min-width: 640px) {
  .product-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}
@media (min-width: 960px) {
  .product-list { grid-template-columns: repeat(3, 1fr); }
  /* Bij 3-kolom desktop: kleinere afbeelding zodat er meer ruimte is voor tekst */
  .product { grid-template-columns: 96px 1fr; }
  .product img, .product-img-placeholder { width: 96px; flex-basis: 96px; }
}

/* ===== iOS tap highlight uit ===== */
a, button, .product { -webkit-tap-highlight-color: transparent; }

/* ===== Focus states voor keyboard navigation (toegankelijkheid) ===== */
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--mado-red);
  outline-offset: 2px;
}

/* ===== Pulse animatie bij toevoegen ===== */
@keyframes bumpScale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.add-btn.bump { animation: bumpScale .3s ease; }

/* ===== MENU FOOTER (AC Technologie credit) ===== */
.menu-foot {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  padding: 30px 20px 20px !important;
  margin: 20px 0 0 0 !important;
  border-top: 1px solid var(--border);
  color: var(--ink-light);
  width: 100% !important;
  box-sizing: border-box;
}
.menu-foot small {
  display: block !important;
  font-size: 12px;
  letter-spacing: 0.2px;
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}
.menu-foot a {
  color: var(--mado-red) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: opacity .15s;
}
.menu-foot a:hover, .menu-foot a:active { opacity: .7; }

/* ==========================================================
   OPTIES MODAL (bottom sheet) — per-item opmerking + chips
   ========================================================== */
.opm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.opm-modal[hidden] { display: none !important; }

.opm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: auto;
}
.opm-modal.show .opm-backdrop { opacity: 1; }

.opm-sheet {
  position: relative;
  width: 100%;
  max-width: 600px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.2,.9,.3,1.1);
  pointer-events: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,.3);
}
.opm-modal.show .opm-sheet { transform: translateY(0); }

.opm-handle {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 999px;
  margin: 0 auto 12px;
  cursor: grab;
}
.opm-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 0;
  font-size: 14px;
  color: var(--ink-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.opm-close:active { background: var(--border); }

.opm-head {
  padding-right: 40px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.opm-head h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.2;
  color: var(--ink);
}
.opm-prijs {
  font-size: 15px;
  font-weight: 600;
  color: var(--mado-red);
}

.opm-body {
  overflow-y: auto;
  flex: 1;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.opm-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ink-muted);
  margin: 0 0 8px;
  display: block;
}

#opmTekst {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  background: var(--bg);
  box-sizing: border-box;
}
#opmTekst:focus {
  outline: 0;
  border-color: var(--mado-red);
}

.opm-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.opm-qty {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.opm-qty-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  font-size: 18px;
  font-weight: 600;
  color: var(--mado-red);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.opm-qty-btn:active { background: var(--border); }
.opm-qty-btn:disabled {
  opacity: .3;
  cursor: not-allowed;
}
.opm-qty-num {
  min-width: 28px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.opm-submit {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px !important;
  font-size: 15px !important;
  min-height: 48px;
}
.opm-submit-prijs {
  font-weight: 700;
  margin-left: 10px;
}

@media (max-width: 374px) {
  .opm-sheet { padding: 10px 16px 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0)); }
  .opm-head h3 { font-size: 16px; }
  .opm-chips .chip { padding: 7px 12px; font-size: 13px; }
  .opm-qty-btn { width: 36px; height: 36px; }
}

/* ==========================================================
   CHECKOUT: per-item opmerking (simpele inline input)
   ========================================================== */
.cart-item {
  flex-direction: column !important;
  align-items: stretch !important;
  padding: 14px 16px !important;
}
.ci-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.ci-row .ci-info { flex: 1; min-width: 0; }
.ci-row .qty-box { flex-shrink: 0; }

.ci-opm-inline {
  margin-top: 10px;
  position: relative;
}

.ci-opm-veld {
  width: 100%;
  padding: 10px 34px 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
  box-sizing: border-box;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
  min-height: 42px;
}
.ci-opm-veld::placeholder {
  color: var(--ink-light);
  font-style: italic;
}
.ci-opm-veld:focus {
  outline: 0;
  border-color: var(--mado-red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(200,16,46,.12);
}

/* Status indicator (rechtsonder in het veld) */
.ci-opm-status {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.ci-opm-inline.is-saving .ci-opm-status {
  opacity: 1;
}
.ci-opm-inline.is-saving .ci-opm-status::before {
  content: "";
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--mado-red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.ci-opm-inline.is-saved .ci-opm-status {
  opacity: 1;
  color: #22c55e;
  font-size: 16px;
  font-weight: 700;
}
.ci-opm-inline.is-saved .ci-opm-status::before { content: "✓"; }
.ci-opm-inline.is-error .ci-opm-status {
  opacity: 1;
  color: #ef4444;
}
.ci-opm-inline.is-error .ci-opm-status::before { content: "✕"; }

/* Als er al een opmerking staat → kleur iets gelig/warm voor visuele hint */
.ci-opm-veld:not(:placeholder-shown):not(:focus) {
  background: #fffbeb;
  border-color: #fde68a;
  color: #713f12;
  font-style: italic;
}