/* =========================================================
   RESTO — Mobile App-style QR Ordering UI
   Clean white, orange accents, horizontal food cards
   ========================================================= */
:root{
  --app-bg: #F8F9FA;
  --app-white: #FFFFFF;
  --app-primary: #B5512B;
  --app-primary-d: #8F3F1F;
  --app-gold: #D9A441;
  --app-ink: #1A1A2E;
  --app-ink2: #4A4A6A;
  --app-muted: #9B9BB0;
  --app-line: #EBEBF0;
  --app-green: #2E6B4F;
  --app-radius: 16px;
  --app-radius-sm: 10px;
  --app-font: 'Karla', 'Noto Sans Bengali', sans-serif;
  --app-shadow: 0 2px 12px rgba(0,0,0,.07);
  --app-shadow-lg: 0 8px 32px rgba(0,0,0,.13);
}

*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html{scroll-behavior:smooth;}
body.app-body{
  margin:0; padding:0;
  background: var(--app-bg);
  font-family: var(--app-font);
  color: var(--app-ink);
  font-size:15px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
  padding-bottom: 100px;
}
html[lang="bn"] body.app-body{
  font-family: 'Noto Sans Bengali', 'Karla', sans-serif;
}

/* ---------- Header ---------- */
.app-header{
  position:sticky; top:0; z-index:400;
  background: var(--app-white);
  border-bottom: 1px solid var(--app-line);
  box-shadow: var(--app-shadow);
}
.app-header-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 18px;
}
.app-brand{ display:flex; align-items:center; gap:10px; }
.app-logo{
  width:44px; height:44px; border-radius:50%;
  object-fit:cover; border:2px solid var(--app-gold);
  flex:none;
}
.app-brand-name{
  font-weight:800; font-size:1.1rem; color:var(--app-ink); line-height:1;
}
.app-table-badge{
  display:inline-flex; align-items:center; gap:4px;
  font-family:'Space Mono',monospace; font-size:.68rem;
  text-transform:uppercase; letter-spacing:.05em;
  color:var(--app-primary); margin-top:3px;
}
.app-header-right{ display:flex; align-items:center; gap:10px; }

/* Language toggle */
.lang-toggle-app{
  display:flex; border:1px solid var(--app-line); border-radius:20px; overflow:hidden;
  font-family:'Space Mono',monospace; font-size:.68rem;
}
.lang-toggle-app button{
  background:transparent; border:none; padding:6px 10px;
  color:var(--app-muted); cursor:pointer; font-family:inherit;
}
.lang-toggle-app button.active{
  background:var(--app-ink); color:#fff;
}

/* Cart button in header */
.app-cart-btn{
  position:relative; background:none; border:none; cursor:pointer;
  width:40px; height:40px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:var(--app-ink);
}
.app-cart-badge{
  position:absolute; top:-2px; right:-2px;
  width:18px; height:18px; border-radius:50%;
  background:var(--app-primary); color:#fff;
  font-size:.6rem; font-weight:800; font-family:'Space Mono',monospace;
  display:flex; align-items:center; justify-content:center;
  border:2px solid #fff;
}

/* ---------- Welcome strip ---------- */
.app-welcome{
  background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-d) 100%);
  color:#fff; padding:20px 18px 16px;
}
.app-welcome h1{
  font-family:'Fraunces','Noto Serif Bengali',serif;
  font-size:1.4rem; margin:0 0 4px; color:#fff; font-weight:700;
}
.app-welcome p{ margin:0; font-size:.85rem; opacity:.88; }

