/* autogru — global styles */
@font-face { font-family: Vazirmatn; src: url('vendor/fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url('vendor/fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url('vendor/fonts/Vazirmatn-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url('vendor/fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --green: #3EA98C;
  --green-600: #2E8B72;
  --green-50: rgba(62, 169, 140, 0.08);
  --green-100: rgba(62, 169, 140, 0.15);
  --accent: #E87B3B;
  --accent-600: #C4621E;
  --accent-50: rgba(232, 123, 59, 0.08);
  --accent-100: rgba(232, 123, 59, 0.18);
  --ink: #222222;
  --ink-2: #323232;
  --ink-3: #474747;
  --muted: #808080;
  --muted-2: #909090;
  --line: #E6E6E6;
  --line-2: #EEEEEE;
  --bg: #FFFFFF;
  --bg-soft: #FAFAFA;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: 'Vazirmatn', system-ui, sans-serif;
  font-feature-settings: "ss01";
  background: #F2F2F2;
  color: var(--ink);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* shell that holds 3 screens side-by-side on desktop, single column on mobile */
.app-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
  gap: 24px;
  overflow: hidden;
}

/* mobile frame */
.phone {
  width: 360px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.phone-screen {
  flex: 1;
  overflow-y: auto;
  background: #FFFFFF;
  position: relative;
}

.phone-screen::-webkit-scrollbar { width: 0; }

.listing-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px calc(96px + env(safe-area-inset-bottom)) 16px;
}

.bottom-nav {
  height: 60px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  border-top: 1px solid rgba(0,0,0,0.06);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  flex-shrink: 0;
}

.bottom-nav-item {
  height: 46px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #9A9A9A;
  transition: all 0.15s ease;
}

.bottom-nav-item span {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.bottom-nav-item:hover {
  background: var(--green-50);
  color: var(--green);
}

.bottom-nav-item.active {
  background: var(--green);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(62,169,140,0.25);
}

.bottom-nav-item.active span {
  font-weight: 600;
  color: #FFFFFF;
}

.about-card {
  padding: 18px;
  line-height: 1.95;
  font-size: 13px;
  color: var(--ink-3);
}

.about-card p {
  margin: 0 0 14px 0;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.about-card strong {
  color: var(--ink);
  font-weight: 800;
}

.about-card a {
  color: var(--green-600);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.detail-info-card {
  padding: 14px;
  margin-bottom: 20px;
}

.detail-info-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.detail-info-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.detail-info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-info-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.detail-info-value {
  min-width: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-3);
  text-align: left;
}

.detail-info-value-right {
  text-align: right;
}

.detail-info-row-stacked {
  display: block;
}

.detail-info-row-stacked .detail-info-label {
  display: block;
  margin-bottom: 8px;
}

.detail-phone-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  padding: 0;
}

.detail-phone-copy:hover {
  color: var(--green-600);
}

.detail-copy-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--green-50);
  color: var(--green-600);
  font-size: 10px;
  font-weight: 700;
}

.detail-hours-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  color: var(--ink-3);
}

.detail-hours-table {
  width: 100%;
  padding-top: 4px;
}

.detail-hours-row span:first-child {
  text-align: right;
}

.detail-hours-row span:last-child {
  text-align: left;
  min-width: 86px;
}

/* admin desktop */
.admin-shell {
  flex: 1;
  min-width: 0;
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 780px;
  max-width: 1200px;
}

.admin-shell-mobile {
  display: none;
}

@media (max-width: 1100px) {
  .app-shell {
    flex-direction: column;
    align-items: center;
    padding: 12px;
    gap: 12px;
  }
  /* در column flex، phone باید flex:1 داشته باشه تا ارتفاع داشته باشه */
  .phone { width: 100%; max-width: 480px; flex: 1; min-height: 0; }
  .admin-shell { width: 100%; max-width: 720px; }
}

/* موبایل واقعی — فریم desktop رو حذف کن، کل صفحه رو پر کن */
@media (max-width: 480px) {
  .app-shell {
    padding: 0;
    gap: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .phone {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
  }
}

/* utility */
.row { display: flex; flex-direction: row; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.text-12 { font-size: 12px; }
.text-14 { font-size: 14px; }
.text-16 { font-size: 16px; }
.text-18 { font-size: 18px; }
.bold { font-weight: 700; }
.medium { font-weight: 500; }
.muted { color: var(--muted); }

/* Chip filter */
.chip {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.chip:hover { border-color: var(--green); color: var(--green); }
.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #FFFFFF;
}
.chip-location {
  width: auto;
  flex-shrink: 0;
  justify-content: center;
  gap: 4px;
}
.chip-location:hover { border-color: var(--accent); color: var(--accent); }
.chip-location.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}
.chip-location.active:hover { border-color: var(--accent-600); background: var(--accent-600); }

/* Skeleton */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #EFEFEF 25%, #E2E2E2 50%, #EFEFEF 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 6px;
}

