﻿@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn-VF.woff2") format("woff2-variations"), url("assets/fonts/Vazirmatn-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #4b8b74;
  --green-600: #3f7a65;
  --green-900: #27483d;
  --green-50: #eef5f1;
  --cream: #fbe3b1;
  --cream-50: #fff6e3;
  --ink: #1f2a26;
  --muted: #5f6c67;
  --line: #e6ece9;
  --white: #ffffff;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow-card: 0 4px 14px rgba(20, 40, 33, 0.07);
  --font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --page-max: 760px;
  --fab-space: 96px;
  --bs-body-font-family: var(--font);
  --bs-body-font-size: 1rem;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--green-50);
  --bs-border-radius: var(--radius-sm);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--green-50);
  color: var(--ink);
  line-height: 1.8;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

body.is-loading { overflow: hidden; }

[hidden] { display: none !important; }
svg { display: block; }
.logo { width: 64px; height: 100px; color: var(--green); }

.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--green);
  display: grid;
  place-items: center;
}
.loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--white);
  padding: 24px;
}
.loader__logo {
  width: 92px;
  height: 146px;
  color: var(--white);
  opacity: 0;
  transform: scale(0.88) translateY(8px);
  animation: loaderFadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.45s forwards;
}
.loader__title {
  margin-top: 18px;
  font-size: 2rem;
  font-weight: 800;
  opacity: 0;
  animation: loaderFadeUp 0.7s ease 0.7s forwards;
}
.loader__tagline {
  margin-top: 2px;
  font-size: 0.95rem;
  opacity: 0;
  color: rgba(255, 255, 255, 0.85);
  animation: loaderFadeUp 0.7s ease 0.85s forwards;
}
.loader__bar {
  margin-top: 34px;
  width: 170px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 0.4s ease 1.1s forwards;
}
.loader__bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--cream);
  animation: barFill 1.5s cubic-bezier(0.4, 0, 0.2, 1) 1.2s forwards;
}
.loader.is-done {
  animation: loaderOut 0.55s ease forwards;
  pointer-events: none;
}
@keyframes loaderFadeUp { to { opacity: 1; transform: none; } }
@keyframes barFill { to { width: 100%; } }
@keyframes loaderOut { to { opacity: 0; transform: scale(1.04); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  background: var(--green);
  min-height: 100vh;
  min-height: 100dvh;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
body.is-ready .page { opacity: 1; transform: none; }

.site-header {
  background: var(--white);
  padding: 30px 16px 6px;
}
.brand { gap: 8px; color: var(--green); }
.brand__logo { width: 66px; height: 104px; }
.brand__name {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.tabs-sentinel { height: 1px; background: var(--white); }
.tabs-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--white);
  padding: 10px 0 16px;
  border-radius: 0 0 32px 32px;
  transition: box-shadow 0.25s ease;
}
.tabs-wrap.is-stuck { box-shadow: 0 10px 28px rgba(20, 40, 33, 0.12); }
.tabs {
  gap: 12px;
  overflow-x: auto;
  padding: 6px 16px 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  min-width: 86px;
  padding: 10px 8px 8px;
  border: 0;
  border-radius: 22px;
  background: var(--cream);
  color: var(--green);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  scroll-snap-align: center;
  transition: background 0.25s ease, color 0.25s ease;
}
.tab svg { width: 28px; height: 28px; }
.tab.is-active { background: var(--green); color: var(--cream); }
.tab:focus-visible { outline: 3px solid rgba(39, 72, 61, 0.5); outline-offset: 2px; }
@media (hover: hover) { .tab:not(.is-active):hover { background: #f8d99a; } }

.menu {
  padding: 22px 16px 32px;
  display: grid;
  gap: 16px;
  min-height: 60vh;
  align-content: start;
}
.menu__title {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 600;
  opacity: 0.9;
  padding: 0 6px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu__title::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.25); }
.menu__empty { color: rgba(255, 255, 255, 0.85); text-align: center; padding: 40px 0; margin: 0; }

.menu-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-card);
  animation: cardIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.menu-card:nth-child(2) { animation-delay: 45ms; }
.menu-card:nth-child(3) { animation-delay: 90ms; }
.menu-card:nth-child(4) { animation-delay: 135ms; }
.menu-card:nth-child(5) { animation-delay: 180ms; }
.menu-card:nth-child(6) { animation-delay: 225ms; }
.menu-card:nth-child(7) { animation-delay: 270ms; }
.menu-card:nth-child(n+8) { animation-delay: 315ms; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.menu-card__inner { display: flex; gap: 12px; align-items: stretch; }
.menu-card__media {
  position: relative;
  flex: 0 0 auto;
  width: clamp(108px, 33vw, 136px);
  height: clamp(108px, 33vw, 136px);
  border-radius: 20px;
  overflow: hidden;
  background: var(--cream-50);
}
.menu-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu-card__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--cream);
  color: var(--green-900);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}
