@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;800;900&display=swap");

:root{
  --header-h: 96px;
  --cat-h: 52px;
}

/* GLOBAL */
*{box-sizing:border-box}
html,body{margin:0;padding:0;overflow-x:hidden}
body{
  background:#121212;
  color:#fff;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  padding-bottom:110px; /* مساحة للـ order bar */
}
a{color:inherit;text-decoration:none}
button{font-family:inherit}

/* HEADER (SCROLLS AWAY) */
.header{
  position:relative;
  height:var(--header-h);
  background:#121212;
  border-bottom:1px solid #2a2a2a;
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:10;
}
.logo{height:64px;width:auto}

/* Language switch (right) */
#langSwitch{
  position:absolute;
  top:16px;
  right:14px;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(0,0,0,.25);
  color:#fff;
  font-weight:800;
  font-size:12px;
  cursor:pointer;
  direction:ltr;
}

/* Comment button (left) */
#commentBtn{
  position:absolute;
  top:16px;
  left:14px;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(0,0,0,.25);
  color:#fff;
  font-weight:800;
  font-size:10px;
  cursor:pointer;
  direction:ltr;
}

/* CATEGORY SCROLL (fixed under header then sticks to top) */
.cat-scroll{
  position:fixed;
  left:0;
  right:0;
  top:var(--header-h); /* بالبداية تحت الهيدر */
  z-index:900;

  display:flex;
  gap:10px;
  overflow-x:auto;
  padding:10px 12px;
  background:#121212;
  border-bottom:1px solid #2a2a2a;
}
body.cat-at-top .cat-scroll{ top:0; }

.cat-scroll::-webkit-scrollbar{display:none}
.cat-scroll{scrollbar-width:none}