/* Page transition — top progress bar */
@keyframes pt-fill {
  0%   { width: 0%; }
  30%  { width: 55%; }
  70%  { width: 80%; }
  100% { width: 92%; }
}
#page-transition {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
}
#page-transition.active {
  opacity: 1;
}
#page-transition::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: var(--green);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(62,169,140,0.6);
  animation: pt-fill 0.35s cubic-bezier(0.4,0,0.2,1) forwards;
}

/* Cards */
.card {
  background: #FFFFFF;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 14px;
  transition: all 0.15s ease;
}
.card:hover { border-color: var(--line); box-shadow: var(--shadow-sm); }
.card-clickable { cursor: pointer; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--green); color: #FFFFFF; }
.btn-primary:hover { background: var(--green-600); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--r-pill); }

/* Form fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.field-control {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #FFFFFF;
  font-size: 16px;
  color: var(--ink);
  transition: all 0.15s ease;
  width: 100%;
}
.field-control:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-50);
}
.field-help {
  font-size: 12px;
  color: var(--muted);
}
textarea.field-control {
  height: auto;
  min-height: 88px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}

/* Tag */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  border-radius: 0;
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 500;
  color: #999;
}
.tag-green {
  background: var(--green-50);
  border-color: transparent;
  color: var(--green-600);
}

/* Status dot */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #00BC3B;
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: toastIn 0.25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Map placeholder */
.map-placeholder {
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(62,169,140,0.04) 14px 15px),
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(0,0,0,0.03) 14px 15px),
    linear-gradient(135deg, #E8F4EE 0%, #E0EEF7 100%);
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
}

/* sticky header inside phone */
.phone-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #FFFFFF;
  border-bottom: 1px solid var(--line-2);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Admin desktop layout */
.admin-topbar {
  height: 64px;
  border-bottom: 1px solid var(--line-2);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #FFFFFF;
  position: sticky;
  top: 0;
  z-index: 5;
}
.admin-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  min-height: 0;
}
.admin-sidebar {
  border-left: 1px solid var(--line-2);
  padding: 20px 14px;
  background: var(--bg-soft);
}
.admin-main {
  padding: 24px 28px;
  overflow-y: auto;
}
.admin-nav-item {
  width: 100%;
  text-align: right;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.admin-nav-item:hover { background: rgba(0,0,0,0.04); }
.admin-nav-item.active {
  background: var(--green);
  color: #FFFFFF;
}

@media (max-width: 1100px) {
  .admin-body { grid-template-columns: 1fr; }
  .admin-sidebar {
    border-left: none;
    border-bottom: 1px solid var(--line-2);
    padding: 12px;
    display: flex;
    overflow-x: auto;
    gap: 6px;
  }
  .admin-nav-item { width: auto; margin-bottom: 0; white-space: nowrap; }
}

/* Mobile responsive admin panel */
@media (max-width: 640px) {
  .admin-shell {
    min-height: auto;
    border-radius: 0;
    box-shadow: none;
  }

  .admin-topbar {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .admin-topbar .row {
    order: 2;
  }

  .admin-topbar button:first-child {
    order: 1;
  }

  .admin-topbar > div:nth-child(3) {
    order: 3;
    flex-basis: 100%;
    min-height: 36px;
  }

  .admin-topbar > span {
    order: 4;
    font-size: 11px;
  }

  .admin-topbar .btn {
    order: 5;
    height: 36px;
    font-size: 12px;
    padding: 0 12px;
  }

  .admin-body {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .admin-sidebar {
    border-left: none;
    border-bottom: 1px solid var(--line-2);
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
  }

  .admin-sidebar > div:first-child {
    grid-column: 1 / -1;
  }

  .admin-sidebar > div:nth-child(2) {
    grid-column: 1 / -1;
  }

  .admin-nav-item {
    width: 100%;
    height: auto;
    padding: 8px 10px;
    font-size: 12px;
    margin-bottom: 0;
    white-space: normal;
    text-align: right;
  }

  .admin-main {
    padding: 16px;
    overflow-y: auto;
  }

  /* Make form grids single column on mobile */
  .admin-main [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

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

  /* Make section headers smaller */
  .admin-main h2 {
    font-size: 16px !important;
  }

  .admin-main .field {
    gap: 4px;
  }

  .field-control {
    font-size: 14px !important;
  }

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

  /* Improve button spacing on mobile */
  .admin-topbar .btn {
    flex: 1;
    min-width: 120px;
  }

  /* Better spacing for status box in sidebar */
  .admin-sidebar [style*="margin-top"] {
    grid-column: 1 / -1;
    margin-top: 8px !important;
  }
}

/* Inactive shops cards */
.inactive-shop-card {
  padding: 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
}

.inactive-shop-card:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.inactive-shop-card-content {
  flex: 1;
  min-width: 0;
}

.inactive-shop-card h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.inactive-shop-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.inactive-shop-card-address {
  margin: 4px 0 0 0;
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .inactive-shop-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .inactive-shop-card-content {
    width: 100%;
  }

  .inactive-shop-card button {
    width: 100%;
  }
}

/* Tooltip animations */
@keyframes tooltipFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.tooltip-fade {
  animation: tooltipFadeIn 0.2s ease-out forwards;
}
