* { box-sizing: border-box; }

:root {
  --bg: #36655e;          /* سبز آبی کم‌رنگ */
  --card: #c07a29;        /* نارنجی گلبهی */
  --card-dark: #c27a3c;
  --text: #24332f;
  --white: #fffaf7;
  --shadow: 0 10px 26px rgba(35, 60, 55, .16);
}

html, body {
  margin: 0;
  height: 100%;
  font-family: Tahoma, "Vazirmatn", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow: hidden;
}

.menu-app {
  width: min(100%, 760px);
  height: 100dvh;
  margin: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* سربرگ */
.topbar {
  flex: 0 0 auto;
  margin: 14px 12px 10px;
  min-height: 82px;
  border-radius: 24px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  box-shadow: var(--shadow);
}

.brand {
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 900;
}

.icon-btn {
  border: 0;
  background: transparent;
  font-size: 36px;
  color: var(--text);
  cursor: pointer;
}

/* اسکرول افقی دسته‌ها */
.categories {
  flex: 0 0 auto;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 14px 18px;
  direction: rtl;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.categories::-webkit-scrollbar { display: none; }

.category {
  scroll-snap-align: start;
  flex: 0 0 142px;
  height: 174px;
  border: 3px solid rgba(36, 51, 47, .10);
  border-radius: 25px;
  background: var(--card);
  color: var(--text);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: .2s ease;
}

.category.active {
  background: #26312e;
  color: white;
  transform: translateY(-2px);
}

.category img,
.category-icon {
  width: 112px;
  height: 112px;
  border-radius: 19px;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 62px;
  background: rgba(255,255,255,.55);
}

/* فقط این قسمت عمودی اسکرول می‌شود */
.products {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 14px 28px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

.product {
  direction: rtl;
  min-height: 214px;
  margin: 0 0 16px;
  padding: 10px;
  border-radius: 28px;
  background: var(--card);
  display: flex;
  flex-direction: row-reverse;
  gap: 16px;
  align-items: stretch;
  box-shadow: var(--shadow);
  border: 2px solid rgba(255,255,255,.45);
}

.product.hidden { display: none; }

.product-image {
  width: 39%;
  min-width: 150px;
  object-fit: cover;
  border-radius: 22px;
  cursor: pointer;
  transition: transform .2s ease;
}
.product-image:hover { transform: scale(1.02); }

.product-info {
  flex: 1;
  min-width: 0;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
}

.product h2 {
  margin: 0 0 12px;
  font-size: clamp(20px, 4vw, 28px);
}

.product p {
  margin: 0;
  line-height: 1.9;
  font-size: 15px;
  color: rgba(36,51,47,.78);
}

.product-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-bottom strong {
  font-size: clamp(17px, 3.5vw, 23px);
}

.choose, .modal-action {
  border: 2px solid var(--text);
  background: transparent;
  color: var(--text);
  border-radius: 15px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.choose:hover, .modal-action:hover {
  background: var(--text);
  color: white;
}

.empty {
  display: none;
  padding: 35px;
  text-align: center;
  font-weight: 800;
}
.empty.show { display: block; }

/* پنجره جزئیات آیتم */
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(20, 35, 32, .65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.show { display: flex; }

.modal-card {
  width: min(560px, 100%);
  max-height: 90dvh;
  overflow: auto;
  background: #f8f2ed;
  border-radius: 28px;
  position: relative;
  box-shadow: 0 25px 70px rgba(0,0,0,.35);
}

.modal-card > img {
  width: 100%;
  height: 310px;
  object-fit: cover;
  display: block;
  border-radius: 28px 28px 0 0;
}

.modal-content {
  padding: 22px;
}

.modal-content h2 { margin-top: 0; font-size: 28px; }
.modal-content p { line-height: 2; color: #53615d; }
.modal-content > strong { display: block; margin: 18px 0; font-size: 22px; }

.modal-action {
  width: 100%;
  background: var(--card);
  border-color: var(--card-dark);
}

.close {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(36,51,47,.85);
  color: white;
  font-size: 30px;
  cursor: pointer;
}

@media (max-width: 560px) {
  .topbar { min-height: 72px; border-radius: 20px; }
  .category { flex-basis: 122px; height: 154px; }
  .category img, .category-icon { width: 94px; height: 94px; }
  .product { min-height: 190px; gap: 11px; border-radius: 23px; }
  .product-image { min-width: 122px; width: 38%; border-radius: 18px; }
  .product-info { padding: 8px 3px; }
  .product h2 { font-size: 19px; margin-bottom: 7px; }
  .product p { font-size: 13px; line-height: 1.75; }
  .choose { padding: 7px 11px; font-size: 13px; }
  .modal-card > img { height: 250px; }
}
