:root {
  --brand: #8D3030;
  --brand-dark: #6f2424;
  --bg: #FDFDFD;
  --card: #fff;
  --text: #333;
  --muted: #6b7280;
  --border: #e8e3dc;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }

.shell { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  /* longhand only — shorthand would wipe .shell's horizontal padding */
  padding-top: 8px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.topbar .brand {
  font-weight: 800;
  font-size: 18px;
  color: var(--brand);
  letter-spacing: .3px;
}

.topbar nav { display: flex; gap: 22px; margin-left: auto; align-items: center; flex-wrap: wrap; }

.topbar nav > * { flex-shrink: 0; }

/* hamburger — mobile only, toggled purely by CSS (:checked) */
.nav-toggle-box { display: none; }
.nav-toggle { display: none; }

.topbar nav a { font-size: 14px; font-weight: 600; color: #444; white-space: nowrap; }
.topbar nav a:hover { color: var(--brand); }

.badge-count {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  text-align: center;
  font-weight: 700;
}

main { padding: 26px 0 60px; }

h1, h2, h3 { margin: 0 0 12px; }

.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 22px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-img {
  height: 168px;
  background: #F7F5EE;
  object-fit: cover;
  width: 100%;
  display: block;
}

.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.card-title { font-size: 15px; font-weight: 700; }

.price-row { display: flex; align-items: baseline; gap: 8px; }
.price { font-weight: 800; color: var(--text); }
.price-old { font-size: 12px; color: #9ca3af; text-decoration: line-through; }

.tag-discount {
  align-self: flex-start;
  background: #FFECEC;
  color: #D32F2F;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  line-height: 1.35;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
}

.btn:hover { background: var(--brand-dark); }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-ghost:hover { background: #fdf2f2; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

/* QRIS payment screen */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination > li > a,
.pagination > li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
}

.pagination > li > a:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.pagination > li.active > span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.pagination > li.disabled > span {
  color: var(--muted);
  cursor: not-allowed;
  opacity: .6;
}

.pay-panel { text-align: left; }
.pay-hint { margin: 0 0 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.qr-box {
  display: flex;
  justify-content: center;
  padding: 16px;
  margin: 14px 0 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.qr-img { display: block; width: 240px; height: 240px; max-width: 100%; }

@media (max-width: 700px) {
  .qr-img { width: 200px; height: 200px; }
}

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 36px 0 16px; }
.section-title h2 { font-size: 18px; color: var(--brand); margin: 0; }

.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.table-wrap::-webkit-scrollbar { display: none; width: 0; height: 0; }
.table th, .table td { padding: 10px 12px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); }
.table th { background: #faf7f4; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

/* grid children default to min-width:auto, which lets wide tables blow out the page */
.split > * { min-width: 0; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
}

.form-control:focus { outline: 2px solid rgba(141,48,48,.25); border-color: var(--brand); }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px;
         background: rgba(245,158,11,.12); border-left: 4px solid #f59e0b; }
.alert-success { background: rgba(16,185,129,.14); border-left: 4px solid #10b981; }
.alert-error { background: rgba(239,68,68,.14); border-left: 4px solid #ef4444; }

.summary-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; color: #555; }
.summary-row.total { font-size: 17px; font-weight: 800; color: var(--text); border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 10px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-pending { background: #FEF3C7; color: #92400E; }
.pill-queue { background: #DBEAFE; color: #1E40AF; }
.pill-served { background: #D1FAE5; color: #065F46; }
.pill-done { background: #E5E7EB; color: #374151; }
.pill-cancelled { background: #FEE2E2; color: #991B1B; }

.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 700; }
/* promo form reuses .qty for layout; keep .btn sizing (2 classes beat .qty button) */
.qty .btn { width: auto; height: auto; border: 0; background: var(--brand); color: #fff; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 18px; }
.empty p { margin: 0; font-size: 14px; }
.empty-icon { font-size: 52px; line-height: 1; margin-bottom: 14px; opacity: .55; }

/* countdown badge next to section titles (mirrors app's CountdownTimer) */
.countdown {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #FFECEC;
  color: #D32F2F;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* visual payment picker (mirrors app's QRIS / Cash cards) */
.pay-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* .form-group label beats plain .pay-option on specificity — keep the flexbox */
.form-group .pay-option,
.pay-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 80px;
  padding: 0 12px;
  margin: 0;
  border: 1.5px solid var(--brand);
  border-radius: 16px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.pay-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pay-logo { display: block; height: 40px; width: auto; flex: 0 0 auto; }
.pay-option:nth-child(2) .pay-logo { height: 50px; }
.pay-option:has(input:checked) { background: var(--brand); color: #fff; }
.pay-option:focus-within { outline: 2px solid rgba(141,48,48,.35); outline-offset: 2px; }

/* Laravel paginator (Tailwind view, no Tailwind loaded) */
/* 5-star rating (mirrors app's post-order rating dialog) */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; justify-content: flex-end; }
.stars input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.stars label { font-size: 38px; line-height: 1; cursor: pointer; color: #E0E0E0; }
.stars input:checked ~ label,
.stars label:hover,
.stars label:hover ~ label { color: #F39C12; }
.stars input:focus-visible + label { outline: 2px solid rgba(141,48,48,.35); outline-offset: 2px; border-radius: 6px; }
.stars-static { color: #F39C12; letter-spacing: 2px; }

/* contenteditable/code blocks injected by third-party editors shouldn't blow out layout */
.panel img, .card img { max-width: 100%; }

@media (max-width: 700px) {
  .pay-options { gap: 12px; }
  .pay-option { height: 72px; padding: 0 8px; }
  .pay-logo { height: 32px; }
  .pay-option:nth-child(2) .pay-logo { height: 40px; }
}

@media (max-width: 420px) {
  .stars label { font-size: 32px; }
}

nav[role="navigation"] > div:first-child { display: none; }
nav[role="navigation"] span[aria-current="page"] > span,
nav[role="navigation"] a {
  display: inline-block;
  padding: 6px 11px;
  margin-right: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}
nav[role="navigation"] span[aria-current="page"] > span { background: var(--brand); color: #fff; border-color: var(--brand); }

@media (max-width: 1024px) {
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  /* single 62px row: brand left, hamburger right */
  .topbar-inner { gap: 10px; flex-wrap: nowrap; }
  .topbar .brand { font-size: 16px; flex-shrink: 0; margin-right: auto; }

  main { padding: 22px 0 52px; }
  .page-head h1 { font-size: 20px; }
  .section-title { margin: 28px 0 14px; }
  .section-title h2 { font-size: 16px; }

  .card-img { height: 180px; }
  .btn { padding: 11px 14px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-sm { padding: 8px 12px; min-height: 38px; }

  /* keep table columns readable, scroll inside the table only */
  .table th, .table td { white-space: nowrap; padding: 9px 10px; }
  .table td:first-child, .table th:first-child { white-space: normal; }

  .qty button { width: 38px; height: 38px; }
  .panel { padding: 15px; }
  .form-control { font-size: 16px; } /* prevents iOS zoom-on-focus */
}

/* tap targets >= 40px (topbar is 62px tall, so this fits at every width) */
.topbar nav a,
.topbar nav button,
.topbar nav .btn,
.topbar .brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

@media (max-width: 700px) {
  .page-head h1 { line-height: 1.25; }
  .grid { gap: 18px; }
  .card-body { padding: 16px; }
  .price { font-size: 17px; }

  /* --- hamburger toggle (label drives the hidden checkbox, no JS) --- */
  .nav-toggle-box {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
  }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 10px 8px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 10px;
  }
  .nav-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: var(--brand);
    transition: transform .2s ease, opacity .15s ease;
  }
  .nav-toggle-box:focus-visible ~ .nav-toggle { outline: 2px solid var(--brand); outline-offset: 2px; }
  .nav-toggle-box:checked ~ .nav-toggle span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .nav-toggle-box:checked ~ .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-toggle-box:checked ~ .nav-toggle span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

  /* nav drops down as a full-width panel under the topbar */
  .topbar nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 4px 16px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 30px rgba(0, 0, 0, .10);
    max-height: calc(100vh - 62px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .topbar nav::-webkit-scrollbar { display: none; width: 0; height: 0; }
  .nav-toggle-box:checked ~ nav { display: flex; }

  .topbar nav a {
    display: flex;
    width: 100%;
    min-height: 44px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
  }
  .topbar nav a:last-of-type { border-bottom: 0; }
  .topbar nav form { display: block !important; margin: 0; }
  .topbar nav form .btn {
    display: flex;
    width: 100%;
    min-height: 44px;
    justify-content: center;
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--brand);
  }
}

@media (max-width: 420px) {
  .topbar-inner { gap: 8px; }
  .topbar .brand { font-size: 15px; }
  .card-img { height: 160px; }
  .btn { padding: 10px 12px; font-size: 13px; }
}
