/* =====================================================
   تم برند POTO CHEESE
   فونت فارسی: Vazirmatn (درشت و خوانا)
   فونت انگلیسی نمایشی: Playfair Display
   ===================================================== */

:root {
  --bg: #0c241a;
  --surface: #123627;
  --surface-2: #1a4433;
  --text: #f2eee3;
  --muted: #b9c6ba;
  --accent: #e3b458;
  --accent-2: #f0c878;
  --on-accent: #123524;
  --accent-soft: rgba(227, 180, 88, 0.16);
  --border: rgba(242, 238, 227, 0.14);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 16px;

  --font-fa: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --font-en: "Playfair Display", Georgia, "Times New Roman", serif;
}

[data-theme="light"] {
  --bg: #f5f1e6;
  --surface: #fffdf8;
  --surface-2: #efe9da;
  --text: #123524;
  --muted: #5f6f63;
  --accent: #1e5b3f;
  --accent-2: #2a7a54;
  --on-accent: #f5f1e6;
  --accent-soft: rgba(30, 91, 63, 0.12);
  --border: #e0d9c6;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-fa);
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  transition: background 0.25s ease, color 0.25s ease, padding 0.3s ease;
}

.container {
  width: min(1100px, calc(100% - 24px));
  margin-inline: auto;
}

.hero-sub,
.card-title-en,
.chip-en,
.cart-name-en,
.section-header span:not(.section-num),
.cart-head h3 span {
  unicode-bidi: plaintext;
}

/* ---------- هدر ---------- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-box {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.logo-box .logo-fallback {
  font-size: 22px;
}

.logo-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-light {
  display: none;
}

[data-theme="light"] .logo-light {
  display: block;
}

[data-theme="light"] .logo-dark {
  display: none;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
}

.brand-text p {
  margin: 0;
  font-family: var(--font-en);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 3px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font-weight: 700;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
}

.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  font-size: 18px;
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -5px;
  inset-inline-start: -5px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

/* ---------- هیرو ---------- */
.hero {
  background:
    radial-gradient(circle at 80% 10%, var(--accent-soft), transparent 55%),
    linear-gradient(160deg, var(--surface-2), var(--bg));
  padding: 40px 0 34px;
  text-align: center;
}

.logo-hero {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin: 0 auto 18px;
  box-shadow: var(--shadow);
}

.logo-hero .logo-fallback {
  font-size: 48px;
}

.hero-line-1 {
  display: block;
  font-family: var(--font-en);
  font-size: clamp(40px, 9vw, 84px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.hero-line-2 {
  display: block;
  font-family: var(--font-en);
  font-size: clamp(40px, 9vw, 84px);
  font-weight: 700;
  font-style: italic;
  color: var(--accent);
  line-height: 1.1;
}

.hero-rule {
  width: 64px;
  height: 2px;
  background: var(--accent);
  margin: 16px auto 12px;
}

.hero-sub {
  margin: 0;
  font-family: var(--font-en);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 4px;
}

/* ---------- جستجو ---------- */
.search-section {
  margin-top: -18px;
  position: relative;
  z-index: 5;
}

.search-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 16px;
  box-shadow: var(--shadow);
}

.search-wrap span {
  color: var(--muted);
  margin-left: 8px;
}

.search-wrap input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 14px 0;
  font: inherit;
  font-size: 15px;
  outline: none;
  min-width: 0;
}

#clearSearch {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  display: none;
}

/* ---------- دسته‌بندی‌ها ---------- */
.categories-section {
  padding: 20px 0 6px;
}

.categories {
  display: flex;
  gap: 10px;
}

.chip {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: 0.15s ease;
}

