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

.iam-section {
  --iam-surface: #ffffff;
  --iam-card-visual: #fff7df;
  --iam-separator: #edf0f1;
  --iam-scrollbar: #c5ced0;
  --iam-empty-bg: #fbfdfd;
  --iam-empty-border: #ccd6d8;
  --iam-border: #dfe5e7;
  --iam-text: #1e2f33;
  --iam-muted: #65777b;
  --iam-deep: #0b4b52;
  --iam-accent: #ffb400;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  width: 100%;
  max-width: 1180px;
  margin: 24px auto;
  direction: ltr;
  color: var(--iam-text);
  font-family: inherit;
}

.iam-section .iam-clear {
  clear: both;
}

/* Map panel */
.iam-section .mapcontainer {
  position: relative;
  min-width: 0;
  padding: 8px 10px;
  overflow: hidden;
  border-radius: 18px;
  background: transparent;
}

.iam-section .mapcontainer .map {
  float: none;
  position: relative;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.iam-section .mapcontainer .map svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.iam-section .mapcontainer path:hover {
  cursor: pointer;
}

.iam-section .mapael .mapTooltip {
  position: absolute;
  z-index: 1000;
  display: none;
  max-width: 220px;
  padding: 6px 10px;
  border: 1px solid var(--iam-border);
  border-radius: 8px;
  background: var(--iam-surface);
  color: var(--iam-text);
  box-shadow: 0 5px 16px rgba(23, 47, 52, 0.10);
  font-size: 13px;
  line-height: 1.55;
}

/* Agency list */
.iam-section .Agencies {
  min-width: 0;
  max-height: 500px;
  padding: 2px 8px 2px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  direction: rtl;
  scrollbar-width: thin;
  scrollbar-color: var(--iam-scrollbar) transparent;
}

.iam-section .Agencies::-webkit-scrollbar {
  width: 6px;
}

.iam-section .Agencies::-webkit-scrollbar-track {
  background: transparent;
}

.iam-section .Agencies::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--iam-scrollbar);
}

.iam-section .branch {
  display: flex;
  float: none;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0 0 11px;
  padding: 0;
  overflow: hidden;
  direction: ltr;
  color: var(--iam-text);
  border: 1px solid var(--iam-border);
  border-radius: 14px;
  background: var(--iam-surface);
  box-shadow: 0 2px 4px rgba(22, 43, 47, 0.10);
  font-size: 14px;
}

.iam-section .branch:last-child {
  margin-bottom: 0;
}

.iam-section .iam-agency-card__visual {
  display: flex;
  flex: 0 0 64px;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 80px;
  border-right: 1px solid var(--iam-separator);
  background: var(--iam-card-visual);
}

.iam-section .branch:first-child .iam-agency-card__visual {
  border-right-color: var(--iam-separator);
  background: var(--iam-accent);
}

.iam-section .iam-agency-card__visual .profile {
  display: block;
  float: none;
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 10px;
  object-fit: cover;
  background: var(--iam-surface);
}

.iam-section .iam-card-marker,
.iam-section .iam-empty-state__marker {
  position: relative;
  display: block;
  width: 21px;
  height: 21px;
  border: 2px solid var(--iam-deep);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.iam-section .iam-card-marker::after,
.iam-section .iam-empty-state__marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--iam-deep);
  transform: translate(-50%, -50%);
}

.iam-section .branch:first-child .iam-card-marker {
  border-color: var(--iam-surface);
}

.iam-section .branch:first-child .iam-card-marker::after {
  background: var(--iam-surface);
}

.iam-section .iam-agency-card__content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 10px;
  direction: rtl;
  text-align: right;
}

.iam-section .info {
  display: block;
  float: none;
  margin: 0 0 3px;
  padding: 0;
}

.iam-section .info li {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-wrap: anywhere;
}

.iam-section .cityname {
  padding-top: 0;
  color: var(--iam-deep);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.45;
}

.iam-section .fullname {
  margin-top: 1px;
  color: var(--iam-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.iam-section .contact {
  clear: both;
  margin: 0;
}

.iam-section .contact ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px 12px;
  margin: 0;
  padding: 4px 0 0;
  border-top: 1px solid var(--iam-separator);
  list-style: none;
}

.iam-section .contact ul li {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 4px;
  margin: 0;
  padding: 1px 0;
  border: 0;
  color: var(--iam-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  list-style: none;
}

.iam-section .contact ul li i {
  display: inline-block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin: 1px 0 0 3px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.58;
}

.iam-section .contact .iam-contact-label {
  flex: 0 0 auto;
  color: var(--iam-text);
  font-weight: 600;
}

.iam-section .contact .iam-contact-value {
  min-width: 0;
  color: var(--iam-muted);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.iam-section .contact .iam-contact-address {
  grid-column: 1 / -1;
}

.iam-section .contact .iam-contact-address .iam-contact-value {
  flex: 1 1 auto;
}

.iam-section .profile-icon {
  background-image: url(../img/iam-user.png);
}

.iam-section .address-icon {
  background-image: url(../img/iam-address.png);
}

.iam-section .tell-icon {
  background-image: url(../img/iam-phone.png);
}

.iam-section .mobile-icon {
  background-image: url(../img/iam-mobile.png);
}

.iam-section .iam-empty-state {
  display: flex;
  min-height: 130px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  direction: rtl;
  border: 1px dashed var(--iam-empty-border);
  border-radius: 14px;
  background: var(--iam-empty-bg);
  color: var(--iam-muted);
  text-align: center;
}

.iam-section .iam-empty-state__marker {
  flex: 0 0 21px;
  opacity: 0.7;
}

.iam-section .iam-empty-state p {
  margin: 0;
  padding: 0;
  font-size: 14.5px;
  line-height: 1.7;
}

/* Legacy province-list support is kept scoped to the plugin wrapper. */
.iam-section .province-button {
  float: right;
  position: relative;
  display: block;
  width: 50%;
}

.iam-section .provinces-list {
  display: none;
  margin: 0;
  padding: 0;
}

.iam-section .province-button ul li {
  display: block;
  float: right;
  width: 33.3333333333%;
  margin: 0;
  padding: 4px;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}

.iam-section .province-button ul li a {
  display: block;
  color: var(--iam-text);
  border-bottom: 0;
  background: var(--iam-card-visual);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}

.iam-section .provinces-list li:hover ~ .mapTooltip {
  display: none;
}

@media only screen and (max-width: 900px) {
  .iam-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    max-width: 680px;
  }

  .iam-section .mapcontainer {
    padding: 8px;
  }

  .iam-section .Agencies {
    max-height: none;
    padding: 0;
    overflow-y: visible;
  }
}

@media only screen and (max-width: 560px) {
  .iam-section {
    gap: 14px;
    margin: 14px auto;
  }

  .iam-section .mapcontainer {
    padding: 4px;
    border-radius: 14px;
  }

  .iam-section .branch {
    margin-bottom: 9px;
    border-radius: 12px;
  }

  .iam-section .iam-agency-card__visual {
    flex-basis: 56px;
    min-height: 82px;
  }

  .iam-section .iam-agency-card__visual .profile {
    width: 40px;
    height: 40px;
  }

  .iam-section .iam-agency-card__content {
    padding: 8px 9px;
  }

  .iam-section .contact ul {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }

  .iam-section .contact .iam-contact-address {
    grid-column: auto;
  }

  .iam-section .contact .iam-contact-value {
    flex: 1 1 auto;
  }

  .iam-section .province-button,
  .iam-section .mapcontainer .map,
  .iam-section .Agencies {
    width: 100%;
  }
}
