:root {
  --green: #5f6f2f;
  --green-dark: #26351d;
  --dark: #172313;
  --orange: #c99a2e;
  --red: #b3261e;
  --line: #ddd8c7;
  --soft: #f3efe3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(201, 154, 46, .14), transparent 32rem),
    var(--soft);
  color: #111827;
}

body.rtl {
  direction: rtl;
}

body.rtl .product,
body.rtl .order-start-options button,
body.rtl .cart-line,
body.rtl input,
body.rtl textarea {
  text-align: right;
}

body.rtl .product-meta,
body.rtl .cart-line,
body.rtl .confirm-line,
body.rtl .total-row {
  direction: rtl;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled,
button.disabled {
  cursor: not-allowed;
  opacity: .52;
  filter: grayscale(.25);
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--dark);
  color: white;
}

.top h1 { margin: 0; font-size: clamp(20px, 3vw, 28px); line-height: 1; }
.top p { margin: 4px 0 0; color: #cbd5e1; font-size: 14px; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.language-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 249, 234, .12);
  border: 1px solid rgba(255, 249, 234, .22);
}

.language-switch button {
  min-width: 36px;
  min-height: 34px;
  padding: 0 7px;
  border-radius: 999px;
  background: transparent;
  color: #fff9ea;
  font-size: 18px;
  font-weight: 950;
}

.language-switch button.active {
  background: #fff9ea;
  color: #172313;
}

.history-link,
.qr-link {
  color: white;
  background: var(--orange);
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 900;
}

.history-link {
  background: #fff9ea;
  color: var(--green-dark);
}

.order-start {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(15, 23, 42, .46);
}

