.famplast-map-plugin {
  --famplast-purple: #7654e5;
  --famplast-purple-dark: #4e2a9d;
  --famplast-pink: #d85ec2;
  --famplast-pink-soft: #ffb3db;
  --famplast-ink: #2b1b42;
  --famplast-line: rgba(161, 87, 207, .34);
  width: 100%;
  max-width: 100%;
  color: var(--famplast-ink);
  font-family: "Yekan Bakh", "Peyda", "IRANSansX", "Vazirmatn", "IranSans", Tahoma, Arial, sans-serif;
  line-height: 1.5;
}

.famplast-map-plugin,
.famplast-map-plugin * {
  box-sizing: border-box;
}

.famplast-map-plugin button {
  font: inherit;
}

.famplast-map-only {
  position: relative;
  isolation: isolate;
}

.famplast-map-frame {
  position: relative;
  width: 100%;
  min-height: var(--famplast-map-height, 760px);
  overflow: hidden;
  border-radius: 30px;
  background:
    radial-gradient(circle at 75% 12%, rgba(139, 92, 246, .14), transparent 30%),
    radial-gradient(circle at 32% 82%, rgba(236, 72, 153, .13), transparent 33%),
    linear-gradient(145deg, #ffffff 0%, #fdfaff 45%, #fbf6ff 100%);
  box-shadow: 0 26px 75px rgba(73, 40, 116, .17);
  border: 1px solid rgba(120, 75, 185, .10);
}

.famplast-map-stage {
  position: relative;
  width: 100%;
  height: var(--famplast-map-height, 760px);
  min-height: 360px;
  overflow: hidden;
}

.famplast-iran-map {
  position: absolute;
  inset: 3.5% 2.5% 2.5%;
  width: 95%;
  height: 94%;
  object-fit: contain;
  object-position: center;
  filter: grayscale(1) saturate(.1) contrast(.88) brightness(1.12);
  opacity: .33;
  user-select: none;
  pointer-events: none;
  z-index: 1;
}

.famplast-map-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.36), transparent 18%, transparent 82%, rgba(255,255,255,.32)),
    linear-gradient(180deg, rgba(255,255,255,.28), transparent 20%, transparent 82%, rgba(255,255,255,.26));
}

.famplast-map-light {
  position: absolute;
  z-index: 2;
  width: 38%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(68px);
  opacity: .27;
  pointer-events: none;
  animation: famplastFloat 8s ease-in-out infinite alternate;
}

.famplast-map-light-one {
  left: 21%;
  top: 4%;
  background: #d389ff;
}

.famplast-map-light-two {
  right: 8%;
  bottom: -11%;
  background: #ff9bcf;
  animation-delay: -3s;
}

.famplast-routes,
.famplast-markers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
}

.famplast-routes {
  pointer-events: none;
  overflow: visible;
}

.famplast-all-route {
  fill: none;
  stroke: rgba(205, 91, 194, .40);
  stroke-width: 1.15;
  stroke-dasharray: 5 7;
  vector-effect: non-scaling-stroke;
  animation: famplastRouteFlow 10s linear infinite;
}

.famplast-active-route,
.famplast-active-route-glow {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.famplast-active-route {
  stroke-width: 3;
  stroke-dasharray: 10 10;
  animation: famplastRouteFlow 1.1s linear infinite;
}

.famplast-active-route-glow {
  stroke: rgba(220, 90, 202, .32);
  stroke-width: 10;
  opacity: .7;
}

.famplast-city-marker {
  --x: 50%;
  --y: 50%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 8;
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--famplast-ink);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform .3s ease, filter .3s ease;
  -webkit-tap-highlight-color: transparent;
}

.famplast-city-marker:hover,
.famplast-city-marker:focus-visible,
.famplast-city-marker.is-active {
  z-index: 15;
  transform: translate(-50%, -50%) scale(1.12);
  outline: none;
}

.famplast-pin {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,.96);
  border-radius: 50% 50% 50% 6px;
  background: linear-gradient(145deg, #8c69ed, #d966bf);
  box-shadow: 0 6px 16px rgba(106, 65, 168, .30), 0 0 0 2px rgba(192, 98, 210, .12);
  transform: rotate(-45deg);
  transition: width .25s ease, height .25s ease, box-shadow .25s ease;
}