/* ---------- Search ---------- */
.app-search-wrap{
  background:var(--app-white); padding:14px 16px 10px;
  border-bottom:1px solid var(--app-line);
}
.app-search{
  display:flex; align-items:center; gap:10px;
  background:var(--app-bg); border-radius:12px;
  padding:10px 14px; border:1.5px solid var(--app-line);
}
.app-search:focus-within{ border-color:var(--app-primary); }
.app-search svg{ color:var(--app-muted); flex:none; }
.app-search input{
  border:none; background:transparent; width:100%;
  font-family:var(--app-font); font-size:.92rem; color:var(--app-ink);
  outline:none;
}
.app-search input::placeholder{ color:var(--app-muted); }
.search-clear{
  background:none; border:none; cursor:pointer; color:var(--app-muted);
  font-size:.9rem; padding:0 2px; line-height:1;
}

/* ---------- Category chips ---------- */
.app-cats-wrap{
  background:var(--app-white);
  border-bottom:1px solid var(--app-line);
  padding:0 4px;
  overflow:hidden;
}
.app-cats{
  display:flex; gap:6px;
  overflow-x:auto; padding:10px 12px;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.app-cats::-webkit-scrollbar{ display:none; }
.cat-chip{
  flex:none; scroll-snap-align:start;
  font-family:var(--app-font); font-size:.8rem; font-weight:700;
  padding:8px 16px; border-radius:20px;
  border:1.5px solid var(--app-line);
  background:var(--app-white); color:var(--app-ink2);
  cursor:pointer; white-space:nowrap;
  transition:all .15s ease;
}
.cat-chip.active{
  background:var(--app-primary); border-color:var(--app-primary); color:#fff;
}
.cat-chip:hover:not(.active){
  border-color:var(--app-primary); color:var(--app-primary);
}

/* ---------- Main content ---------- */
.app-main{ padding: 0 0 20px; }

/* Section header */
.app-section-head{
  display:flex; align-items:center; gap:10px;
  padding:18px 18px 10px;
}
.app-section-head h2{
  font-family:'Fraunces','Noto Serif Bengali',serif;
  font-size:1.1rem; font-weight:700; color:var(--app-ink); margin:0;
}
.app-section-count{
  font-family:'Space Mono',monospace; font-size:.7rem;
  color:var(--app-muted); background:var(--app-bg);
  padding:3px 8px; border-radius:10px; border:1px solid var(--app-line);
}

/* ---------- Food item card (horizontal list style) ---------- */
.food-card{
  display:flex; align-items:flex-start; gap:14px;
  background:var(--app-white); margin:0 14px 10px;
  border-radius:var(--app-radius); padding:14px;
  border:1.5px solid var(--app-line);
  box-shadow: var(--app-shadow);
  transition:border-color .15s ease, box-shadow .15s ease;
}
.food-card.in-cart{
  border-color:var(--app-primary);
  box-shadow:0 0 0 3px rgba(181,81,43,.12);
}

.food-thumb{
  width:90px; height:90px; flex:none;
  border-radius:var(--app-radius-sm);
  overflow:hidden; background:#EAD9B8;
  position:relative;
}
.food-thumb img{
  width:100%; height:100%; object-fit:cover; display:block;
  transition:transform .3s ease;
}
.food-card:hover .food-thumb img{ transform:scale(1.05); }

.food-thumb-ph{
  width:100%; height:100%; display:flex;
  flex-direction:column; align-items:center; justify-content:center; gap:4px;
}
.food-thumb-ph svg{ opacity:.4; }
.food-thumb-ph span{
  font-family:'Space Mono',monospace; font-size:.5rem;
  color:rgba(58,42,31,.4); text-align:center; padding:0 4px;
}

/* Tag badges on photo */
.food-thumb-badges{
  position:absolute; top:5px; left:5px; display:flex; gap:3px; flex-wrap:wrap;
}
.food-thumb-badge{
  font-size:.55rem; font-weight:800; text-transform:uppercase;
  padding:2px 5px; border-radius:6px; backdrop-filter:blur(4px);
}
.food-thumb-badge.veg   { background:rgba(77,122,51,.9); color:#fff; }
.food-thumb-badge.spicy { background:rgba(181,81,43,.9); color:#fff; }
.food-thumb-badge.popular{ background:rgba(217,164,65,.92); color:#2A1F17; }

.food-info{ flex:1; min-width:0; }
.food-name{
  font-weight:800; font-size:.95rem; color:var(--app-ink);
  margin:0 0 3px; line-height:1.25;
}
.food-desc{
  font-size:.78rem; color:var(--app-ink2); margin:0 0 8px;
  display:-webkit-box; -webkit-line-clamp:2;
  -webkit-box-orient:vertical; overflow:hidden;
}
.food-footer{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.food-price{
  font-family:'Space Mono',monospace; font-weight:700;
  font-size:.95rem; color:var(--app-primary);
}
.food-price.ask{ font-size:.75rem; color:var(--app-muted); }

/* Add / stepper control */
.food-stepper{ display:flex; align-items:center; gap:6px; }
.food-add-btn{
  width:32px; height:32px; border-radius:50%;
  background:var(--app-primary); color:#fff; border:none;
  font-size:1.2rem; font-weight:700; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 3px 10px rgba(181,81,43,.35);
  transition:transform .12s ease, background .12s ease;
}
.food-add-btn:hover{ transform:scale(1.1); background:var(--app-primary-d); }
.food-add-btn:active{ transform:scale(.95); }
.food-step-minus, .food-step-plus{
  width:28px; height:28px; border-radius:50%; border:1.5px solid var(--app-primary);
  background:#fff; color:var(--app-primary); font-weight:800; font-size:1rem;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.food-qty{
  font-family:'Space Mono',monospace; font-weight:800;
  font-size:.88rem; min-width:20px; text-align:center; color:var(--app-ink);
}

/* ---------- Search results state ---------- */
.search-results-label{
  padding:14px 18px 6px;
  font-size:.8rem; font-weight:700; color:var(--app-muted);
  text-transform:uppercase; letter-spacing:.05em;
}

/* Empty state */
.app-empty{
  text-align:center; padding:50px 20px;
  color:var(--app-muted); display:flex; flex-direction:column;
  align-items:center; gap:12px;
}
.app-empty p{ font-size:.9rem; }
.hidden{ display:none !important; }

/* ---------- Sticky cart bar ---------- */
.app-cart-bar{
  position:fixed; left:0; right:0; bottom:0; z-index:500;
  background:var(--app-ink); color:#fff;
  padding:14px 18px;
  border-radius:20px 20px 0 0;
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  box-shadow:0 -6px 28px rgba(0,0,0,.22);
  animation:slideUp .25s ease;
}
@keyframes slideUp{ from{transform:translateY(100%)} to{transform:translateY(0)} }
.cart-bar-left{ display:flex; align-items:center; gap:12px; }
.cart-bar-count{
  width:32px; height:32px; border-radius:50%;
  background:var(--app-primary); color:#fff;
  font-weight:800; font-family:'Space Mono',monospace; font-size:.8rem;
  display:flex; align-items:center; justify-content:center;
  border:2px solid rgba(255,255,255,.2);
}
.cart-bar-label{ font-size:.72rem; opacity:.7; }
.cart-bar-total{ font-weight:800; font-size:.95rem; font-family:'Space Mono',monospace; color:var(--app-gold); }
.cart-bar-btn{
  display:flex; align-items:center; gap:6px;
  background:var(--app-primary); color:#fff;
  border:none; border-radius:12px;
  padding:10px 16px; font-family:var(--app-font);
  font-weight:800; font-size:.85rem; cursor:pointer;
  white-space:nowrap; flex:none;
}
.cart-bar-btn:hover{ background:var(--app-primary-d); }

/* ---------- Drawer ---------- */
.app-overlay{
  position:fixed; inset:0; z-index:600;
  background:rgba(26,26,46,.6);
  display:none;
}
.app-overlay.open{ display:block; }

.app-drawer{
  position:fixed; left:0; right:0; bottom:0; z-index:700;
  background:var(--app-white);
  border-radius:24px 24px 0 0;
  max-height:85vh; display:flex; flex-direction:column;
  transform:translateY(100%); transition:transform .28s cubic-bezier(.32,.72,0,1);
  box-shadow:0 -12px 40px rgba(0,0,0,.18);
}
.app-drawer.open{ transform:translateY(0); }

.drawer-handle{
  width:40px; height:4px; border-radius:2px;
  background:var(--app-line); margin:12px auto 0;
}
.drawer-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  padding:14px 20px 10px;
  border-bottom:1px solid var(--app-line);
}
.drawer-head h2{ margin:0 0 2px; font-size:1.15rem; color:var(--app-ink); }
.drawer-sub{ font-size:.78rem; color:var(--app-muted); display:inline; }
.drawer-close{
  background:var(--app-bg); border:none; border-radius:50%;
  width:32px; height:32px; cursor:pointer; font-size:1rem;
  display:flex; align-items:center; justify-content:center;
  color:var(--app-ink2); flex:none;
}

.drawer-items{ flex:1; overflow-y:auto; padding:8px 0; }

/* Cart line item in drawer */
.cart-item{
  display:flex; align-items:center; gap:12px;
  padding:12px 20px; border-bottom:1px solid var(--app-line);
}
.cart-item-thumb{
  width:56px; height:56px; border-radius:10px;
  object-fit:cover; flex:none; background:#EAD9B8;
}
.cart-item-info{ flex:1; min-width:0; }
.cart-item-name{ font-weight:700; font-size:.88rem; color:var(--app-ink); }
.cart-item-price{ font-family:'Space Mono',monospace; font-size:.8rem; color:var(--app-primary); }
.cart-item-stepper{ display:flex; align-items:center; gap:6px; flex:none; }
.cart-item-stepper button{
  width:26px; height:26px; border-radius:50%;
  border:1.5px solid var(--app-line); background:#fff;
  font-weight:800; cursor:pointer; display:flex;
  align-items:center; justify-content:center; font-size:.9rem;
  color:var(--app-ink);
}
.cart-item-stepper .cqty{
  font-family:'Space Mono',monospace; font-size:.8rem; font-weight:800;
  min-width:18px; text-align:center;
}
.drawer-empty{
  text-align:center; padding:36px 20px;
  color:var(--app-muted); font-size:.9rem;
}

.drawer-footer{
  padding:16px 20px 20px;
  border-top:1px solid var(--app-line);
  background:var(--app-white);
}
.drawer-total-row{
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:10px;
  font-weight:800; font-size:1rem; color:var(--app-ink);
}
.drawer-total-val{
  font-family:'Space Mono',monospace; font-size:1.1rem; color:var(--app-primary);
}
.drawer-note{
  font-size:.72rem; color:var(--app-muted); margin:0 0 14px; line-height:1.5;
}
.app-btn-wa{
  width:100%; display:flex; align-items:center; justify-content:center; gap:10px;
  background:var(--app-green); color:#fff; border:none; border-radius:14px;
  padding:16px; font-family:var(--app-font); font-weight:800; font-size:.95rem;
  cursor:pointer; box-shadow:0 4px 16px rgba(46,107,79,.3);
}
.app-btn-wa:hover{ background:#1E4D39; }
.app-btn-wa:active{ transform:scale(.98); }

/* ---------- Responsive tweaks ---------- */
@media(min-width:600px){
  .app-header-inner, .app-search-wrap, .app-cats-wrap,
  .app-main, .app-cart-bar, .app-drawer{
    max-width:480px; margin-left:auto; margin-right:auto;
  }
  .app-cart-bar{ left:50%; right:auto; transform:translateX(-50%); width:480px; border-radius:20px 20px 0 0; }
  .food-card{ margin:0 16px 12px; }
  .app-drawer{ max-width:480px; left:50%; right:auto; transform:translateX(-50%) translateY(100%); }
  .app-drawer.open{ transform:translateX(-50%) translateY(0); }
}
@media(prefers-reduced-motion:reduce){
  *{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
}
