:root {
  --paper: #f8f5ee;
  --ink: #211f1b;
  --muted: #6d655a;
  --line: #ddd4c5;
  --leaf: #5b7f42;
  --berry: #9d3f52;
  --sun: #d49a35;
  --sea: #497f83;
  --white: #fffdf8;
  --shadow: 0 18px 48px rgba(58, 45, 28, 0.14);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(91, 127, 66, 0.1), transparent 38%),
    linear-gradient(315deg, rgba(157, 63, 82, 0.08), transparent 42%),
    var(--paper);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 22px;
}

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

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(91, 127, 66, 0.28);
  border-radius: 8px;
  background: var(--white);
  color: var(--leaf);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(58, 45, 28, 0.08);
}

.brand h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 4vw, 2.4rem);
  line-height: 1;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lang-switch,
.admin-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.8);
}

.lang-switch button,
.admin-nav button,
.ghost,
.primary,
.danger {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: transparent;
}

.lang-switch button.active,
.admin-nav button.active,
.primary {
  background: var(--leaf);
  color: white;
}

.ghost {
  border: 1px solid var(--line);
  background: var(--white);
}

.danger {
  background: #8f2f2f;
  color: white;
}

.icon-action {
  width: 36px;
  min-width: 36px;
  padding: 0;
  text-align: center;
}

.icon-action:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy {
  min-height: 310px;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 8px;
  background:
    linear-gradient(rgba(28, 26, 22, 0.26), rgba(28, 26, 22, 0.18)),
    url("https://images.unsplash.com/photo-1442512595331-e89e73853f31?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow);
}

.hero-copy h2 {
  margin: 0;
  max-width: 620px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 7vw, 4.8rem);
  line-height: 0.95;
}

.hero-copy p {
  max-width: 560px;
  margin: 16px 0 0;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.55;
}

.feature {
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.feature img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.feature div {
  padding: 18px;
}

.feature h3 {
  margin: 0;
  font-size: 1.4rem;
  font-family: Georgia, "Times New Roman", serif;
}

.feature p {
  margin: 8px 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.feature strong {
  color: var(--berry);
  font-size: 1.25rem;
}

.section-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 18px;
  scrollbar-width: thin;
}

.section-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--white);
  color: var(--muted);
}

.section-tabs button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.menu-section {
  margin: 4px 0 34px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.section-title h2 {
  margin: 0;
  color: var(--leaf);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 4vw, 2.35rem);
}

.section-title span {
  color: var(--muted);
  font-size: 0.92rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 126px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.item img {
  width: 112px;
  height: 100%;
  min-height: 126px;
  object-fit: cover;
}

.item-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  min-width: 0;
}

.item h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.item p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.92rem;
}

.price {
  color: var(--berry);
  font-weight: 800;
  white-space: nowrap;
}

.panel,
.login {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

.admin-layout {
  display: grid;
  gap: 18px;
}

.admin-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.admin-workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-main {
  display: grid;
  gap: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.panel-head p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-command .panel-head {
  margin: 0;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
}

.admin-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.admin-tabs button.active {
  background: var(--ink);
  color: white;
}

.login {
  width: min(420px, 100%);
  margin: 70px auto;
  padding: 22px;
}

.panel h2,
.login h2 {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px 11px;
  color: var(--ink);
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.image-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 86px;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.image-field .field {
  margin-bottom: 0;
}

.upload-box {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffaf1;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-preview {
  width: 86px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffaf1;
  object-fit: cover;
}

.upload-help {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.upload-help.error {
  color: #8f2f2f;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.settings-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.section-editor {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.section-editor h3 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
}

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

.section-list,
.admin-items {
  display: grid;
  gap: 8px;
}

.section-list button,
.admin-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
  padding: 10px;
  text-align: start;
}

.section-list button.active {
  border-color: var(--leaf);
  background: rgba(91, 127, 66, 0.12);
}

.admin-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.admin-item img {
  width: 56px;
  height: 56px;
  border-radius: 7px;
  object-fit: cover;
}

.admin-item h3,
.admin-item p {
  margin: 0;
}

.admin-item p {
  color: var(--muted);
  font-size: 0.9rem;
}

.notice {
  margin: 10px 0;
  color: var(--berry);
  min-height: 22px;
}

[dir="rtl"] {
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
}

[dir="rtl"] .item,
[dir="rtl"] .admin-item {
  direction: rtl;
}

@media (max-width: 940px) {
  .hero,
  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 10px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }

  .admin-command {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-command .panel-head {
    width: 100%;
  }

  .admin-tabs {
    width: 100%;
  }

  .admin-tabs button {
    flex: 1;
  }

  .hero-copy {
    min-height: 360px;
  }

  .grid,
  .form-grid,
  .form-grid.compact,
  .settings-footer,
  .image-field {
    grid-template-columns: 1fr;
  }

  .image-preview {
    width: 100%;
    height: 140px;
  }

  .item {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .item img {
    width: 96px;
  }

  .admin-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .admin-item .row {
    grid-column: 1 / -1;
  }
}