.menu-card__badge--off { background: #e9ecea; color: #6b7672; }
.menu-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-top: 2px; }
.menu-card__name { font-size: 1.2rem; font-weight: 700; line-height: 1.5; margin: 0; }
.menu-card__name a { color: inherit; text-decoration: none; }
.menu-card__en {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
  unicode-bidi: plaintext;
  text-align: right;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 7px;
}
.menu-card__desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.menu-card__foot { margin-top: auto; padding-top: 10px; gap: 8px; }
.menu-card.is-unavailable .menu-card__media img { filter: grayscale(1); opacity: 0.6; }
.menu-card.is-unavailable .menu-card__name { color: var(--muted); }

.price {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.6;
  white-space: nowrap;
}
.price small { font-size: 0.75rem; font-weight: 500; }
.price--lg { font-size: 1.3rem; padding: 6px 16px; border-radius: 16px; }

.btn-add {
  position: relative;
  z-index: 2;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn-add svg { width: 20px; height: 20px; }
.btn-add:active { transform: scale(0.9); }
.btn-add:disabled { background: #cfd8d4; cursor: not-allowed; }
.btn-add.is-bump { animation: bump 0.35s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.site-footer {
  background: var(--white);
  border-radius: 32px 32px 0 0;
  padding: 34px 22px 26px;
}
.footer__brand { gap: 4px; color: var(--green); margin-bottom: 26px; }
.footer__logo { width: 44px; height: 70px; }
.footer__name { font-size: 1.3rem; font-weight: 700; }
.footer__title { font-size: 0.95rem; font-weight: 700; color: var(--green); margin-bottom: 10px; }
.footer__col li { margin-bottom: 9px; }
.footer__col a, .footer__col span.footer__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
  text-decoration: none;
}
.footer__col a:hover { color: var(--green); }
.footer__col svg { width: 16px; height: 16px; color: var(--green); flex: 0 0 auto; }
.footer__bar {
  max-width: var(--page-max);
  margin: 0 auto;
  background: var(--cream);
  padding: 16px 16px calc(var(--fab-space) + env(safe-area-inset-bottom));
  font-size: 0.85rem;
  color: var(--green-900);
}

.preview-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--green-900);
  color: var(--cream);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.preview-bar a { color: var(--white); }
body.is-preview .page { padding-top: 40px; }
body.is-preview .tabs-wrap { top: 40px; }

.cart-fab {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  background: var(--green-900);
  color: var(--white);
  border: 0;
  border-radius: 999px;
  padding: 10px 18px 10px 14px;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: 0 14px 34px rgba(20, 40, 33, 0.35);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}
body.is-ready .cart-fab { opacity: 1; pointer-events: auto; }
body.is-locked .cart-fab { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); }
.cart-fab__icon { display: grid; place-items: center; }
.cart-fab__icon svg { width: 22px; height: 22px; }
.cart-fab__badge {
  position: absolute;
  top: -8px;
  left: -10px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--cream);
  color: var(--green-900);
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
}
.cart-fab__badge.is-bump { animation: bump 0.35s ease; }
.cart-fab__total { font-weight: 700; font-size: 0.9rem; padding-inline-start: 10px; border-inline-start: 1px solid rgba(255, 255, 255, 0.25); }
.cart-fab__total:empty { display: none; }

