/* =========================================================
   mokebreza.ir - Phase 1 (Static)
   Theme guide:
   --bg           : page background
   --panel        : cards / surfaces
   --panel2       : secondary surface (light gray)
   --text         : primary text
   --muted        : secondary text
   --brand        : primary accent (maroon)
   --brand-soft   : soft maroon for hover/outline
   Layout guide:
   --header-h     : fixed header height
   --catsbar-h    : fixed categories bar height
   --cart-w       : fixed cart width (desktop)
   ========================================================= */

:root{
  /* ===== Colors (change here) ===== */
  --bg:#f5f5f7;
  --panel:#ffffff;
  --panel2:#f0f0f3;
  --text:#1a1a1a;
  --muted:#6c6c72;

  /* Accent (زرشکی) */
  --brand:#b0123c;
  --brand2:#8b0f2f;
  --brand-soft: rgba(176,18,60,.16);

  --border: rgba(0,0,0,.10);
  --shadow: 0 10px 28px rgba(0,0,0,.08);
  --radius: 14px;

  /* ===== Sizes (change here) ===== */
  --header-h: 64px;
  --catsbar-h: 86px;
  --cart-w: 360px;
  --cart-gap: 18px;
}

*{ box-sizing:border-box; }
html, body { height:100%; }
body{
  margin:0;
  font-family: 'Vazirmatn', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  color:var(--text);
  background: linear-gradient(180deg, var(--bg), #fff);
  padding-top: calc(var(--header-h) + var(--catsbar-h)); /* خیلی مهم */
}

.container{ max-width: 1200px; margin:0 auto; padding: 0 16px; }
.muted{ color: var(--muted); }
.small{ font-size: 12px; }
.w100{ width:100%; }
.hidden{ display:none !important; }

a{ color:inherit; text-decoration:none; }

/* ===== Header (sticky) ===== */
.header{
  height: var(--header-h);
  position: fixed;     /* <- به جای sticky */
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner{
  height: var(--header-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand{ display:flex; align-items:center; gap:10px; }
.brand-badge{
  width:42px; height:42px; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color:#fff; font-weight:900;
  display:grid; place-items:center;
  box-shadow: 0 12px 24px rgba(176,18,60,.18);
}
.brand-title{ font-weight: 1000; }
.brand-sub{ font-size: 12px; color: var(--muted); margin-top:2px; }

.header-actions{ display:flex; align-items:center; gap:10px; }

/* ===== Buttons ===== */
.btn{
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 900;
  cursor:pointer;
}
.btn:hover{ border-color: rgba(176,18,60,.25); }
.btn-primary{
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-color: transparent;
  color:#fff;
}
.btn-ghost{ background: var(--panel); }

.badge{
  display:inline-grid; place-items:center;
  min-width:22px; height:22px;
  border-radius:999px;
  background:#fff;
  color: var(--brand);
  border: 1px solid rgba(176,18,60,.25);
  font-weight:1000;
  margin-right:8px;
}

.iconbtn{
  width:42px; height:42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel2);
  cursor:pointer;
}
.iconbtn:hover{ border-color: rgba(176,18,60,.25); }

/* ===== Categories bar (FIXED) ===== */
.catsbar{
  height: var(--catsbar-h);
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 55;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.catsbar-inner{
  height: var(--catsbar-h);
  display:flex;
  align-items:center;
  gap: 12px;
  overflow: visible;
}
.cat{
  border:0;
  background: transparent;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding: 10px 14px;
  border-radius: 14px;
  min-width: 120px;
}
.cat:hover{ background: var(--panel2); }
.cat.active{
  background: var(--panel);
  outline: 2px solid var(--brand-soft);
}
.cat-ico{
  width:38px; height:38px;
  color:#2b2b2b;
}
.cat-txt{ margin-top:6px; font-weight: 900; color:#2b2b2b; }

.catsbar-spacer{ flex:1; }

.quicksearch{
  display:flex;
  align-items:center;
  gap:10px;
}
.input{
  width: 280px;
  max-width: 44vw;
  height: 42px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: var(--panel);
  padding: 0 14px;
  outline:none;
}
.input:focus{ border-color: rgba(176,18,60,.35); }

/* ===== Cart fixed (desktop) =====
   Fix for "gap on scroll":
   top starts EXACTLY after header + catsbar (no extra px)
*/
.cart-fixed{
  position: fixed;
  left: 16px;
  top: calc(var(--header-h) + var(--catsbar-h));
  width: var(--cart-w);
  height: calc(100vh - (var(--header-h) + var(--catsbar-h)));
  z-index: 40;
}
.cart-card{
  height:100%;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.cart-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.cart-title{ font-weight: 1000; }
.cart-body{
  flex:1;
  overflow:auto;          /* only inside cart */
  padding: 12px;
}
.cart-empty{
  color: var(--muted);
  padding: 10px 0;
}
.cart-list{ display:flex; flex-direction:column; gap:10px; }

.cart-item{
  border:1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}
.cart-item-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.cart-item-name{ font-weight:1000; }
.cart-item-sub{ color:var(--muted); font-size:12px; margin-top:4px; }
.cart-item-price{ font-weight:1000; color: var(--brand); }

.cart-qty{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:10px;
}
.qtybtn{
  width:34px; height:34px;
  border-radius: 12px;
  border:1px solid rgba(176,18,60,.28);
  background: #fff;
  color: var(--brand);
  font-weight:1000;
  cursor:pointer;
}
.qtybtn:hover{ background: var(--brand-soft); }
.qtynum{ min-width: 22px; text-align:center; font-weight:1000; }

.cart-foot{
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.cart-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}
.cart-row.total{ margin-top:6px; }
.discount{ margin-top: 10px; }

/* ===== Main content offset (so it doesn't go under fixed cart) ===== */
.main{
  padding-top: 16px;
  padding-left: calc(var(--cart-w) + var(--cart-gap) + 16px);
  padding-bottom: 40px;
}

/* ===== Cover ===== */
.cover{
  position:relative;
  border-radius: var(--radius);
  overflow:hidden;
  border:1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  height: 210px;
}
.cover img{ width:100%; height:100%; object-fit:cover; display:block; }
.cover-overlay{
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.55));
  display:flex;
  align-items:flex-end;
}
.cover-box{
  margin: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.55);
}
.cover-h{ font-weight:1000; }
.cover-sub{ color: #333; font-size: 13px; margin-top:4px; }

/* ===== Sections ===== */
.section{ margin-top: 18px; }
.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin: 10px 0 12px;
}
.section-head h2{ margin:0; font-size: 18px; }

/* ===== Grid (equal cards) ===== */
.grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}

/* ===== Food card (equal sizes) ===== */
.food{
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow:hidden;
  position: relative;
  display:flex;
  flex-direction:column;
  min-height: 320px;
}
.food-media{
  position: relative;
  height: 210px; /* FIXED image height -> equal cards */
  background: var(--panel2);
}
.food-media img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

/* Hover overlay (show food info when mouse over image) */
.hover-info{
  position:absolute;
  inset:0;
  background: rgba(255,255,255,.82);
  opacity:0;
  transition: opacity .18s ease;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding: 14px;
  text-align:center;
}
.food:hover .hover-info{ opacity:1; }
.hover-title{ font-weight:1000; margin-bottom:8px; }
.hover-desc{ color:#333; line-height:1.9; }

.food-body{
  padding: 12px;
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
}
.food-name{ font-weight:1000; margin-bottom: 8px; }
.food-price{ color:#222; }

.food-actions{
  position:absolute;
  left: 12px;
  bottom: 12px;
  display:flex;
  gap:10px;
}
.circlebtn{
  width:44px; height:44px;
  border-radius: 999px;
  border: 2px solid rgba(176,18,60,.35);
  background: #fff;
  color: var(--brand);
  font-size: 22px;
  font-weight: 1000;
  cursor:pointer;
}
.circlebtn:hover{ background: var(--brand-soft); }

/* ===== Hours ===== */
.hours{
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
}
.hours-row{
  display:flex;
  justify-content:space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.hours-row:last-child{ border-bottom:0; }

/* ===== Responsive (mobile) ===== */
.desktop-only{ display:block; }
.mobile-only{ display:none; }
@media (max-width: 980px){
  .desktop-only{ display:none; }
  .mobile-only{ display:inline-flex; }
  .main{ padding-left: 16px; } /* no fixed cart */
}

/* Drawer (mobile cart) */
.drawer{ position:fixed; inset:0; display:none; z-index: 100; }
.drawer.open{ display:block; }
.drawer-overlay{ position:absolute; inset:0; background: rgba(0,0,0,.5); }
.drawer-panel{
  position:absolute; left:0; top:0; bottom:0;
  width: min(420px, 92vw);
  background: var(--panel);
  border-right: 1px solid var(--border);
  display:flex;
  flex-direction:column;
}

/* Modal (login) */
.modal{ position:fixed; inset:0; display:none; z-index:110; }
.modal.open{ display:block; }
.modal-overlay{ position:absolute; inset:0; background: rgba(0,0,0,.5); }
.modal-card{
  position:absolute; inset: 0;
  margin:auto;
  width: min(460px, 92vw);
  height: fit-content;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-body{ padding: 12px; }
.label{ display:block; margin: 10px 0 6px; font-weight: 900; }


/* Allow horizontal scroll for categories (so user can reach نوشیدنی حتی ته صفحه) */
/* ===== Category horizontal scroll (pretty) =====
   Scroll ONLY the categories row, keep search fixed.
*/
.catsbar-inner{
  overflow: visible;
}

.cats-scroll-wrap{
  position: relative;
  flex: 1;
  min-width: 0; /* allow flex child to shrink and enable scrolling */
  height: calc(var(--catsbar-h) - 8px);
  display:flex;
  align-items:center;
}

.cats-scroll{
  display:flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 6px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox hide */
  min-width: 0;
  width: 100%;
}
.cats-scroll::-webkit-scrollbar{ display:none; } /* Chrome/Safari hide */

.cats-fade{
  position:absolute;
  top:0; bottom:0;
  width: 34px;
  pointer-events:none;
}
.cats-fade-right{
  right:0;
  background: linear-gradient(270deg, rgba(255,255,255,.95), rgba(255,255,255,0));
}
.cats-fade-left{
  left:0;
  background: linear-gradient(90deg, rgba(255,255,255,.95), rgba(255,255,255,0));
}
