/* ORDERTRON – unified stylesheet (Landing / Order / Status / Monitor)
   Design: Schwarz als Akzent auf Weiß, clean & responsive
   Cleaned: zusammengefasst (Duplikate entfernt), Verhalten beibehalten.
*/

:root{
  --bg:#f6f7f9;
  --card:#ffffff;
  --text:#0b0f14;
  --muted:#6b7280;
  --line:#e5e7eb;

  --btn:#111111;
  --btnfg:#ffffff;

  --radius:18px;
  --radius-sm:14px;
  --shadow:0 18px 40px rgba(0,0,0,.08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color:var(--text);
  background:var(--bg);
}

.hidden{ display:none !important; }

/* -------------------------
   COMMON LAYOUT
--------------------------*/
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:#000;
  border-bottom:1px solid var(--line);
  padding:14px 16px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.brand{
  font-weight:900;
  letter-spacing:.4px;
  color:#fff;
}

.logo-group{
  display:flex;
  align-items:center;
  gap:10px;
}

.logo{
  max-width: 100%;
  max-height:30px;
}

.logotitle{
  font-size:15px;
  font-weight:900;
  padding: 0 0 0 0;
  color:#fff;
  text-align: center;
  line-height: 1;
}

.badge{
  font-size:20px;
  font-weight:bold;
  color:#fff;
}

.wrap{
  max-width:1100px;
  margin:0 auto;
  padding:18px 16px 28px;
}

.grid{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap:14px;
  align-items:start;
}

/* cards */
.card{
  background:var(--card);
  border:1px solid rgba(0,0,0,.08) !important;      /* (Hotfix) */
  border-radius:22px !important;                     /* (Hotfix) */
  box-shadow:0 18px 40px rgba(0,0,0,.08) !important; /* (Hotfix) */
}
#cartCard {
  background: #000;
  color: #fff;
}
#orderBtn {
  border: 1px solid #fff;
}
#cartLines {
  color: #000;
}
.hd{
  padding:14px 14px;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.bd{ padding:14px 14px; }
.small{ color:var(--muted); font-size:12px; }

/* -------------------------
   BUTTONS
--------------------------*/
.btn{
  appearance:none;
  border:1px solid transparent;
  background:#e9ecef;
  color:#111;
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:900;
  transition: filter .12s ease, transform .06s ease, background-color .12s ease, border-color .12s ease, color .12s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  user-select:none;
}
.btn:active{ transform: translateY(1px); }
.btn:hover{ filter:brightness(1.03); }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

/* primary */
.btn.primary{
  background:var(--btn);
  color:var(--btnfg);
  border-color:#000;
}

/* ghost (für "Leeren", "Aktualisieren", etc.) */
.btn.ghost{
  background:#fff;
  color:#111;
  border-color:var(--line);
}
.btn.ghost:hover{
  background:#f3f4f6;
  border-color:#d1d5db;
}

/* -------------------------
   ORDER PAGE – CATEGORY BAR + LIST
--------------------------*/
.hscroll{
  display:flex;
  gap:10px;
  padding:12px 14px 0;
  overflow:auto;
  scrollbar-width: thin;
}
.hscroll::-webkit-scrollbar{ height:8px; }
.hscroll::-webkit-scrollbar-thumb{ background:#d1d5db; border-radius:999px; }

.pill{
  border:0px solid rgba(0,0,0,.10) !important; /* (Hotfix) */
  background:#000 !important;                  /* (Hotfix) */
  color:#fff;
  border-radius:999px !important;              /* (Hotfix) */
  padding:8px 12px !important;                 /* (Hotfix) */
  cursor:pointer;
  text-decoration: none !important;
  font-weight:900 !important;                  /* (Hotfix) */
  white-space:nowrap;
}
.pill.active{
  background:#111 !important;
  color:#fff !important;
  border-color:#111 !important;
}

.list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* product list item (finale/effektive Styles inkl. Hotfix) */
.item{
  display:grid !important;
  grid-template-columns: 60px 1fr auto !important; /* (Hotfix) */
  gap:14px !important;                              /* (Hotfix) */
  align-items:center !important;                    /* (Hotfix) */

  background:#fff !important;
  border:1px solid rgba(0,0,0,.08) !important;
  border-radius:18px !important;
  padding:12px 14px !important;
  box-shadow:0 10px 22px rgba(0,0,0,.06) !important;
}

/* Nummern-Kachel links (01/02) */
.item .nr,
.nr{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  width:48px !important;
  height:48px !important;
  flex:0 0 48px !important;

  background:#111 !important;
  color:#fff !important;

  border-radius:14px !important;
  font-weight:900 !important;
  font-size:14px !important;
  line-height:1 !important;

  box-shadow:0 10px 22px rgba(0,0,0,.14) !important;
}

/* Alternative Nummern-Kachel (falls im HTML .sq genutzt wird) */
.item .sq{
  width:48px;
  height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#111;
  color:#fff;
  border-radius:14px;
  font-weight:900;
  box-shadow:0 10px 22px rgba(0,0,0,.14);
}

.item .title,
.title{
  font-weight:900 !important;
  font-size:16px !important;
  letter-spacing:.2px !important;
  line-height:1.2;
}

.sub{
  font-size:12px !important;
  color:#6b7280 !important;
  margin-top:3px;
}

.price{
  font-weight:900 !important;
  font-size:15px !important;
  white-space:nowrap;
  margin-right:10px !important;
}

/* Produktname fett (falls Meta-Struktur genutzt wird) */
.item .meta .name{ font-weight:900; }

/* generischer Name-Fallback (wird teils auch außerhalb .item verwendet) */
.name{ font-weight:bold; }

/* Plus-Button in Produktliste schick machen, egal was inline im HTML steht */
.item .btn.primary{
  width:42px !important;
  height:42px !important;
  padding:0 !important;
  border-radius:14px !important;
  font-size:18px !important;
  line-height:1;

  background:#111 !important;
  border:0 !important;
  box-shadow:0 10px 18px rgba(0,0,0,.12) !important;
}
.item .btn.primary:hover{ filter:brightness(1.06); }

/* -------------------------
   CART (legacy blocks + cartline layout)
--------------------------*/
#cartLines:empty::before{
  content:"Warenkorb ist leer.";
  color:var(--muted);
  font-size:13px;
}

.cart-empty{
  color:var(--muted);
  font-size:13px;
  margin:4px 0 10px;
}
.cart-items{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin:8px 0 12px;
}
.citem{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px 10px;
  background:#fff;
}
.citem-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.cname{ font-weight:900; }
.ctiny{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}
.cactions{
  display:flex;
  gap:8px;
  align-items:center;
}
.qbtn{
  width:34px;
  height:34px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  cursor:pointer;
  font-weight:900;
}
.qbtn:hover{ background:#f3f4f6; }
.delbtn{
  width:34px;
  height:34px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#f2f2f2;
  cursor:pointer;
  font-weight:900;
}
.delbtn:hover{ filter:brightness(0.98); }

.note{ margin-top:10px; }
.note label{
  font-weight:900;
  display:block;
  margin-bottom:8px;
}
textarea{
  width:100%;
  min-height:70px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  outline:none;
  resize:vertical;
  background:#fff;
}
textarea:focus{
  border-color:#cbd5e1;
  box-shadow:0 0 0 4px rgba(17,17,17,.06);
}

.sum{
  display:flex;
  justify-content:space-between;
  font-size:18px;
  font-weight:900;
  margin-top:10px;
}
/* =====================================
   Warenkorb – Cartline Layout (NEU)
   FIX: Preis + 🗑 oben rechts nebeneinander
===================================== */

#cartLines{
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* einzelne Produkt-Zeile */
.cartline{
  background:#fff;
  border-radius:18px;
  padding:16px;
  box-shadow:0 12px 30px rgba(0,0,0,.06);
  display:flex;
  flex-direction:column;
  gap:14px;
  position:relative;
}

/* linker Content-Block (Name/Sub/Qty) – Platz rechts freihalten für Preis+🗑 */
.cartline > div:first-child{
  padding-right:84px; /* verhindert Überlappung mit Preis/Trash */
  display:flex;
  flex-direction:column;
  gap:4px;
}

/* Produktname */
.cartline .cartname{
  font-weight:900;
  font-size:1rem;
}

/* Unterzeile */
.cartline .cartsub{
  font-size:.85rem;
  color:#6b7280;
  font-style:italic;
}

/* Preis oben rechts (steht im 2. div der cartline) */
.cartline > div:last-child{
  position:absolute;
  top:16px;
  right:56px;              /* Platz für 🗑 rechts lassen */
  font-weight:900;
  font-size:1rem;
  white-space:nowrap;
}

/* 🗑 Button oben rechts neben dem Preis (ist im .qty) */
.cartline .qty button[data-a="d"]{
  position:absolute;
  top:16px;
  right:16px;

  width:34px;
  height:34px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.15);
  background:#fff;
  font-size:14px;
  cursor:pointer;
  transition:all .15s ease;
  display:flex;
  align-items:center;
  justify-content:center;
}
.cartline .qty button[data-a="d"]:hover{
  background:#dc2626;
  color:#fff;
  border-color:#dc2626;
}

/* Mengensteuerung volle Breite (ohne 🗑 im Layout, weil absolute) */
.cartline .qty{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:10px;
  width:100% !important;
  margin-top:10px; /* optional, wirkt sauberer */
}

/* Minus & Plus breit */
.cartline .qty button[data-a="m"],
.cartline .qty button[data-a="p"]{
  height:30px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.15);
  background:#f3f4f6;
  font-size:20px;
  font-weight:900;
  cursor:pointer;
  transition:all .15s ease;
  display:flex;
  align-items:center;
  justify-content:center;
}
.cartline .qty button[data-a="m"]:hover,
.cartline .qty button[data-a="p"]:hover{
  background:#111;
  color:#fff;
  border-color:#111;
}