.sheet {
  --bs-offcanvas-height: auto;
  --bs-offcanvas-bg: var(--white);
  --bs-offcanvas-color: var(--ink);
  height: auto;
  max-height: 92vh;
  max-height: 92dvh;
  border: 0;
  border-radius: 28px 28px 0 0;
  left: 0;
  right: 0;
  width: min(560px, 100vw);
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
  font-family: var(--font);
}
.sheet .offcanvas-body { overscroll-behavior: contain; }
.sheet__head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.sheet__head .offcanvas-title { font-size: 1.2rem; font-weight: 700; }
.sheet__close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.sheet__close svg { width: 18px; height: 18px; }
.sheet__close--inline { position: static; background: var(--green-50); box-shadow: none; }

.product__media { aspect-ratio: 4 / 3; background: var(--cream-50); overflow: hidden; }
.product__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product__badge {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: var(--cream);
  color: var(--green-900);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
}
.product__body { padding: 18px 20px 22px; }
.product__name { font-size: 1.5rem; font-weight: 800; line-height: 1.5; margin: 0; }
.product__en {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
  unicode-bidi: plaintext;
  text-align: right;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 12px;
}
.product__desc { font-size: 1rem; color: var(--ink); line-height: 1.9; margin: 0; }
.product__sub { font-size: 0.9rem; font-weight: 700; color: var(--green); margin: 16px 0 8px; }
.chips { gap: 8px; margin: 0; }
.chips li { background: var(--green-50); color: var(--green-900); font-size: 0.85rem; font-weight: 500; padding: 4px 11px; border-radius: 99px; }
.product__foot { gap: 12px; margin: 20px 0 14px; }