.famplast-pin::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  transform: rotate(45deg);
}

.famplast-city-marker::before {
  content: "";
  position: absolute;
  top: 6px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(199, 88, 194, .42);
  border-radius: 50%;
  opacity: 0;
  animation: famplastPulse 2.2s ease-out infinite;
}

.famplast-city-marker:hover .famplast-pin,
.famplast-city-marker.is-active .famplast-pin {
  width: 22px;
  height: 22px;
  box-shadow: 0 9px 22px rgba(117, 73, 187, .36), 0 0 0 7px rgba(215, 91, 193, .14);
}

.famplast-city-marker.is-active::before {
  opacity: 1;
}

.famplast-city-label {
  max-width: 120px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 3px 10px rgba(49, 25, 81, .07);
  color: #2f2045;
  font-size: clamp(9px, .82vw, 13px);
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  text-shadow: 0 1px 0 #fff;
  backdrop-filter: blur(5px);
  transition: color .25s ease, background .25s ease, transform .25s ease;
}

.famplast-city-marker:hover .famplast-city-label,
.famplast-city-marker.is-active .famplast-city-label {
  color: #7c2aa3;
  background: rgba(255,255,255,.95);
  transform: translateY(2px);
}

.famplast-map-plugin[data-show-labels="0"] .famplast-city-label {
  opacity: 0;
  visibility: hidden;
}

.famplast-map-plugin[data-show-labels="0"] .famplast-city-marker:hover .famplast-city-label,
.famplast-map-plugin[data-show-labels="0"] .famplast-city-marker.is-active .famplast-city-label {
  opacity: 1;
  visibility: visible;
}

.famplast-tehran-logo {
  position: absolute;
  left: 38.4%;
  top: 35.4%;
  z-index: 20;
  width: clamp(58px, 7vw, 92px);
  height: clamp(42px, 5.2vw, 68px);
  padding: 6px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(252,239,255,.92));
  box-shadow: 0 13px 30px rgba(109, 60, 163, .22), 0 0 0 5px rgba(200, 90, 192, .09);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform .3s ease, box-shadow .3s ease;
}

.famplast-tehran-logo:hover,
.famplast-tehran-logo:focus-visible {
  transform: translate(-50%, -50%) scale(1.07);
  box-shadow: 0 16px 34px rgba(109, 60, 163, .28), 0 0 0 9px rgba(200, 90, 192, .10);
  outline: none;
}

.famplast-tehran-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.famplast-center-ring {
  position: absolute;
  inset: -11px;
  border: 1px solid rgba(207, 89, 194, .42);
  border-radius: 24px;
  animation: famplastCenterPulse 2.4s ease-out infinite;
  pointer-events: none;
}

.famplast-city-popup {
  --popup-x: 38.4%;
  --popup-y: 35.4%;
  position: absolute;
  left: var(--popup-x);
  top: var(--popup-y);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 205px;
  max-width: 270px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(112, 67, 192, .97), rgba(216, 80, 181, .96));
  box-shadow: 0 18px 42px rgba(76, 37, 126, .30);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 20px)) scale(.88);
  transition: opacity .3s ease, transform .4s cubic-bezier(.2,.85,.2,1);
  backdrop-filter: blur(15px);
}

.famplast-city-popup.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, calc(-100% - 20px)) scale(1);
}

.famplast-city-popup.is-bottom {
  transform: translate(-50%, 24px) scale(.88);
}

.famplast-city-popup.is-bottom.is-visible {
  transform: translate(-50%, 24px) scale(1);
}

.famplast-city-popup.is-left-edge {
  transform: translate(-18%, calc(-100% - 20px)) scale(.88);
}

.famplast-city-popup.is-left-edge.is-visible {
  transform: translate(-18%, calc(-100% - 20px)) scale(1);
}

.famplast-city-popup.is-right-edge {
  transform: translate(-82%, calc(-100% - 20px)) scale(.88);
}

.famplast-city-popup.is-right-edge.is-visible {
  transform: translate(-82%, calc(-100% - 20px)) scale(1);
}