/* Zahl in der Mitte */
.cartline .qty div{
  height:30px;
  border-radius:10px;
  background:#111;
  color:#fff;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1rem;
}

/* Responsive */
@media (max-width:768px){
  .cartline{ padding:12px; }

  .cartline > div:first-child{
    padding-right:78px;
  }

  .cartline > div:last-child{
    top:12px;
    right:52px;
  }

  .cartline .qty button[data-a="d"]{
    top:12px;
    right:12px;
    width:32px;
    height:32px;
    border-radius:10px;
  }

  .cartline .qty{
    gap:8px;
  }

  .cartline .qty button[data-a="m"],
  .cartline .qty button[data-a="p"],
  .cartline .qty div{
    height:42px;
  }
}

/* -------------------------
   GENERIC MODAL (doneModal)
--------------------------*/
.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:9999;
}
.modal.on,
.modal.show{ display:flex; }

.modal .box{
  width:min(520px, 100%);
  background:#fff;
  border-radius:18px;
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal .box .mhd{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.modal .box .mbd{ padding:14px; }
.x{
  border:none;
  background:#fff;
  border:1px solid var(--line);
  width:34px;
  height:34px;
  border-radius:12px;
  cursor:pointer;
  font-weight:900;
}

/* -------------------------
   PRODUCT POPUP (pmodal)
   FIX: MUSS immer zentriert & über allem liegen
--------------------------*/
.pmodal{
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.45);
  z-index:999999;
  padding:16px;

  /* verhindert, dass der Inhalt "links oben" landet, wenn Eltern/Body weird sind */
  overflow:hidden;
}
.pmodal.hidden{ display:none !important; }

.pmodal .modal-card{
  width:min(560px, 100%);
  background:#fff;
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}

/* Head */
.pmodal .modal-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  padding:14px 14px;
  border-bottom:1px solid #eee;
}
.pmodal .modal-title{
  font-weight:900;
  font-size:1.1rem;
}
.pmodal .modal-sub{
  color:#666;
  font-size:.9rem;
  margin-top:2px;
}
.pmodal .icon-btn{
  border:1px solid #e5e7eb;
  background:#f8fafc;
  border-radius:10px;
  padding:8px 10px;
  cursor:pointer;
}
.pmodal .icon-btn:hover{ background:#eef2f7; }

/* Body */
.pmodal .modal-body{
  padding:14px 14px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.pmodal .section-title{
  font-weight:800;
  margin-bottom:8px;
}
.pmodal .chip-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.pmodal .chip{
  border:1px solid rgba(0,0,0,.18) !important; /* (Hotfix) */
  background:#fff !important;                  /* (Hotfix) */
  color:#111 !important;                       /* (Hotfix) */
  border-radius:999px;
  padding:8px 12px;
  font-weight:800 !important;                  /* (Hotfix) */
  cursor:pointer;
  transition: all .15s ease;
}
.pmodal .chip:hover{ background:#f3f4f6; }

.pmodal .chip.active,
.pmodal .chip.selected,
.pmodal .chip.is-active,
.pmodal .chip[aria-pressed="true"]{
  background:#111 !important;
  color:#fff !important;
  border-color:#111 !important;
  box-shadow:0 10px 22px rgba(0,0,0,.18) !important;
}

.pmodal .chip.active:hover,
.pmodal .chip.selected:hover,
.pmodal .chip.is-active:hover,
.pmodal .chip[aria-pressed="true"]:hover{
  filter:brightness(1.06);
}

.pmodal .hint{
  color:#666;
  font-size:.85rem;
  margin-top:-4px;
  margin-bottom:8px;
}
.pmodal .qty-row{
  display:flex;
  align-items:center;
  gap:10px;
}
.pmodal .qty-btn{
  width:44px;
  height:38px;
  border-radius:10px;
  border:1px solid #ddd;
  background:#fff;
  font-size:20px;
  cursor:pointer;
}
.pmodal .qty-btn:hover{ background:#f3f4f6; }
.pmodal .qty-val{
  min-width:40px;
  text-align:center;
  font-weight:900;
  font-size:1.1rem;
}

/* Footer */
.pmodal .modal-foot{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  border-top:1px solid #eee;
  gap:10px;
}
.pmodal .modal-price{
  font-weight:900;
  font-size:1.1rem;
  white-space:nowrap;
}

/* -------------------------
   MONITOR (Küchenmonitor)
--------------------------*/
.kitchen-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height:220px;
}
.kh{
  padding:12px 14px;
  color:#fff;
  font-weight:900;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}
.kb{ padding:14px; }
.kf{
  padding:12px 14px;
  border-top:1px solid var(--line);
  background:#fff;
}
.kitchen-items{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.kitchen-item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:10px 10px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}
.kitchen-item b{ font-weight:900; }

/* -------------------------
   RESPONSIVE
--------------------------*/
@media (max-width: 900px){
  .grid{ grid-template-columns: 1fr; }
  #cartCard{ display:block; } /* Warenkorb rechts ausblenden, weil FAB genutzt wird */
  .wrap{ padding-bottom:120px; }
}

/* Extra-small tweaks (bleibt drin; wird teils durch spätere !important-Regeln übersteuert – wie im Original) */
@media (max-width: 520px){
  .pmodal{ padding:12px; }
  .pmodal .modal-card{ max-height:85vh; }
  .pmodal .modal-body{ overflow:auto; max-height:55vh; }

  .item{ grid-template-columns:48px 1fr; }
  .item > div:last-child{
    grid-column:1 / -1;
    display:flex;
    justify-content:flex-end;
    gap:10px;
    padding-top:6px;
  }
}

/* -------------------------
   MOBILE WARENKORB-FAB
--------------------------*/
/* FAB ist (Hotfix) grundsätzlich sichtbar */
.fab{
  display:block;
  position:fixed;
  z-index:2000;
  pointer-events:none; /* nur die Controls klickbar */
}

/* Controls immer klickbar (egal ob Button/Link oder .btn) */
.fab .btn,
.fab button,
.fab a{ pointer-events:auto; }

/* Optik vom Button (egal wie er im HTML heißt) */
.fab button,
.fab a,
.fab .btn{
  background:#111;
  color:#fff;
  border:0;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 18px 40px rgba(0,0,0,.18);
}

.fab button:hover,
.fab a:hover,
.fab .btn:hover{ filter:brightness(1.05); }
.fab button:active,
.fab a:active,
.fab .btn:active{ transform: translateY(1px); }

/* Desktop: klein unten rechts */
@media (min-width: 901px){
  .fab{
    right:18px;
    left:auto;
    bottom:18px;
    transform:none;
    width:auto;
    max-width:none;
  }
  .fab button,
  .fab a,
  .fab .btn{
    width:auto;
    min-width:180px;
    height:48px;
    padding:0 16px;
    border-radius:999px;
  }
}

/* Mobile/Tablet: breit unten mittig */
@media (max-width: 900px){
  .fab{
    left:50%;
    right:auto;
    bottom:18px;
    transform:translateX(-50%);
    width:min(560px, calc(100% - 28px));
  }
  .fab button,
  .fab a,
  .fab .btn{
    width:100%;
    height:54px;
    border-radius:16px;
    font-size:16px;
  }
  .logotitle{
    font-size:20px;
    font-weight:900;
    padding: 0 0 3px 0;
    color:#fff;
  }
  #logotitlebound {
    display: ;
  }
}

/* ===============================
   Tisch-Zwang Overlay + QR Scan UI
   =============================== */
/* ===========================
   TABLE GATE (QR Pflicht Popup)
   =========================== */
#tableGate{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
}

#tableGate.hidden{ display:none !important; }

#tableGate .tg-card{
  width: min(520px, 100%);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.08);
}