.stepper { gap: 4px; background: var(--green-50); border-radius: 999px; padding: 4px; }
.stepper button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--green);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease;
}
.stepper button:active { transform: scale(0.9); }
.stepper button:disabled { opacity: 0.45; }
.stepper button svg { width: 18px; height: 18px; }
.stepper span { min-width: 30px; text-align: center; font-weight: 800; font-size: 1.05rem; }
.stepper--sm button { width: 30px; height: 30px; }
.stepper--sm button svg { width: 15px; height: 15px; }
.stepper--sm span { min-width: 24px; font-size: 0.95rem; }
.stepper button.is-trash { color: #c0392b; }

.btn-cafe, .btn-cafe-ghost {
  --bs-btn-padding-y: 12px;
  --bs-btn-padding-x: 16px;
  --bs-btn-font-size: 0.95rem;
  --bs-btn-font-weight: 700;
  --bs-btn-border-radius: 16px;
  --bs-btn-border-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-cafe {
  --bs-btn-bg: var(--green);
  --bs-btn-color: var(--white);
  --bs-btn-hover-bg: var(--green-600);
  --bs-btn-hover-color: var(--white);
  --bs-btn-active-bg: var(--green-900);
  --bs-btn-active-color: var(--white);
  --bs-btn-disabled-bg: #cfd8d4;
  --bs-btn-disabled-color: var(--white);
  --bs-btn-disabled-opacity: 1;
}
.btn-cafe-ghost {
  --bs-btn-bg: var(--green-50);
  --bs-btn-color: var(--green-900);
  --bs-btn-hover-bg: #e2ede7;
  --bs-btn-hover-color: var(--green-900);
  --bs-btn-active-bg: #d6e4dc;
  --bs-btn-active-color: var(--green-900);
}
.btn-cafe svg, .btn-cafe-ghost svg { width: 19px; height: 19px; flex: 0 0 auto; }
.btn__amount { margin-inline-start: auto; font-size: 0.85rem; font-weight: 600; opacity: 0.9; padding-inline-start: 10px; border-inline-start: 1px solid rgba(255, 255, 255, 0.35); }

.cart__list { padding: 6px 20px; }
.cart__empty { text-align: center; padding: 44px 16px 36px; color: var(--muted); font-size: 0.95rem; }
.cart__empty svg { width: 46px; height: 46px; margin: 0 auto 12px; color: var(--green); opacity: 0.7; }
.cart__empty p { margin: 0; }
.cart__empty .cart__hint { font-size: 0.85rem; margin-top: 4px; }
.cart-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item__img { width: 58px; height: 58px; border-radius: var(--radius-sm); object-fit: cover; background: var(--cream-50); flex: 0 0 auto; }
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item__unit { font-size: 0.85rem; color: var(--muted); }
.cart-item__total { font-size: 0.9rem; font-weight: 800; white-space: nowrap; color: var(--green-900); }
.cart-item__total small { font-size: 0.7rem; font-weight: 500; }
.cart-item__ctrl { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cart__foot {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
}
.field { gap: 12px; font-size: 0.9rem; color: var(--muted); }
.field .form-control {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--green-50);
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: center;
  padding: 8px 12px;
}
.field .form-control:focus { border-color: var(--green); background: var(--white); box-shadow: none; }
.cart__total { font-size: 0.95rem; color: var(--muted); }
.cart__total strong { font-size: 1.25rem; color: var(--ink); font-weight: 800; }
.cart__total small { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.cart__actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; }

.sheet--receipt { --bs-offcanvas-bg: var(--green-50); }
.sheet--receipt .sheet__head { background: var(--green-50); border-bottom-color: #dfe8e3; }
.sheet--receipt .offcanvas-body { padding: 18px 20px 22px; }
.receipt__paper {
  position: relative;
  background: var(--white);
  border-radius: 18px 18px 4px 4px;
  padding: 22px 20px 26px;
  box-shadow: 0 10px 30px rgba(20, 40, 33, 0.1);
}
.receipt__paper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 10px;
  background:
    linear-gradient(-45deg, transparent 7px, var(--white) 7px) 0 0 / 14px 10px repeat-x,
    linear-gradient(45deg, transparent 7px, var(--white) 7px) 0 0 / 14px 10px repeat-x;
  background-position: -3px 0, 4px 0;
}
.receipt__brand { gap: 2px; color: var(--green); font-size: 1.05rem; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.receipt__logo { width: 36px; height: 58px; }
.receipt__code { gap: 2px; padding: 16px 0 12px; }
.receipt__code span { font-size: 0.85rem; color: var(--muted); }
.receipt__code strong {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 4px;
  color: var(--green-900);
  background: var(--cream);
  padding: 4px 22px 2px 18px;
  border-radius: 16px;
}
.receipt__meta { gap: 22px; padding: 6px 0 14px; border-bottom: 1px dashed var(--line); margin: 0; }
.receipt__meta > div { text-align: center; }
.receipt__meta dt { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.receipt__meta dd { font-size: 0.95rem; font-weight: 700; margin: 0; }
.receipt__items { padding: 12px 0; border-bottom: 1px dashed var(--line); margin: 0; }
.receipt__items li { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; font-size: 0.95rem; }
.receipt__items .qty { color: var(--green); font-weight: 800; min-width: 28px; }
.receipt__items .name { font-weight: 600; }
.receipt__items .dots { flex: 1; border-bottom: 1px dotted #c9d3ce; transform: translateY(-4px); }
.receipt__items .amt { font-weight: 700; white-space: nowrap; }
.receipt__total { padding: 14px 0 4px; font-size: 0.95rem; color: var(--muted); }
.receipt__total strong { font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.receipt__total small { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.receipt__note { margin: 14px 0 0; font-size: 0.85rem; color: var(--green-900); background: var(--cream-50); border-radius: 12px; padding: 10px 12px; line-height: 1.8; }
.receipt__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }

.toast-msg {
  position: fixed;
  left: 50%;
  bottom: calc(var(--fab-space) + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px);
  z-index: 1100;
  background: var(--white);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(20, 40, 33, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast-msg svg { width: 18px; height: 18px; color: var(--green); flex: 0 0 auto; }
.toast-msg.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .loader__logo, .loader__title, .loader__tagline, .loader__bar { opacity: 1; transform: none; }
  .loader__bar span { width: 100%; }
}
