:root {
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-2: #f7f8f4;
  --ink: #141511;
  --muted: #697066;
  --line: #dde2d7;
  --accent: #2f6b4f;
  --accent-2: #d95f3d;
  --accent-soft: #e8f2ec;
  --danger: #a33a36;
  --shadow: 0 20px 60px rgba(31, 43, 34, 0.12);
  --shadow-sm: 0 8px 24px rgba(31, 43, 34, 0.08);
  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(180deg, #ffffff 0, var(--bg) 380px),
    var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(221, 226, 215, 0.72);
}

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

.mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 900;
  letter-spacing: 0;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1;
  letter-spacing: 0;
}

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

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

.lang-switch,
.admin-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.lang-switch button,
.admin-nav button,
.ghost,
.primary,
.danger {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 0 13px;
  background: transparent;
  color: var(--ink);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

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

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

.ghost:hover,
.section-tabs button:hover,
.section-list button:hover,
.upload-box:hover {
  border-color: #c7cec1;
  background: var(--surface-2);
}

.danger {
  background: var(--danger);
  color: white;
}

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

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 18px;
  align-items: stretch;
  margin: 22px 0 22px;
}

.hero-copy {
  min-height: 420px;
  padding: clamp(30px, 6vw, 72px);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 21, 17, 0.74), rgba(20, 21, 17, 0.2)),
    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 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 590px;
  margin: 20px 0 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
}

.feature {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feature-link {
  display: block;
  width: 100%;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
}

.feature img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.22s ease;
}

.feature-link:hover img {
  transform: scale(1.03);
}

.feature div {
  padding: 22px;
}

.feature h3 {
  margin: 0;
  font-size: 1.45rem;
}

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

.feature strong {
  color: var(--accent-2);
  font-size: 1.35rem;
}

.section-tabs {
  position: sticky;
  top: 75px;
  z-index: 8;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 18px;
  background: linear-gradient(180deg, rgba(243, 244, 241, 0.98), rgba(243, 244, 241, 0.82));
  backdrop-filter: blur(14px);
  scrollbar-width: thin;
}

.section-tabs button {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}

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

.menu-section {
  margin: 10px 0 42px;
  scroll-margin-top: 175px;
}

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

.section-title h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

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

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

.item {
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.item-link {
  display: grid;
  width: 100%;
  min-height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: start;
}

.item img {
  width: 100%;
  height: 180px;
  min-height: 0;
  object-fit: cover;
  transition: transform 0.22s ease;
}

.item:hover img {
  transform: scale(1.035);
}

.item:focus-within {
  outline: 3px solid rgba(47, 107, 79, 0.18);
  outline-offset: 3px;
}

.item-body {
  display: flex;
  min-height: 176px;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

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

.item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.93rem;
}

.price {
  color: var(--accent-2);
  font-size: 1.08rem;
  font-weight: 900;
  white-space: nowrap;
}

.modal-open {
  overflow: hidden;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(20, 21, 17, 0.58);
  backdrop-filter: blur(10px);
}

.detail-dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(20, 21, 17, 0.34);
}

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  background: rgba(20, 21, 17, 0.72);
  color: white;
  font-size: 1.7rem;
  line-height: 1;
}

.detail-media {
  margin: 0;
  overflow: hidden;
  background: var(--surface-2);
}

.detail-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-copy {
  display: flex;
  min-height: min(620px, calc(100vh - 44px));
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
  padding: clamp(28px, 4vw, 48px);
  overflow-y: auto;
}

.detail-section {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.detail-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 3.7vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.detail-copy p:not(.detail-section) {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.detail-copy strong {
  margin-top: 26px;
  color: var(--accent-2);
  font-size: clamp(1.85rem, 3vw, 2.7rem);
  line-height: 1;
}

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

.panel {
  padding: 18px;
}

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

.admin-notice {
  position: sticky;
  top: 78px;
  z-index: 9;
  border: 1px solid #b8d6c2;
  border-radius: 8px;
  background: #eef8f1;
  color: #1f5d39;
  padding: 12px 14px;
  font-weight: 850;
  box-shadow: var(--shadow-sm);
}

.admin-notice.error {
  border-color: #e2b4b2;
  background: #fff1f0;
  color: var(--danger);
}

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

.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;
}

.panel-head p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  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: var(--surface-2);
}

.admin-tabs button {
  min-height: 40px;
  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(430px, 100%);
  margin: 76px auto;
  padding: 24px;
}

.panel h2,
.login h2 {
  margin: 0 0 14px;
}

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

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

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

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 3px solid rgba(47, 107, 79, 0.14);
  border-color: var(--accent);
}

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

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

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

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

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

.image-preview {
  width: 92px;
  height: 68px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  object-fit: cover;
}

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

.upload-help.error {
  color: var(--danger);
  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;
}

.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: var(--surface);
  padding: 10px;
  text-align: start;
}

.section-list button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

.admin-item img {
  width: 58px;
  height: 58px;
  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(--accent-2);
  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;
  }

  .feature {
    grid-template-rows: 260px auto;
  }

  .detail-dialog {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .detail-media {
    height: min(52vh, 460px);
  }

  .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);
  }

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

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

  .hero {
    margin-top: 18px;
  }

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

  .feature {
    grid-template-rows: 210px auto;
  }

  .detail-modal {
    align-items: end;
    padding: 12px;
  }

  .detail-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  .detail-media {
    height: 330px;
  }

  .detail-copy {
    min-height: 270px;
    padding: 24px;
  }

  .detail-copy h2 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .detail-copy strong {
    font-size: 2rem;
  }

  .detail-close {
    top: 10px;
    right: 10px;
  }

  .section-tabs {
    top: 137px;
  }

  .menu-section {
    scroll-margin-top: 285px;
  }

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

  .item img {
    height: 170px;
  }

  .item-body {
    min-height: 150px;
  }

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

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

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

  .admin-tabs {
    width: 100%;
  }

  .admin-tabs button {
    flex: 1;
  }

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

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