.cat-scroll button{
  flex:0 0 auto;
  padding:8px 14px;
  border-radius:999px;
  border:1px solid #2a2a2a;
  background:#1f1f1f;
  color:#fff;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}
.cat-scroll button.active{color:#FFC107;border-color:#FFC107}

/* push content down because cat-scroll is fixed */
.social-bar{ margin-top:var(--cat-h); }

/* SOCIAL */
.social-bar{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:16px;
  padding:10px 0;
  background:#121212;
  border-bottom:1px solid #2a2a2a;
}
.social-bar a{
  width:36px;height:36px;
  display:flex;
  justify-content:center;
  align-items:center;
  border-radius:50%;
  background:#1f1f1f;
  border:1px solid #2a2a2a;
  transition:transform .15s ease,background .15s ease;
}
.social-bar a:hover{transform:translateY(-2px);background:#FFC107}
.social-bar svg{width:18px;height:18px;fill:none;stroke:#ffffff;stroke-width:2}

/* MENU */
.menu{max-width:960px;margin:0 auto;padding:0 14px}
.menu-section{
  margin-top:26px;
  scroll-margin-top:calc(var(--cat-h) + 14px); /* مهم للـ scrollIntoView */
}
.menu-section h2{
  margin:0 0 10px;
  font-size:22px;
  color:#FFC107;
  border-bottom:2px solid #FFC107;
  padding-bottom:8px;
}

/* ITEM */
.item{
  background:#1f1f1f;
  border:1px solid #2a2a2a;
  border-radius:12px;
  margin:10px 0;
  overflow:hidden;
}
.item-header{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  cursor:pointer;
  min-width:0;
}
.thumb{
  width:44px;height:44px;
  border-radius:10px;
  object-fit:cover;
  flex:0 0 auto;
}
.item-title{
  flex:1 1 auto;
  min-width:0;
  font-weight:800;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.item-price{
  flex:0 0 auto;
  font-weight:900;
  white-space:nowrap;
  opacity:.95;
}

/* DROPDOWN */
.dropdown{display:none;border-top:1px solid #2a2a2a;padding:12px 14px}
.dropdown-box{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.item-desc{flex:1 1 auto;min-width:0;opacity:.85;font-size:13px;line-height:1.35}
.item-desc:empty{display:none}
.add-btn{
  flex:0 0 auto;
  padding:8px 14px;
  border-radius:999px;
  border:1px solid #FFC107;
  background:transparent;
  color:#FFC107;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}

/* ORDER BAR */
.order-bar{
  position:fixed;
  left:0;right:0;bottom:0;
  background:#1f1f1f;
  border-top:1px solid #333;
  z-index:1200;
  padding:12px;
}
.order-inner{
  max-width:960px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
  text-align:center;
}
.summary{font-weight:800;opacity:.95}
.order-btn{
  padding:10px 16px;
  border-radius:999px;
  border:1px solid #25D366;
  background:transparent;
  color:#25D366;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}

/* POPUP (Order + Complaint share same styles) */
.popup{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.7);
  z-index:3000;
  padding:16px;
}
.popup-card{
  max-width:360px;
  margin:18vh auto 0;
  background:#1f1f1f;
  border:1px solid #2a2a2a;
  border-radius:14px;
  padding:16px;
  text-align:center;
}
.popup-title{margin:0 0 12px;color:#FFC107}
.popup-actions{display:flex;flex-direction:column;gap:10px}
.btn{
  padding:10px 14px;
  border-radius:999px;
  border:1px solid #FFC107;
  background:transparent;
  color:#FFC107;
  font-weight:900;
  cursor:pointer;
}
.btn-muted{
  border-color:rgba(255,255,255,.18);
  color:rgba(255,255,255,.85);
  margin-top:12px;
}
.table-box{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.table-input{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.18);
  background:#121212;
  color:#fff;
}

/* ITEM MODAL */
.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.72);
  display:none;
  align-items:flex-start;
  justify-content:center;
  padding:12px;
  overflow-y:auto;
  z-index:4000;
}
.modal-card{
  width:min(560px,96vw);
  background:#1f1f1f;
  border:1px solid #2a2a2a;
  border-radius:16px;
  padding:14px;
  margin:10vh auto 14px;
  position:relative;
}
.modal-close{
  position:absolute;
  top:10px;
  right:10px;
  background:transparent;
  border:0;
  color:#fff;
  font-size:18px;
  cursor:pointer;
}
.modal-head{display:flex;align-items:center;gap:12px}
.modal-img{
  width:92px;height:92px;
  border-radius:14px;
  object-fit:cover;
  border:1px solid #2a2a2a;
}
.muted{opacity:.75;font-size:13px;margin-top:4px}
.modal-section{margin-top:14px}
.modal-section-title{font-weight:900;margin-bottom:8px;color:#FFC107}

.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{
  border:1px solid #2a2a2a;
  background:#121212;
  color:#fff;
  padding:8px 12px;
  border-radius:999px;
  cursor:pointer;
  font-weight:900;
}
.chip.active{border-color:#FFC107;color:#FFC107}

.checks{display:flex;flex-direction:column;gap:8px}
.check{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid #2a2a2a;
  background:#121212;
  padding:10px;
  border-radius:12px;
}
.tag-paid{font-style:normal;color:#FFC107;margin-left:6px;font-weight:900}

.modal-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:16px}
.qty{display:flex;align-items:center;gap:8px}
.qty button{
  background:#b80000;
  color:#fff;
  border:none;
  padding:8px 12px;
  border-radius:10px;
  font-size:16px;
  cursor:pointer;
}
.qty .count{min-width:26px;text-align:center;font-weight:900}
.modal-right{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.price-line{opacity:.85;font-size:13px}

/* RTL + Cairo */
html[dir="rtl"] body{
  text-align:right;
  font-family:"Cairo",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
html[dir="rtl"] .cat-scroll{direction:rtl}
html[dir="rtl"] .item-header{flex-direction:row-reverse}
html[dir="rtl"] .dropdown-box{direction:rtl}
html[dir="rtl"] .modal-head{flex-direction:row-reverse}
html[dir="rtl"] .modal-right{align-items:flex-start}

/* =========================
   PICKUP TIME (type="time") FIXES
   - makes it consistent with your dark inputs
========================= */

/* make time input look like your other inputs */
input[type="time"].table-input{
  appearance:none;
  -webkit-appearance:none;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.18);
  background:#121212;
  color:#fff;
}

/* fix time control inner parts on WebKit (Chrome/Safari) */
input[type="time"].table-input::-webkit-calendar-picker-indicator{
  filter:invert(1);
  opacity:.85;
  cursor:pointer;
}
input[type="time"].table-input::-webkit-datetime-edit{
  color:#fff;
}
input[type="time"].table-input::-webkit-datetime-edit-fields-wrapper{
  padding:0;
}
input[type="time"].table-input::-webkit-datetime-edit-text{
  opacity:.8;
}

/* RTL: keep time LTR so it reads correctly (e.g., 18:30) */
html[dir="rtl"] input[type="time"].table-input{
  direction:ltr;
  text-align:left;
}

/* optional: slightly wider popup so time doesn't wrap on small screens */
.popup-card{
  width:min(420px, 92vw);
}

/* Mobile */
@media (max-width:480px){
  .modal-card{width:100%;margin-top:8vh}
  .modal-footer{flex-direction:column;align-items:stretch}
  .modal-right{align-items:stretch}
  #mAdd{width:100%}
}