#tableGate .tg-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

#tableGate .tg-title{
  font-weight: 900;
  font-size: 1.05rem;
}

#tableGate .tg-x{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
#tableGate .tg-x:hover{ background:#f3f4f6; }

#tableGate .tg-body{
  padding: 14px 16px 16px;
  display:flex;
  flex-direction: column;
  gap: 12px;
}

#tableGate .tg-text{
  color: #111;
  line-height: 1.35;
}

#tableGate .tg-btn{
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 900;
  background: #111;
  color: #fff;
  box-shadow: 0 12px 26px rgba(0,0,0,.18);
}
#tableGate .tg-btn:hover{ filter: brightness(1.06); }

#tableGate .tg-hint{
  color:#666;
  font-size: .9rem;
  line-height: 1.35;
}

@media (max-width: 520px){
  #tableGate .tg-card{ border-radius: 16px; }
  #tableGate .tg-title{ font-size: 1rem; }
}

/* QR Cam Overlay */
#qrCam{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1000000;
  padding:16px;
}
#qrCam .qrc-card{
  width:min(560px, 100%);
  background:#fff;
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}
#qrCam .qrc-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px;
  border-bottom:1px solid #eee;
}
#qrCam .qrc-title{ font-weight:900; }
#qrCam .qrc-x{
  border:1px solid rgba(0,0,0,.12);
  background:#f3f4f6;
  border-radius:10px;
  width:36px;
  height:36px;
  cursor:pointer;
  font-weight:900;
}
#qrCam .qrc-body{ padding:14px; display:flex; flex-direction:column; gap:10px; }
#qrcVideo{
  width:100%;
  border-radius:16px;
  background:#111;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
#qrCam .qrc-note{ color:#6b7280; font-size:.9rem; }
