@font-face {
  font-family: "Vazir";
  font-style: normal;
  font-weight: normal;
  src: url('fonts');
  src: url('../fonts/vazir/Vazir.eot') format('embedded-opentype'),
    url('../fonts/vazir/Vazir.woff2') format('woff2'),
    url('../fonts/vazir/Vazir.woff') format('woff'),
    url('../fonts/vazir/Vazir.ttf') format('truetype');
}

.iam-section * {
  box-sizing: border-box;
}

.iam-clear {
  clear: both;
}

/* map sits inside whatever container/column you place the shortcode in -
   it never forces itself to be centered or full width, and never clips */
.map {
  width: 100%;
  max-width: 560px;
  position: relative;
  overflow: visible;
}

.mapcontainer {
  overflow: visible;
}

.map svg {
  overflow: visible;
  display: block;
  width: 100%;
  height: auto;
}

path:hover {
  cursor: pointer;
}

/* --- hover card ------------------------------------------------------- */

.mapael .mapTooltip {
  position: absolute;
  background-color: transparent;
  opacity: 1;
  filter: none;
  padding: 0;
  z-index: 1000;
  width: max-content;
  max-width: min(280px, 78vw);
  font-size: 13px;
  display: none;
  color: #343434;
  pointer-events: none;
}

.iam-hover-card {
  direction: rtl;
  text-align: right;
  font-family: "Vazir", sans-serif;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(11, 61, 145, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 12px 14px;
  min-width: 180px;
}

.iam-hover-province {
  color: #0b3d91;
  font-weight: bold;
  font-size: 15px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #eef1f5;
  font-family: "Vazir", sans-serif;
}

.iam-hover-list {
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #c7d2e0 transparent;
}

.iam-hover-list::-webkit-scrollbar {
  width: 5px;
}

.iam-hover-list::-webkit-scrollbar-thumb {
  background: #c7d2e0;
  border-radius: 5px;
}

.iam-hover-item {
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px dashed #eef1f5;
}

.iam-hover-item:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.iam-hover-agent {
  color: #444;
  font-size: 13px;
  margin-bottom: 6px;
  font-family: "Vazir", sans-serif;
}

.iam-hover-phone {
  background: #0b3d91;
  color: #fff;
  border-radius: 8px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 13px;
  font-weight: bold;
  font-family: "Vazir", sans-serif;
  direction: ltr;
}

.iam-hover-phone-icon {
  width: 14px;
  height: 14px;
  flex: none;
  display: inline-block;
  background: url(../img/iam-phone.png) no-repeat center/contain;
  filter: brightness(0) invert(1);
}

/* --- responsive breakpoints -------------------------------------------- */

@media only screen and (max-width: 620px) {
  .map {
    width: 100%;
  }
}

@media only screen and (max-width: 480px) {
  .iam-hover-card {
    padding: 10px 12px;
    min-width: 150px;
  }

  .iam-hover-province {
    font-size: 14px;
  }

  .iam-hover-agent,
  .iam-hover-phone {
    font-size: 12px;
  }

  .iam-hover-list {
    max-height: 160px;
  }
}

/* --- click-to-pin card --------------------------------------------------
   Separate from the hover preview above: this is what stays open after a
   click/tap, on both desktop and mobile (mobile has no real hover). */

.iam-pinned-overlay {
  position: absolute;
  inset: 0;
  z-index: 99999;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.iam-pinned-overlay.iam-pinned-visible {
  visibility: visible;
  opacity: 1;
}

.iam-pinned-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.iam-pinned-card {
  position: absolute;
  pointer-events: auto;
  direction: rtl;
  text-align: right;
  font-family: "Vazir", sans-serif;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(11, 61, 145, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 18px 16px 14px;
  min-width: 210px;
  max-width: min(300px, 86vw);
  transform: translateY(6px) scale(0.98);
  transition: transform 0.18s ease;
}

.iam-pinned-overlay.iam-pinned-visible .iam-pinned-card {
  transform: translateY(0) scale(1);
}

.iam-pinned-close {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  background: #eef1f5;
  color: #0b3d91;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.iam-pinned-content .iam-hover-card {
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  min-width: 0;
}

@media only screen and (max-width: 620px) {
  .iam-pinned-backdrop {
    background: rgba(15, 23, 42, 0.4);
    pointer-events: auto;
  }

  .iam-pinned-card {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.22);
    transform: translateY(100%);
  }

  .iam-pinned-overlay.iam-pinned-visible .iam-pinned-card {
    transform: translateY(0);
  }

  .iam-pinned-content .iam-hover-list {
    max-height: 45vh;
  }
}
