/* =====================================================================
   کافه دیار — استایل اصلی
   ---------------------------------------------------------------------
   فهرست بخش‌ها:
   ۰) فونت و توکن‌های طراحی (رنگ، سایه، اندازه) — تم روشن و تاریک
   ۱) ریست و پایه (تایپوگرافی، RTL)
   ۲) اجزای عمومی (container ، دکمه، آیکون، چیپ، تیتر بخش)
   ۳) هدر چسبان
   ۴) هیرو
   ۵) ابزار منو (جستجو + فیلترها — چسبان)
   ۶) دسته‌ها و سطرهای منو
   ۷) درباره / اطلاعات / فوتر
   ۸) دکمه‌های شناور، بازگشت به بالا، مودال
   ۹) انیمیشن‌ها + کاهش حرکت
   ۱۰) ریسپانسیو (Mobile First: پایه = موبایل)
===================================================================== */

/* ---------- ۰) فونت ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("../assets/fonts/Vazirmatn-Variable.woff2") format("woff2-variations"),
       url("../assets/fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- ۰) توکن‌ها: تم روشن (پیش‌فرض) ---------- */
:root {
  /* رنگ‌ها */
  --bg:         #FAF5EC;   /* زمینهٔ کرم گرم */
  --surface:    #FFFDF8;   /* سطح کارت‌ها */
  --surface-2:  #F2EADB;   /* سطح ثانویه (تصویر جایگزین و…) */
  --ink:        #2B211A;   /* متن اصلی — اسپرسو */
  --muted:      #8A7A69;   /* متن کم‌رنگ */
  --line:       #E7DCC9;   /* خطوط و حاشیه‌ها */
  --gold:       #C6A15B;   /* طلایی برای سطوح و قاب‌ها */
  --gold-deep:  #B9862F;   /* طلایی سیر (گرادیان) */
  --gold-ink:   #8F651E;   /* طلایی خوانا برای متن روی زمینهٔ روشن */
  --wa:         #1FAF5A;   /* واتساپ */

  --shadow:     0 14px 34px -18px rgba(43, 33, 26, .30);
  --shadow-sm:  0 6px 18px -10px rgba(43, 33, 26, .25);

  --glass-bg:   rgba(250, 245, 236, .82);
  --pattern-opacity: .55;

  /* اندازه‌ها */
  --container:  min(1060px, 92%);
  --topbar-h:   62px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;

  color-scheme: light;
}

/* ---------- ۰) توکن‌ها: تم تاریک ---------- */
[data-theme="dark"] {
  --bg:         #171210;
  --surface:    #1F1915;
  --surface-2:  #29211B;
  --ink:        #F2E9DC;
  --muted:      #B3A38F;
  --line:       #3A3128;
  --gold:       #D8B25E;
  --gold-deep:  #B9862F;
  --gold-ink:   #E3C077;

  --shadow:     0 16px 38px -18px rgba(0, 0, 0, .55);
  --shadow-sm:  0 8px 20px -12px rgba(0, 0, 0, .5);

  --glass-bg:   rgba(23, 18, 16, .82);
  --pattern-opacity: .3;

  color-scheme: dark;
}

/* ---------- ۱) ریست و پایه ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.9;                 /* ارتفاع خط مناسب متن فارسی */
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }

/* پنهان‌سازی قطعی — چون بعضی عناصر display دارند */
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

::selection { background: var(--gold); color: #241A0F; }

:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 6px;
}

body.no-scroll { overflow: hidden; }