.famplast-popup-logo {
  flex: 0 0 68px;
  width: 68px;
  height: 48px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(255,255,255,.93);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
}

.famplast-popup-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.famplast-popup-copy {
  display: grid;
  min-width: 0;
}

.famplast-popup-copy small {
  opacity: .82;
  font-size: 10px;
  font-weight: 500;
}

.famplast-popup-copy strong {
  overflow: hidden;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.famplast-popup-action {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 700;
  opacity: .9;
}

.famplast-city-popup:not(.has-link) .famplast-popup-action {
  display: none;
}

@keyframes famplastRouteFlow {
  to { stroke-dashoffset: -34; }
}

@keyframes famplastPulse {
  0% { transform: scale(.55); opacity: .8; }
  70%, 100% { transform: scale(1.8); opacity: 0; }
}

@keyframes famplastCenterPulse {
  0% { transform: scale(.85); opacity: .85; }
  75%, 100% { transform: scale(1.28); opacity: 0; }
}

@keyframes famplastFloat {
  from { transform: translate3d(-4%, -2%, 0) scale(.96); }
  to { transform: translate3d(5%, 4%, 0) scale(1.06); }
}

@media (max-width: 900px) {
  .famplast-map-frame,
  .famplast-map-stage {
    min-height: 560px;
    height: min(var(--famplast-map-height, 680px), 680px);
  }

  .famplast-city-label {
    font-size: 9px;
    padding: 1px 4px;
  }

  .famplast-pin {
    width: 15px;
    height: 15px;
    border-width: 2px;
  }

  .famplast-city-popup {
    min-width: 178px;
    padding: 8px 9px;
  }

  .famplast-popup-logo {
    flex-basis: 56px;
    width: 56px;
    height: 41px;
  }
}

@media (max-width: 600px) {
  .famplast-map-frame {
    overflow-x: auto;
    border-radius: 22px;
    scrollbar-width: thin;
    scrollbar-color: rgba(117, 84, 229, .45) transparent;
  }

  .famplast-map-stage {
    width: 820px;
    height: 520px;
    min-height: 520px;
  }

  .famplast-city-label {
    font-size: 9px;
  }

  .famplast-tehran-logo {
    width: 62px;
    height: 46px;
    border-radius: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .famplast-map-plugin *,
  .famplast-map-plugin *::before,
  .famplast-map-plugin *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Version 3: fully responsive tablet/mobile layout without horizontal scrolling */
.famplast-map-plugin {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: clip;
}

.famplast-map-frame,
.famplast-map-stage {
  max-width: 100%;
}

@media (max-width: 900px) {
  .famplast-map-plugin {
    width: 100%;
    overflow: hidden;
  }

  .famplast-map-frame {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 24px;
  }

  .famplast-map-stage {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: 3 / 2;
    overflow: hidden;
  }

  .famplast-iran-map {
    inset: 2% 1.5%;
    width: 97%;
    height: 96%;
  }

  .famplast-city-label {
    max-width: 92px;
    padding: 1px 4px;
    font-size: clamp(7px, 1.15vw, 10px);
    line-height: 1.2;
  }

  .famplast-pin {
    width: 14px;
    height: 14px;
    border-width: 2px;
  }

  .famplast-city-marker:hover .famplast-pin,
  .famplast-city-marker.is-active .famplast-pin {
    width: 17px;
    height: 17px;
  }

  .famplast-tehran-logo {
    width: clamp(50px, 8.2vw, 70px);
    height: clamp(36px, 6vw, 52px);
    padding: 4px;
    border-radius: 13px;
  }

  .famplast-city-popup {
    min-width: 0;
    width: min(190px, calc(100% - 18px));
    max-width: calc(100% - 18px);
    gap: 7px;
    padding: 7px 8px;
    border-radius: 14px;
  }

  .famplast-popup-logo {
    flex: 0 0 50px;
    width: 50px;
    height: 36px;
    padding: 3px;
    border-radius: 9px;
  }

  .famplast-popup-copy strong {
    font-size: 14px;
  }
}

@media (max-width: 600px) {
  .famplast-map-frame {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 3 / 2;
    overflow: hidden !important;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(73, 40, 116, .13);
  }

  .famplast-map-stage {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    aspect-ratio: 3 / 2;
    overflow: hidden !important;
  }

  .famplast-map-stage::before {
    background:
      linear-gradient(90deg, rgba(255,255,255,.2), transparent 14%, transparent 86%, rgba(255,255,255,.18)),
      linear-gradient(180deg, rgba(255,255,255,.18), transparent 18%, transparent 84%, rgba(255,255,255,.16));
  }

  .famplast-map-light {
    filter: blur(34px);
    opacity: .2;
  }

  .famplast-city-marker {
    gap: 1px;
    min-width: 24px;
  }

  .famplast-city-label {
    max-width: 70px;
    padding: 0 2px;
    border-radius: 4px;
    background: rgba(255,255,255,.62);
    box-shadow: none;
    font-size: clamp(5.8px, 1.75vw, 7.5px);
    font-weight: 800;
    line-height: 1.12;
  }

  .famplast-pin {
    width: 10px;
    height: 10px;
    border-width: 1.5px;
    box-shadow: 0 3px 8px rgba(106, 65, 168, .26);
  }

  .famplast-pin::after {
    width: 2.5px;
    height: 2.5px;
  }

  .famplast-city-marker::before {
    top: 5px;
    width: 17px;
    height: 17px;
  }

  .famplast-city-marker:hover,
  .famplast-city-marker:focus-visible,
  .famplast-city-marker.is-active {
    transform: translate(-50%, -50%) scale(1.06);
  }

  .famplast-city-marker:hover .famplast-pin,
  .famplast-city-marker.is-active .famplast-pin {
    width: 13px;
    height: 13px;
    box-shadow: 0 5px 12px rgba(117, 73, 187, .3), 0 0 0 4px rgba(215, 91, 193, .1);
  }

  .famplast-tehran-logo {
    width: clamp(38px, 13vw, 50px);
    height: clamp(28px, 9.5vw, 37px);
    padding: 3px;
    border-radius: 9px;
    box-shadow: 0 7px 16px rgba(109, 60, 163, .2), 0 0 0 3px rgba(200, 90, 192, .07);
  }

  .famplast-center-ring {
    inset: -6px;
    border-radius: 13px;
  }

  .famplast-all-route {
    stroke-width: .8;
    stroke-dasharray: 3 5;
  }

  .famplast-active-route {
    stroke-width: 2;
    stroke-dasharray: 6 7;
  }

  .famplast-active-route-glow {
    stroke-width: 6;
  }

  .famplast-city-popup {
    width: min(148px, calc(100% - 12px));
    max-width: calc(100% - 12px);
    gap: 5px;
    padding: 5px 6px;
    border-radius: 11px;
    box-shadow: 0 10px 24px rgba(76, 37, 126, .24);
    transform: translate(-50%, calc(-100% - 10px)) scale(.9);
  }

  .famplast-city-popup.is-visible {
    transform: translate(-50%, calc(-100% - 10px)) scale(1);
  }

  .famplast-city-popup.is-bottom {
    transform: translate(-50%, 11px) scale(.9);
  }

  .famplast-city-popup.is-bottom.is-visible {
    transform: translate(-50%, 11px) scale(1);
  }

  .famplast-city-popup.is-left-edge {
    transform: translate(-8%, calc(-100% - 10px)) scale(.9);
  }

  .famplast-city-popup.is-left-edge.is-visible {
    transform: translate(-8%, calc(-100% - 10px)) scale(1);
  }

  .famplast-city-popup.is-right-edge {
    transform: translate(-92%, calc(-100% - 10px)) scale(.9);
  }

  .famplast-city-popup.is-right-edge.is-visible {
    transform: translate(-92%, calc(-100% - 10px)) scale(1);
  }

  .famplast-popup-logo {
    flex: 0 0 38px;
    width: 38px;
    height: 28px;
    padding: 2px;
    border-radius: 7px;
  }

  .famplast-popup-copy small,
  .famplast-popup-action {
    font-size: 7px;
  }

  .famplast-popup-copy strong {
    font-size: 11px;
    line-height: 1.2;
  }
}