.order-start-card {
  width: min(560px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 14px;
  background: white;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.order-start-card small {
  color: var(--green-dark);
  font-weight: 950;
  text-transform: uppercase;
}

.order-start-card h2 {
  margin: 0;
  font-size: clamp(26px, 6vw, 38px);
  line-height: 1;
}

.order-start-card p {
  margin: 0;
  color: #475569;
  font-weight: 800;
}

.language-chooser {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5dcc3;
}

.language-chooser h2,
.language-chooser p {
  margin: 0;
}

.language-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.language-options button {
  min-height: 54px;
  border-radius: 12px;
  background: #fffdf5;
  color: #172313;
  border: 1px solid #d8ccb0;
  font-size: 15px;
  font-weight: 950;
}

.language-options button.active {
  background: #172313;
  color: #fff9ea;
}

.language-pending .order-start-card > small,
.language-pending .order-start-card > h2,
.language-pending .order-start-card > p,
.language-pending .order-start-options {
  display: none;
}

.language-pending .language-chooser {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.order-start-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.order-start-options button {
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 13px;
  text-align: left;
  background: #ecfdf5;
  color: var(--green-dark);
  border: 2px solid #cde7df;
  border-radius: 12px;
}

.order-start-options button:first-child {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.order-start-options strong {
  font-size: 20px;
  line-height: 1;
}

.order-start-options span {
  color: inherit;
  opacity: .82;
  font-size: 13px;
  font-weight: 850;
}

.layout {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 10px;
  padding: 10px;
}

.catalog, .cart {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.catalog { min-height: calc(100vh - 82px); }

.store-notice {
  margin: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #fff1f2;
  color: var(--red);
  font-weight: 900;
  border: 1px solid #fecdd3;
}

.staff-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  align-items: end;
  gap: 10px;
  margin: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #111827;
  color: white;
}

.staff-panel strong {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.staff-panel span {
  display: block;
  margin-top: 4px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
}

.staff-panel label {
  margin: 0;
  color: #cbd5e1;
  font-size: 11px;
  text-transform: uppercase;
}

.staff-panel input {
  margin-top: 4px;
  padding: 8px;
}

.staff-panel button {
  background: #fee2e2;
  color: #991b1b;
}

.staff-mode .top { background: #172313; }
.staff-mode .submit { background: #5f6f2f; }

.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

button {
  border: 0;
  background: #eee6cf;
  color: var(--green-dark);
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 900;
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.categories button {
  min-width: max-content;
  display: flex;
  align-items: center;
  gap: 8px;
}

.categories small {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .08);
}

button.active, .submit { background: var(--green); color: white; }

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 8px;
  padding: 8px;
}

.product {
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 0;
  border: 1px solid var(--line);
  border-top: 5px solid var(--green);
  border-radius: 8px;
  background: white;
  text-align: left;
  color: #111827;
  overflow: hidden;
}

.product-media {
  height: 88px;
  flex: 0 0 88px;
  display: grid;
  place-items: center;
  background: #f8fbfa;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.product-media span {
  font-size: 28px;
  color: var(--green);
  font-weight: 900;
}

.product-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
  border-top: 1px solid #edf4f1;
  background: white;
}
.product strong { display: block; min-height: 38px; line-height: 1.18; font-size: 14px; }

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.product-meta span { color: var(--green); font-size: 16px; font-weight: 950; }
.product-meta em {
  font-style: normal;
  background: #111827;
  color: white;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 12px;
}

.cart {
  position: sticky;
  top: 74px;
  align-self: start;
  padding: 10px;
}

.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 18px;
}

.cart-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-head span,
.cart-toggle em {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--dark);
  color: white;
  font-weight: 900;
}

.cart-close,
.cart-toggle,
.cart-backdrop {
  display: none;
}

.order-mode {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.order-mode span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.order-type { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.order-type button { padding: 10px 8px; font-size: 13px; }
.group-order {
  margin: 0 0 8px;
}
.group-toggle {
  width: 100%;
  padding: 10px;
  background: #111827;
  color: white;
}
.group-toggle.active {
  background: var(--orange);
  color: #111827;
}
.group-panel {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
}
.group-panel small {
  color: #9a3412;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}
.group-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.group-people button {
  padding: 7px 9px;
  border-radius: 999px;
  background: #fffdf5;
  color: #6f541d;
  border: 1px solid #d8ccb0;
  font-size: 12px;
}
.group-people button.active {
  background: #172313;
  color: #fff9ea;
  border-color: #172313;
}
.group-people .group-add-quick {
  background: #eee6cf;
  color: var(--green-dark);
  border-color: #d8ccb0;
}
.group-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}
.group-add input {
  margin: 0;
  padding: 8px;
}
.group-add button {
  padding: 8px 10px;
  background: var(--green);
  color: white;
  font-size: 12px;
}
.pickup-details {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
}
.pickup-details input {
  text-transform: none;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
}
.table-picker {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}
.table-picker > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.table-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.table-buttons button {
  display: grid;
  gap: 1px;
  padding: 7px 4px;
  background: #f1f5f9;
  color: #0f172a;
}
.table-buttons button.active {
  background: var(--green);
  color: white;
}
.table-buttons strong { font-size: 16px; line-height: 1; }
.table-buttons small { font-size: 9px; line-height: 1; }
.cart-items { margin: 8px 0; max-height: 210px; overflow: auto; }

.cart-person-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 8px 0 2px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #111827;
  color: white;
  font-size: 12px;
  font-weight: 950;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line span { color: #64748b; font-size: 13px; }
.cart-line button { padding: 8px 10px; color: var(--red); background: #ffebee; }
.cart-line-main {
  min-width: 0;
}
.cart-person-pill {
  display: inline-block;
  margin-bottom: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
}
.cart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.cart-actions button {
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 950;
}
.cart-actions .cart-upgrade {
  background: #fff4d6;
  color: #7a4b00;
  border: 1px solid #d8ccb0;
}
.cart-actions .cart-size {
  background: #eee6cf;
  color: var(--green-dark);
  border: 1px solid #d8ccb0;
}
.cart-remove {
  align-self: start;
}

.quick-cart-add {
  margin: 8px 0 10px;
  padding: 8px;
  border: 1px solid #e5dcc3;
  border-radius: 10px;
  background: #fff9ea;
}

.quick-cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: #26351d;
}

.quick-cart-head strong {
  font-size: 13px;
  font-weight: 950;
}

.quick-cart-head span {
  color: #6b7280;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-cart-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.quick-cart-buttons button {
  min-height: 86px;
  padding: 6px 5px 7px;
  border: 1px solid #d8ccb0;
  border-radius: 9px;
  background: #fffdf5;
  color: #172313;
  display: grid;
  place-items: center;
  gap: 3px;
}

.quick-cart-media {
  width: 100%;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: #f4ead6;
}

.quick-cart-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
}

.quick-cart-buttons em {
  min-width: 32px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #172313;
  color: #fff9ea;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
}

.quick-cart-buttons span {
  color: #26351d;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.05;
}

.quick-cart-buttons strong {
  color: #5f6f2f;
  font-size: 11px;
  font-weight: 950;
}

.confirm-person {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #111827;
  color: white;
  font-size: 12px;
  font-weight: 950;
}

label { display: block; margin-top: 9px; font-weight: 900; }
.customer-name {
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
}
.customer-name input {
  text-transform: none;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
}

.loyalty-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin: 8px 0;
  padding: 9px;
  border: 1px solid #b2dfdb;
  border-radius: 10px;
  background: #f0fdfa;
}

.loyalty-panel small {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.loyalty-panel strong {
  display: block;
  color: var(--green-dark);
  font-size: 18px;
}

.loyalty-panel span {
  display: block;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.loyalty-login {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.loyalty-login input {
  margin: 0;
  padding: 8px;
}

.loyalty-login button,
.loyalty-panel > button {
  padding: 8px 10px;
  font-size: 13px;
}

input, textarea {
  width: 100%;
  margin-top: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

textarea { min-height: 52px; resize: vertical; }
.hidden { display: none !important; }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 20px;
}

.submit { width: 100%; font-size: 17px; padding: 12px; }
.status { min-height: 24px; font-weight: 900; color: var(--green); }
.status.error { color: var(--red); }

.tracker {
  margin-top: 10px;
  border: 2px solid var(--green);
  border-radius: 10px;
  padding: 12px;
  background: #f0fdfa;
}

.tracker[data-status="rejected"] { border-color: var(--red); background: #fff1f2; }
.tracker[data-status="new"] { border-color: var(--orange); background: #fff7ed; }
.tracker[data-status="ready"] { border-color: var(--orange); background: #fff7ed; }
.tracker[data-status="expired"] { border-color: var(--red); background: #fff1f2; }
.tracker[data-status="done"] { border-color: #64748b; background: #f8fafc; }
.tracker small { color: #64748b; font-weight: 900; text-transform: uppercase; }
.tracker h2 { margin: 4px 0; font-size: 34px; letter-spacing: 1px; }
.tracker p { margin: 0 0 8px; color: #334155; }
.tracker span { font-weight: 900; color: var(--green-dark); }
.tracker button { margin-top: 10px; padding: 8px 10px; }

.waiting .top,
.waiting .layout,
.waiting .cart-toggle,
.waiting .cart-backdrop {
  display: none;
}

.wait-screen {
  min-height: 100vh;
  padding: 16px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, #172313 0 34%, #f3efe3 34% 100%);
}

.wait-card {
  width: min(620px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-top: 6px solid var(--green);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .22);
}

.wait-screen[data-status="new"] .wait-card { border-top-color: var(--orange); }
.wait-screen[data-status="ready"] {
  background: linear-gradient(180deg, #26351d 0 42%, #f3efe3 42% 100%);
}
.wait-screen[data-status="ready"] .wait-card {
  border-top-color: #22c55e;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .22);
}
.wait-screen[data-status="ready"] .wait-card h2 {
  color: #5f6f2f;
  font-size: clamp(44px, 11vw, 78px);
}
.wait-screen[data-status="expired"] .wait-card { border-top-color: var(--red); }
.wait-screen[data-status="rejected"] .wait-card { border-top-color: var(--red); }
.wait-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wait-card small {
  color: #64748b;
  font-weight: 950;
  text-transform: uppercase;
}
.wait-status-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: #eee6cf;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 950;
}
.wait-screen[data-status="new"] .wait-status-pill { background: #fff4d6; color: #7a4b00; }
.wait-screen[data-status="ready"] .wait-status-pill { background: #eee6cf; color: #26351d; }
.wait-screen[data-status="rejected"] .wait-status-pill,
.wait-screen[data-status="expired"] .wait-status-pill { background: #fee2e2; color: #991b1b; }
.wait-card h2 {
  margin: 8px 0 4px;
  font-size: clamp(38px, 9vw, 58px);
  line-height: 1;
  color: #172313;
}
.wait-card p {
  margin: 0 0 12px;
  color: #334155;
  font-size: 17px;
}
.wait-meta {
  padding: 11px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--green-dark);
  font-weight: 900;
}
.wait-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.wait-step {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 58px;
  padding: 7px 5px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  text-align: center;
}
.wait-step span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  font-weight: 950;
}
.wait-step strong {
  font-size: 12px;
  line-height: 1;
}
.wait-step.active {
  border-color: #d8ccb0;
  background: #eee6cf;
  color: var(--green-dark);
}
.wait-step.active span {
  background: var(--green);
  color: #fff9ea;
}
.wait-step.current {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}
.wait-step.danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #991b1b;
}
.wait-step.danger span {
  background: var(--red);
  color: white;
}
.wait-alert-help {
  margin: 10px 0 0 !important;
  padding: 10px;
  border-radius: 12px;
  background: #fff4d6;
  color: #7a4b00 !important;
  font-size: 14px !important;
  font-weight: 900;
}
.wait-items {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.payment-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.payment-actions button {
  width: 100%;
  background: #172313;
  color: #fff9ea;
}
.wait-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fffdf5;
}
.wait-line span {
  flex: 0 0 auto;
  color: #92400e;
  font-weight: 900;
}
.wait-line.ready {
  background: #f5ecd0;
  border-color: #d8ccb0;
}
.wait-line.ready span { color: var(--green-dark); }
.wait-line.muted { color: #64748b; }
.wait-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.wait-actions button {
  width: 100%;
  background: #e2e8f0;
  color: #0f172a;
}
.wait-actions .alert-button {
  background: var(--orange);
  color: white;
}
.wait-actions .alert-button.enabled {
  background: var(--green);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.45);
  padding: 14px;
}

.modal-card {
  width: min(880px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: white;
  border-radius: 10px;
  padding: 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}

.staff-gate-card {
  width: min(430px, 100%);
}

.staff-gate-card p {
  color: #334155;
  font-weight: 800;
}

.history-card { width: min(720px, 100%); }

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.history-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: #64748b;
  font-weight: 800;
  text-align: center;
}

.history-order {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 7px solid var(--green);
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}

.history-order[data-status="new"] { border-left-color: var(--orange); }
.history-order[data-status="ready"] { border-left-color: var(--orange); }
.history-order[data-status="expired"] { border-left-color: var(--red); background: #fff1f2; }
.history-order[data-status="rejected"] { border-left-color: var(--red); }
.history-order[data-status="done"] { border-left-color: #64748b; }

.history-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.history-main strong { font-size: 18px; color: #111827; }
.history-main span { color: var(--green-dark); font-weight: 900; }
.history-main small { color: #64748b; font-weight: 800; }
.history-main p {
  margin: 0;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-actions {
  display: grid;
  gap: 8px;
}

.history-actions button { padding: 9px 12px; }
.history-actions [data-action="track"] { background: #f1f5f9; color: #0f172a; }
.history-clear {
  width: 100%;
  margin-top: 12px;
  background: #ffebee;
  color: var(--red);
}

.profile-card { width: min(700px, 100%); }
.profile-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 8px;
  align-items: end;
}
.profile-login label {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
}
.profile-login input {
  text-transform: none;
  color: #111827;
  font-size: 16px;
  font-weight: 850;
}
.profile-login button {
  min-height: 40px;
  background: var(--green);
  color: white;
}
.profile-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.profile-summary article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.profile-summary small {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}
.profile-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--green-dark);
  font-size: 26px;
  line-height: 1;
}
.profile-reward {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #b2dfdb;
  border-radius: 12px;
  background: #f0fdfa;
}
.profile-reward-head,
.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.profile-reward-head strong {
  color: #0f172a;
  font-size: 18px;
}
.profile-reward-head span {
  color: var(--green-dark);
  font-weight: 950;
}
.profile-progress {
  height: 12px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}
.profile-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}
.profile-reward p {
  margin: 0;
  color: #334155;
  font-weight: 800;
}
.profile-history {
  margin-top: 14px;
}
.profile-section-head h3 {
  margin: 0;
  font-size: 18px;
}
.profile-section-head button {
  padding: 8px 10px;
  background: #111827;
  color: white;
}
.profile-orders {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}
.profile-order {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--green);
  border-radius: 10px;
  background: white;
}
.profile-order[data-status="new"] { border-left-color: var(--orange); }
.profile-order[data-status="ready"] { border-left-color: var(--orange); }
.profile-order[data-status="rejected"],
.profile-order[data-status="expired"] { border-left-color: var(--red); }
.profile-order strong {
  display: block;
  font-size: 17px;
}
.profile-order span {
  display: block;
  margin-top: 2px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
}
.profile-order p {
  margin: 3px 0 0;
  color: #475569;
  font-size: 13px;
  font-weight: 750;
}
.profile-order button {
  padding: 9px 12px;
}

.confirm-card { width: min(620px, 100%); }
  .confirm-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.confirm-actions button {
  width: 100%;
  font-size: 16px;
  padding: 12px;
}
  .online-pay {
    background: #111827;
    color: white;
  }
  .redsys-pay {
    background: #167346;
  }
.confirm-summary {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
.confirm-meta,
.confirm-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}
.confirm-meta {
  flex-wrap: wrap;
  color: #334155;
  font-weight: 900;
}
.confirm-lines {
  display: grid;
  gap: 8px;
}
.confirm-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.confirm-line small {
  grid-column: 1 / -1;
  color: #64748b;
  font-weight: 700;
}
.confirm-line span,
.confirm-total strong {
  color: var(--green-dark);
  font-weight: 950;
}
.confirm-note,
.confirm-help {
  margin: 0;
  color: #475569;
  font-weight: 800;
}
.confirm-help {
  padding: 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
}

.modal-head, .qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: -14px -14px 10px;
  padding: 12px 14px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0;
  font-size: 24px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.modal-save {
  background: var(--green);
  color: white;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 950;
}
.modal-actions #closeModal {
  width: 42px;
  min-height: 42px;
  padding: 0;
  background: #ffebee;
  color: var(--red);
}
.qty-row {
  justify-content: center;
  width: max-content;
  max-width: 100%;
  margin: 8px auto 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4ecd8;
}
.qty-row button {
  width: 46px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  font-size: 20px;
  background: #e5dcc3;
  color: var(--green-dark);
}
.qty-row strong {
  min-width: 46px;
  text-align: center;
  font-size: 22px;
}

.modifier-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.group h3 { margin: 0 0 8px; font-size: 15px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.options button { padding: 8px; min-height: 38px; }
.options button.selected { background: var(--green); color: white; }
.options .quick-option {
  grid-column: 1 / -1;
  background: #111827;
  color: white;
  font-weight: 950;
}

/* Akram olive refresh */
.top,
.staff-mode .top {
  background: #172313;
  color: #fff9ea;
}

.top p {
  color: #e4dbc0;
}

.history-link {
  background: #fff9ea;
  color: #26351d;
}

.qr-link {
  background: #c99a2e;
  color: #172313;
}

.catalog,
.cart,
.product,
.modal-card,
.qr-card,
.tracker,
.wait-card {
  background: #fffdf5;
  border-color: #ddd8c7;
}

.cart,
.modal-card,
.qr-card,
.wait-card,
.order-start-card {
  box-shadow: 0 18px 45px rgba(23, 35, 19, .12);
}

.categories {
  background: #fff9ea;
}

.categories button,
button,
.history-actions [data-action="track"],
.wait-actions button {
  background: #eee6cf;
  color: #26351d;
}

button.active,
.submit,
.modal-save,
.loyalty-login button,
.profile-login button,
.order-start-options button:first-child {
  background: #5f6f2f;
  color: #fff9ea;
}

.online-pay,
.payment-actions button,
.group-toggle,
.profile-section-head button {
  background: #172313;
  color: #fff9ea;
}

.product {
  background: #fffdf5;
}

.product-media {
  background: #fbf7e9;
}

.product-body {
  background: #fffdf5;
  border-top-color: #ebe3cb;
}

.product-meta span,
.total-row strong,
.profile-summary strong,
.loyalty-panel strong,
.confirm-line span,
.confirm-total strong,
.history-main span,
.profile-order span,
.tracker span {
  color: #5f6f2f;
}

.product-meta em,
.cart-head span,
.cart-toggle em {
  background: #172313;
  color: #fff9ea;
}

.cart-toggle {
  background: #172313;
  color: #fff9ea;
}

.cart-toggle em {
  background: #c99a2e;
  color: #172313;
}

.order-start {
  background: rgba(23, 35, 19, .62);
}

.order-start-card {
  background: #fff9ea;
}

.order-start-options button {
  background: #f8f2df;
  color: #26351d;
  border-color: #ddd8c7;
}

.store-notice,
.confirm-help,
.wait-alert-help {
  background: #fff4d6;
  border-color: #ead394;
  color: #7a4b00 !important;
}

.loyalty-panel,
.profile-reward {
  border-color: #d2ba75;
  background: linear-gradient(135deg, #fff9ea, #f5ecd0);
}

.profile-summary article,
.profile-order,
.history-order,
.confirm-line,
.confirm-meta,
.confirm-total,
.wait-meta,
.wait-step,
.wait-line {
  background: #fffdf5;
  border-color: #ddd8c7;
}

.profile-progress,
.reward-card div {
  background: #e8ddbd;
}

.profile-progress span {
  background: #5f6f2f;
}

input,
textarea {
  border-color: #d6cfba;
  background: #fffdf5;
  color: #172313;
}

input:focus,
textarea:focus {
  outline: 3px solid rgba(201, 154, 46, .25);
  border-color: #c99a2e;
}

.modal {
  background: rgba(23, 35, 19, .58);
}

.modal-card {
  background: #fff9ea;
  border: 1px solid #ddd8c7;
}

.modal-head {
  background: #fff9ea;
  border-bottom-color: #ddd8c7;
}

.modal-head h2 {
  color: #172313;
}

.modal-actions #closeModal,
.modal-head > button,
.cart-close {
  background: #f7ded9;
  color: #9f1d17;
}

.qty-row {
  border-color: #d8ccb0;
  background: #f4ecd8;
}

.qty-row button {
  background: #e5dcc3;
  color: #26351d;
}

.qty-row strong {
  color: #172313;
}

.group {
  border-color: #d8ccb0;
  background: #fffdf5;
}

.group h3 {
  color: #26351d;
}

.options button {
  background: #eee6cf;
  color: #26351d;
  border: 1px solid transparent;
}

.options button.selected {
  background: #5f6f2f;
  color: #fff9ea;
  border-color: #4b5b23;
}

.options .quick-option {
  background: #172313;
  color: #fff9ea;
}

.modal #itemNote {
  background: #fffdf5;
  border-color: #d8ccb0;
}

.wait-screen {
  background:
    linear-gradient(180deg, #172313 0 34%, #f3efe3 34% 100%);
}

.wait-screen[data-status="ready"] {
  background:
    linear-gradient(180deg, #26351d 0 42%, #f3efe3 42% 100%);
}

.wait-status-pill,
.wait-step.active {
  background: #efe8d4;
  color: #26351d;
}

.wait-step.active span {
  background: #5f6f2f;
  color: #fff9ea;
}

.qr-page {
  background:
    radial-gradient(circle at top, rgba(201, 154, 46, .18), transparent 30rem),
    #f3efe3;
}

.qr-card h1 {
  color: #172313;
}

.qr-page { display: grid; min-height: 100vh; place-items: center; padding: 18px; }
.qr-card {
  text-align: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
}
.qr-card img { width: 320px; max-width: 90vw; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .cart { position: sticky; top: 58px; z-index: 4; order: -1; }
  .catalog { min-height: 0; }
  .cart-items { max-height: 130px; }
}

@media (max-width: 680px) {
  .top { padding: 10px 12px; }
  .top p { display: none; }
  .top-actions { gap: 6px; }
  .history-link, .qr-link { padding: 9px 10px; font-size: 13px; }
  .order-start {
    padding: 10px;
    align-items: start;
    padding-top: 74px;
  }
  .order-start-card {
    padding: 14px;
    gap: 10px;
  }
  .order-start-options {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .order-start-options button {
    min-height: 72px;
    padding: 11px;
  }
  .order-start-options strong {
    font-size: 19px;
  }
  .staff-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 6px;
  }
  .layout { padding: 6px 6px 78px; gap: 6px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 6px; }
  .product { min-height: 188px; }
  .product-media { height: 102px; flex-basis: 102px; }
  .product-media img { padding: 5px; }
  .product-body { padding: 8px; gap: 7px; }
  .product strong { min-height: 40px; font-size: 13px; line-height: 1.2; }
  .product-meta { margin-top: 0; }
  .product-meta span { font-size: 15px; }
  .cart {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    top: auto;
    z-index: 40;
    max-height: calc(100dvh - 16px);
    overflow: auto;
    padding: 10px;
    border-radius: 12px;
    transform: translateY(calc(100% + 18px));
    opacity: 0;
    pointer-events: none;
    transition: transform .18s ease, opacity .18s ease;
  }
  .cart-open .cart {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .cart-open { overflow: hidden; }
  .cart-head { margin-bottom: 6px; font-size: 16px; }
  .cart-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: #ffebee;
    color: #c62828;
  }
  .cart-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(15, 23, 42, .45);
  }
  .cart-open .cart-backdrop { display: block; }
  .cart-toggle {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--dark);
    color: white;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .24);
  }
  .cart-open .cart-toggle { display: none; }
  .cart-toggle span,
  .cart-toggle strong {
    text-align: left;
    color: white;
  }
  .cart-toggle em {
    min-width: 32px;
    height: 32px;
    background: var(--orange);
    color: white;
    font-style: normal;
  }
  .cart-items { max-height: 96px; margin: 6px 0; }
  .cart-line { padding: 6px 0; }
  .table-buttons { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  textarea { min-height: 42px; }
  .total-row { font-size: 18px; }
  .submit { padding: 10px; font-size: 16px; }
  .status { min-height: 18px; margin: 6px 0; font-size: 13px; }
  .modifier-groups { grid-template-columns: 1fr; }
  .modal {
    padding: 8px;
    align-items: start;
  }
  .modal-card {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 8px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-radius: 12px;
  }
  .modal-head {
    margin: -8px -8px 6px;
    padding: 9px 10px;
  }
  .modal-head h2 {
    font-size: 17px;
    line-height: 1.12;
  }
  .modal-save {
    min-height: 36px;
    padding: 0 11px;
    font-size: 14px;
    white-space: nowrap;
  }
  .modal-actions #closeModal {
    width: 36px;
    min-height: 36px;
  }
  .qty-row {
    margin: 5px auto;
    padding: 3px;
  }
  .qty-row button {
    width: 44px;
    height: 34px;
  }
  .qty-row strong {
    min-width: 42px;
    font-size: 21px;
  }
  .group {
    padding: 7px;
  }
  .group h3 {
    margin-bottom: 6px;
  }
  .options {
    gap: 5px;
  }
  .options button {
    min-height: 36px;
    padding: 7px;
  }
  .history-order { grid-template-columns: 1fr; gap: 10px; }
  .history-actions { grid-template-columns: 1fr 1fr; }
  .profile-login,
  .profile-summary,
  .profile-order {
    grid-template-columns: 1fr;
  }
  .profile-login button,
  .profile-section-head button,
  .profile-order button {
    width: 100%;
  }
  .profile-section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .wait-card { padding: 18px; }
  .wait-card h2 { font-size: 36px; }
}