.noscript {
  margin: 24px auto;
  max-width: 480px;
  padding: 14px 18px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

/* ---------- ۲) اجزای عمومی ---------- */
.container { width: var(--container); margin-inline: auto; }

.icon {
  width: 22px; height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.icon--big { width: 44px; height: 44px; opacity: .5; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color .25s, background .25s, transform .25s;
}
.icon-btn:hover { border-color: var(--gold); transform: translateY(-1px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform .25s, box-shadow .25s, background .25s, border-color .25s;
}
.btn--gold {
  color: #2A1F12;
  background: linear-gradient(135deg, #DCB86A, var(--gold-deep));
  box-shadow: var(--shadow-sm);
}
.btn--gold:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost {
  border: 1px solid var(--gold);
  color: var(--gold-ink);
  padding: 9px 22px;
  font-size: 14px;
}
.btn--ghost:hover { background: rgba(198, 161, 91, .12); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
}
.chip .icon { width: 17px; height: 17px; color: var(--gold-ink); }

/* تیتر بخش‌ها */
.section-head { text-align: center; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(26px, 5vw, 34px); font-weight: 850; }
.section-head__sub {
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--gold-ink);
  font-weight: 600;
}

/* ---------- ۳) هدر چسبان ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.topbar.is-scrolled { border-color: var(--line); box-shadow: 0 8px 24px -20px rgba(43,33,26,.5); }
.topbar__row {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: baseline; gap: 6px; }
.brand__text { font-size: 26px; font-weight: 900; line-height: 1; }
.brand__img { width: 44px; height: 44px; object-fit: contain; }
.brand__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #DCB86A, var(--gold-deep));
  transform: translateY(-2px);
}

/* نمایش آیکون درست در سوییچ تم */
#theme-toggle .icon--sun { display: none; }
[data-theme="dark"] #theme-toggle .icon--sun { display: block; }
[data-theme="dark"] #theme-toggle .icon--moon { display: none; }

/* ---------- ۴) هیرو ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 12vh, 110px) 0 clamp(56px, 10vh, 96px);
  text-align: center;
  /* TODO عکس هیرو: وقتی عکس واقعی آماده شد، این بلوک را از کامنت خارج کنید
     و فایل را در assets/images/hero.jpg بگذارید:
  background-image: linear-gradient(rgba(250,245,236,.88), var(--bg)), url("../assets/images/hero.jpg");
  background-size: cover;
  background-position: center;
  */
}
/* نقش هندسی ایرانی (ستارهٔ ظریف) در پس‌زمینهٔ هیرو */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: var(--pattern-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='58' height='58' viewBox='0 0 58 58'%3E%3Cpath d='M29 22.4l2.4 4.2 4.2 2.4-4.2 2.4L29 35.6l-2.4-4.2-4.2-2.4 4.2-2.4z' fill='none' stroke='%23B9862F' stroke-opacity='.26'/%3E%3C/svg%3E");
  pointer-events: none;
}
.hero__glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background: radial-gradient(closest-side, rgba(198, 161, 91, .28), transparent 70%);
  pointer-events: none;
}
.hero__inner { position: relative; display: grid; justify-items: center; gap: 10px; }
.hero__eyebrow {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .5em;
  margin-inline-start: .5em; /* جبران فاصلهٔ آخر */
  color: var(--gold-ink);
}
.hero__title {
  font-size: clamp(64px, 17vw, 128px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.01em;
}
.hero__rule { width: min(240px, 62%); color: var(--gold-deep); margin-top: -4px; }
.hero__rule svg { width: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 1.4; }
.hero__rule path:nth-child(3) { fill: currentColor; stroke: none; }
.hero__rule circle { fill: currentColor; stroke: none; }
.hero__tagline { font-size: clamp(15px, 3.6vw, 18px); color: var(--muted); max-width: 34ch; }
.hero__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-block: 8px 14px; }

/* ---------- ۵) ابزار منو (چسبان) ---------- */
.menu { padding: clamp(48px, 8vh, 72px) 0 30px; }

.menu-tools {
  position: sticky;
  top: calc(var(--topbar-h) - 1px);
  z-index: 50;
  padding: 12px 0;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-block: 1px solid var(--line);
}
.menu-tools__inner { display: grid; gap: 10px; }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 48px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .25s, box-shadow .25s;
}
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(198,161,91,.15); }
.search .icon { color: var(--muted); width: 19px; height: 19px; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  height: 100%;
}
.search input:focus { outline: none; }
.search input::placeholder { color: var(--muted); }

.pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-block: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: color .25s, border-color .25s, background .25s, transform .25s;
}
.pill:hover { border-color: var(--gold); color: var(--ink); }
.pill.is-active {
  background: linear-gradient(135deg, #DCB86A, var(--gold-deep));
  border-color: transparent;
  color: #2A1F12;
}

.menu__count { min-height: 1.6em; margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ---------- ۶) دسته‌ها و سطرهای منو ---------- */
.menu-cat { padding-block: 26px 8px; scroll-margin-top: 150px; }

.menu-cat__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.menu-cat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 15px;
  color: var(--gold-ink);
  background: linear-gradient(160deg, rgba(198,161,91,.20), rgba(198,161,91,.06));
  border: 1px solid rgba(198,161,91,.35);
}
.menu-cat__icon .icon { width: 25px; height: 25px; }
.menu-cat__head h3 { font-size: 22px; font-weight: 800; line-height: 1.4; }
.menu-cat__meta { font-size: 12.5px; color: var(--muted); }
.menu-cat__meta span { letter-spacing: .12em; text-transform: uppercase; }

.menu-cat__note {
  font-size: 13.5px;
  color: var(--gold-ink);
  background: rgba(198,161,91,.10);
  border: 1px dashed rgba(198,161,91,.45);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  margin-block: 4px 8px;
}

/* زیرگروه (مثل «چای» / «دمنوش») */
.menu-cat__group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-block: 14px 4px;
  font-size: 14.5px;
  font-weight: 750;
  color: var(--gold-ink);
}
.menu-cat__group::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.menu-cat__list { display: grid; grid-template-columns: 1fr; column-gap: 34px; }

/* سطر آیتم منو */
.item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 11px 10px;
  border-radius: var(--r-md);
  transition: background .25s, box-shadow .25s, transform .25s;
}
.item--openable { cursor: pointer; }
.item--openable:hover,
.item--openable:focus-visible {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.item__thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  flex: 0 0 auto;
  border-radius: 16px;
  overflow: hidden;
  color: var(--gold-ink);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
}
.item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.item__thumb .icon { width: 23px; height: 23px; opacity: .85; }