.chip-icon-box {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.chip-emoji {
  font-size: 26px;
}

.chip-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.chip-fa {
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.chip-en {
  font-family: var(--font-en);
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

.chip[aria-selected="true"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: var(--accent);
  color: var(--on-accent);
}

.chip[aria-selected="true"] .chip-en {
  color: var(--on-accent);
  opacity: 0.85;
}

/* ---------- منو ---------- */
.menu-section {
  padding: 16px 0 40px;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.section-num {
  font-family: var(--font-en);
  font-style: italic;
  color: var(--accent);
  font-size: 15px;
}

.section-header h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.section-header span:not(.section-num) {
  font-family: var(--font-en);
  color: var(--accent);
  font-size: 13px;
  font-style: italic;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.photo {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c1, #1a4433), var(--c2, #123627));
}

.photo::before {
  content: var(--emoji, "🍽️");
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 48px;
  opacity: 0.9;
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.photo img.is-missing {
  display: none;
}

.card-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
}

.badge.spicy {
  background: #c2334d;
  color: #fff;
}

/* ---------- محصول ناموجود ---------- */
.card.sold-out .photo {
  filter: grayscale(0.9) brightness(0.55);
}

.card.sold-out .photo::after {
  content: "✕";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 96px;
  font-weight: 900;
  color: #ff5a5a;
  z-index: 3;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}

.soldout-tag {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) rotate(-6deg);
  background: #c2334d;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 8px;
  z-index: 4;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.card.sold-out .card-title-fa,
.card.sold-out .price {
  opacity: 0.55;
}

.add-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.cart-line-soldout {
  opacity: 0.6;
  border-color: #c2334d;
}

/* ---------- بدنه کارت ---------- */
.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card-title-fa {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
}

.card-title-en {
  margin: 0;
  font-family: var(--font-en);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.4px;
}

.desc {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.price {
  color: var(--accent);
  font-weight: 800;
  font-size: 16px;
}

.add-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 0.15s ease;
}

.add-btn:hover:not(:disabled) {
  transform: scale(1.08);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 15px;
}

.empty-state div {
  font-size: 44px;
  margin-bottom: 8px;
}

/* ---------- پنل سفارش ---------- */
.cart-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  max-height: 60vh;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow);
  z-index: 60;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cart-drawer.open {
  transform: translateY(0);
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.cart-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cart-head h3 span {
  font-family: var(--font-en);
  color: var(--accent);
  font-size: 12px;
  font-style: italic;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 10px;
  font-size: 15px;
}

.cart-empty div {
  font-size: 40px;
  margin-bottom: 6px;
}

.cart-line {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

.cart-thumb {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--bg);
  border-radius: 10px;
  font-size: 22px;
}

.cart-name-fa {
  font-size: 15px;
  font-weight: 800;
}

.cart-name-en {
  font-family: var(--font-en);
  font-size: 10px;
  color: var(--muted);
}

.cart-unit {
  font-size: 12px;
  color: var(--accent);
  margin-top: 2px;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-qty button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}

.cart-qty span {
  min-width: 18px;
  text-align: center;
  font-weight: 800;
}

.cart-line-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cart-line-total {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
}

.cart-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.cart-foot {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 800;
}

.cart-total span {
  color: var(--accent);
}

.cart-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- دسکتاپ: ستون چپ ---------- */
@media (min-width: 900px) {
  .cart-drawer {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 350px;
    max-height: none;
    border-radius: 0;
    border-top: 0;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
  }

  .cart-drawer.open {
    transform: translateX(0);
  }

  body.cart-open {
    padding-left: 350px;
  }
}

/* ---------- فوتر ---------- */
footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  padding: 20px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  display: grid;
  gap: 6px;
}

.small {
  font-size: 12px;
  opacity: 0.8;
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 640px) {
  .categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .chip {
    padding: 10px 4px;
    border-radius: 12px;
  }

  .chip-icon-box {
    width: 36px;
    height: 36px;
  }

  .chip-emoji {
    font-size: 20px;
  }

  .chip-fa {
    font-size: 13px;
  }

  .chip-en {
    font-size: 8px;
  }

  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .brand-text h1 {
    font-size: 18px;
  }

  .top-actions .btn:not(.icon-btn) {
    padding: 8px 10px;
    font-size: 13px;
  }

  .logo-hero {
    width: 92px;
    height: 92px;
  }

  .hero-line-1,
  .hero-line-2 {
    font-size: clamp(34px, 10vw, 60px);
  }

  .card.sold-out .photo::after {
    font-size: 64px;
  }
}

@media print {
  .top-bar,
  .search-section,
  .categories-section,
  .card-footer,
  .cart-drawer,
  footer {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}