/* لایهٔ فروش — استایل مجزا */

.btn.is-active,
#salesLayerToggle.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.sales-layer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  padding: 0.55rem 1.25rem;
  background: linear-gradient(
    90deg,
    rgba(13, 148, 136, 0.12),
    rgba(245, 158, 11, 0.08)
  );
  border-bottom: 1px solid var(--border);
}

.sales-layer-bar[hidden] {
  display: none !important;
}

.sales-layer-bar__text {
  margin: 0;
  flex: 1 1 220px;
  font-size: 0.8rem;
  color: var(--text);
}

.sales-layer-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.sales-layer-bar select {
  font-family: inherit;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  background: var(--surface-solid);
  color: var(--text);
}

.sales-legend {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 8;
  min-width: 140px;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.sales-legend[hidden] {
  display: none !important;
}

.sales-legend__title {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sales-legend__scale {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fef3c7, #f59e0b, #b45309);
  margin-bottom: 0.3rem;
}

.sales-legend__row {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  direction: rtl;
}

.map-guide-dialog {
  width: min(680px, 100%);
}

@media (max-width: 720px) {
  .sales-layer-bar {
    padding: 0.45rem 0.65rem;
  }

  .sales-layer-bar__actions .chip {
    display: none;
  }
}

.sales-detail-panel {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 9;
  width: min(280px, calc(100% - 2rem));
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

.sales-detail-panel[hidden] {
  display: none !important;
}

.sales-detail-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.sales-detail-panel__head h3 {
  margin: 0;
  font-size: 0.9rem;
}

.sales-detail-panel__body {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text);
}

.sales-detail-panel__body p {
  margin: 0.15rem 0;
}

.sales-detail__coords {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sales-point {
  fill: #ea580c;
  stroke: #fff;
  stroke-width: 1.4px;
  cursor: pointer;
  pointer-events: all;
}

body.sales-layer-on .region {
  stroke: rgba(15, 23, 42, 0.35);
}

.sales-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.sales-modal[hidden] {
  display: none !important;
}

.sales-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.sales-color-field {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sales-color-field input[type="color"] {
  width: 2rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.sales-layer-bar__actions .chip {
  font-size: 0.68rem;
  padding: 0.28rem 0.5rem;
}

.sales-docs {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--surface-solid);
}

.sales-docs h4 {
  margin: 0.65rem 0 0.35rem;
  font-size: 0.78rem;
}

.sales-docs h4:first-child {
  margin-top: 0;
}

.sales-docs ul,
.sales-docs ol {
  margin: 0.25rem 0 0.4rem;
  padding-inline-start: 1.2rem;
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--text);
}

.sales-docs__code {
  margin: 0.4rem 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.68rem;
  line-height: 1.55;
  overflow: auto;
  white-space: pre;
}

.sales-docs__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  margin: 0.4rem 0;
}

.sales-docs__table th,
.sales-docs__table td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.45rem;
  text-align: right;
}

.sales-docs__table th {
  background: var(--surface-2);
}

.sales-docs__note {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.sales-modal__section--note {
  background: rgba(13, 148, 136, 0.08);
}

.sales-modal__section .btn + .btn {
  margin-inline-start: 0.35rem;
}

.sales-modal__dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem 1.25rem;
}

.sales-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.sales-modal__head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.sales-modal__head p {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.sales-modal__section {
  margin: 0.9rem 0;
  padding: 0.85rem;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.sales-modal__section h3 {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
}

.sales-modal__section p {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.sales-modal__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sales-modal textarea,
.sales-modal input[type="url"],
.sales-modal input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: var(--surface-solid);
  color: var(--text);
  resize: vertical;
}

.sales-modal textarea {
  min-height: 120px;
  direction: ltr;
  text-align: left;
}

.sales-modal__hint {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.sales-modal__hint code {
  font-size: 0.7rem;
  direction: ltr;
  display: inline-block;
}

.leaflet-sales-marker {
  background: #ea580c;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

@media (max-width: 720px) {
  .sales-legend {
    bottom: 4.5rem;
    right: 0.65rem;
  }

  .sales-detail-panel {
    top: auto;
    bottom: 4.5rem;
    left: 0.65rem;
  }
}