.item__body { flex: 1; min-width: 0; }
.item__row { display: flex; align-items: baseline; gap: 8px; }
.item__name { font-weight: 650; font-size: 15.5px; }
/* نقطه‌چین کلاسیک منو بین نام و قیمت */
.item__dots {
  flex: 1;
  min-width: 14px;
  border-bottom: 2px dotted var(--line);
  transform: translateY(-4px);
}
.item__price { font-weight: 800; color: var(--gold-ink); white-space: nowrap; font-size: 15px; }
.item__price small { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.item__desc { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-top: 1px; }

.badge {
  display: inline-block;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gold-ink);
  border: 1px solid rgba(198,161,91,.55);
  border-radius: 999px;
  padding: 1px 9px 2px;
  margin-inline-start: 6px;
  vertical-align: 2px;
  background: rgba(198,161,91,.10);
}

.empty { text-align: center; color: var(--muted); padding: 44px 0 24px; display: grid; justify-items: center; gap: 10px; }

/* ---------- ۷) درباره / اطلاعات / فوتر ---------- */
.about { padding: clamp(48px, 9vh, 80px) 0; }
.about__inner { max-width: 640px; }
.about__text { text-align: center; color: var(--muted); font-size: 16.5px; }

.info { padding-bottom: clamp(56px, 10vh, 90px); }
.info__grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: grid;
  align-content: start;
  gap: 12px;
}
.info-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
}
.info-card h3 .icon { color: var(--gold-ink); }
.info-card__text { color: var(--muted); font-size: 15px; }
.info-card .btn--ghost { justify-self: start; }

.hours li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14.5px;
  padding-block: 5px;
  color: var(--muted);
}
.hours li::after { content: ""; order: 1; flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-4px); }
.hours li b { order: 2; color: var(--ink); font-weight: 700; }

.info-link { font-weight: 700; color: var(--gold-ink); font-size: 17px; }
.socials { display: flex; gap: 10px; }

.footer { border-top: 1px solid var(--line); padding: 22px 0 90px; }
.footer__row { display: grid; justify-items: center; gap: 4px; text-align: center; }
.footer__brand { font-weight: 900; font-size: 20px; }
.footer__note { font-size: 12.5px; color: var(--muted); }

/* ---------- ۸) شناورها و مودال ---------- */
.fabs {
  position: fixed;
  inset-inline-end: 16px;       /* در RTL یعنی سمت چپ صفحه */
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 10px;
  z-index: 70;
}
.fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}
.fab:hover { transform: translateY(-3px); }
.fab--wa { background: var(--wa); }
.fab--call { background: linear-gradient(135deg, #DCB86A, var(--gold-deep)); color: #2A1F12; }
.fab .icon { width: 24px; height: 24px; }

.scroll-top {
  position: fixed;
  inset-inline-start: 16px;     /* در RTL یعنی سمت راست صفحه */
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .3s, transform .3s, border-color .25s;
}
.scroll-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.scroll-top:hover { border-color: var(--gold); }
.scroll-top .icon { width: 20px; height: 20px; color: var(--gold-ink); }

/* مودال */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: end center; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 14, 10, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.modal__panel {
  position: relative;
  width: min(540px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow);
  animation: modal-in .35s cubic-bezier(.2, .8, .25, 1);
}
.modal__close { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; }
.modal__media {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  background: var(--surface-2);
  scrollbar-width: none;
}
.modal__media::-webkit-scrollbar { display: none; }
.modal__media img {
  flex: 0 0 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  scroll-snap-align: center;
}
.modal__placeholder {
  flex: 0 0 100%;
  aspect-ratio: 4 / 2.1;
  display: grid;
  place-items: center;
  color: var(--gold-ink);
}
.modal__placeholder .icon { width: 52px; height: 52px; opacity: .55; }
.modal__body { padding: 20px 22px 26px; display: grid; gap: 6px; }
.modal__body h3 { font-size: 21px; font-weight: 800; }
.modal__desc { color: var(--muted); font-size: 14.5px; }
.modal__desc:empty { display: none; }
.modal__price { font-size: 19px; font-weight: 850; color: var(--gold-ink); }
.modal__price small { font-size: 12px; font-weight: 500; color: var(--muted); }

@keyframes modal-in {
  from { transform: translateY(28px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ---------- ۹) انیمیشن‌های ورود ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- ۱۰) ریسپانسیو ---------- */
/* تبلت و بزرگ‌تر */
@media (min-width: 700px) {
  .menu-cat__list { grid-template-columns: 1fr 1fr; }
  .menu-tools__inner { grid-template-columns: 320px 1fr; align-items: center; }
  .info__grid { grid-template-columns: repeat(3, 1fr); }
  .modal { place-items: center; }
  .modal__panel { border-radius: var(--r-lg); }
  .footer { padding-bottom: 26px; }
}

/* دسکتاپ */
@media (min-width: 1000px) {
  .item__name { font-size: 16px; }
  .menu-cat { padding-block: 34px 12px; }
}
