/**
 * Pakistan ISP Map — consumer layout (search + full-width map + office cards)
 */

.isp-map-page {
  background: #f8fafc;
}

.isp-map-page.isp-map-page--consumer {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.isp-map-page.isp-map-page--consumer .site-header {
  flex-shrink: 0;
}

.isp-map-page.isp-map-page--consumer .site-footer {
  flex-shrink: 0;
}

.isp-map-page--consumer .isp-map-page-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

/* Global `.wrap` (style.css) adds large padding-block — strip inside map main for alignment */
.isp-map-page--consumer .isp-map-page-main .wrap {
  padding-block: 0;
  width: min(100% - 1.25rem, 1280px);
  margin-inline: auto;
}

@media (min-width: 768px) {
  .isp-map-page--consumer .isp-map-page-main .wrap {
    width: min(100% - 2rem, 1280px);
  }
}

/* --- Hero --- */
.isp-map-hero {
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 1.25rem;
  text-align: center;
}

.isp-map-hero__inner {
  max-width: 42rem;
  margin: 0 auto;
}

.isp-map-hero__title {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: #0f172a;
}

.isp-map-hero__intro {
  margin: 0;
  color: #475569;
  font-size: clamp(1rem, 2.2vw, 1.08rem);
  line-height: 1.65;
  text-align: center;
}

.isp-map-hero__intro p {
  margin: 0 0 0.75rem;
}

.isp-map-hero__intro p:last-child {
  margin-bottom: 0;
}

/* --- App: grow so the map can use remaining viewport height --- */
.isp-map-app {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.isp-map-app__loading {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.55);
  backdrop-filter: blur(4px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.isp-map-app--loading .isp-map-app__loading {
  opacity: 1;
  pointer-events: auto;
}

.isp-map-app__loading-inner {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 8px 28px rgba(1, 65, 28, 0.12);
  border: 1px solid rgba(1, 65, 28, 0.1);
}

.isp-map-app__loading-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #01411c;
  animation: isp-map-pulse 0.9s ease-in-out infinite;
}

@keyframes isp-map-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* --- Search (centered flex shell, premium control strip) --- */
.isp-map-search-section {
  padding: 0 0 1.35rem;
}

.isp-map-search-shell {
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding-inline: clamp(0.65rem, 2.5vw, 1.25rem);
}

.isp-map-search-section__inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.isp-map-search-combo__row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-height: 68px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(1, 65, 28, 0.12);
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.06),
    0 14px 38px -10px rgba(1, 65, 28, 0.14);
  overflow: hidden;
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.isp-map-search-combo__row:focus-within {
  border-color: rgba(20, 83, 45, 0.38);
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.06),
    0 18px 44px -8px rgba(1, 65, 28, 0.2),
    0 0 0 3px rgba(52, 211, 153, 0.28);
}

.isp-map-search-combo__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem 0 1rem;
  color: #64748b;
  flex-shrink: 0;
}

.isp-map-search-combo__input {
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
  min-height: 52px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.75rem 0.65rem 0.75rem 0.25rem;
  color: #0f172a;
  line-height: 1.35;
  -webkit-appearance: none;
  appearance: none;
}

.isp-map-search-combo__input::-webkit-search-decoration,
.isp-map-search-combo__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.isp-map-search-combo__input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.isp-map-search-combo__input:focus {
  outline: none;
}

.isp-map-search-combo__cta {
  flex: 0 0 auto;
  align-self: center;
  margin: 8px 10px 8px 4px;
  min-height: 52px;
  min-width: 8.75rem;
  padding: 0 1.85rem;
  border: 0;
  border-radius: 14px;
  font-family: var(--font-sans);
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #ecfdf5;
  cursor: pointer;
  background: linear-gradient(165deg, #14532d 0%, #01411c 55%, #0a3d24 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.15s ease;
}

.isp-map-search-combo__cta:hover {
  filter: brightness(1.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 26px rgba(52, 211, 153, 0.42);
}

.isp-map-search-combo__cta:focus-visible {
  outline: 2px solid #34d399;
  outline-offset: 2px;
}

.isp-map-search-combo__cta:active {
  transform: scale(0.98);
}

@media (max-width: 560px) {
  .isp-map-search-combo__row {
    flex-direction: column;
    min-height: 0;
    border-radius: 16px;
  }

  .isp-map-search-combo__icon {
    display: none;
  }

  .isp-map-search-combo__input {
    padding: 1rem 1rem 0.35rem;
    width: 100%;
  }

  .isp-map-search-combo__cta {
    margin: 0 10px 10px;
    padding: 0.95rem 1rem;
    width: calc(100% - 20px);
    min-width: 0;
  }
}

.isp-map-status--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.isp-map-status--sr.isp-map-status--warn:not(:empty) {
  position: static;
  width: auto;
  height: auto;
  clip: auto;
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 0.92rem;
  font-weight: 650;
  white-space: normal;
}

/* --- Map shell: true full-bleed width, tall stage (primary viewport) --- */
.isp-map-map-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.65rem 0 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.isp-map-stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: clamp(520px, 78dvh, 1100px);
}

.isp-map-frame {
  position: absolute;
  inset: 0;
  border-radius: 0;
  overflow: hidden;
  border: solid rgba(1, 65, 28, 0.12);
  border-width: 1px 0;
  box-shadow: none;
  background: #e8edf2;
}

@media (min-width: 720px) {
  .isp-map-map-shell {
    padding-top: 0.85rem;
  }

  .isp-map-stage {
    min-height: clamp(580px, 80dvh, 1200px);
  }

  .isp-map-frame {
    border-radius: 14px;
    border-width: 1px;
    box-shadow: 0 12px 44px -16px rgba(15, 23, 42, 0.18);
  }
}

@media (min-width: 1100px) {
  .isp-map-stage {
    min-height: clamp(620px, 82dvh, 1280px);
  }
}

#ispMapPane {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

/* --- Results section --- */
.isp-map-results-section {
  padding: clamp(1.25rem, 3vw, 2rem) 0 2.5rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.isp-map-results-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  padding-inline: clamp(0.65rem, 2.5vw, 1.25rem);
}

.isp-map-results-section__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.isp-map-results-section__toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.isp-map-results-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 2px solid rgba(1, 65, 28, 0.18);
  background: #fff;
  color: #14532d;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  -webkit-appearance: none;
  appearance: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease,
    opacity 0.2s ease;
}

.isp-map-results-toggle:hover {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 6px 18px rgba(1, 65, 28, 0.12);
  transform: translateY(-1px);
}

.isp-map-results-toggle:active {
  transform: translateY(0);
}

.isp-map-results-toggle:focus-visible {
  outline: 2px solid #34d399;
  outline-offset: 2px;
}

/* Quiet / secondary pill */
.isp-map-results-section[data-results="open"] .isp-map-results-toggle--show,
.isp-map-results-section[data-results="closed"] .isp-map-results-toggle--hide {
  opacity: 0.55;
  font-weight: 700;
  background: #f8fafc;
  border-color: rgba(100, 116, 139, 0.25);
  color: #475569;
  box-shadow: none;
}

/* Primary pill — the action that changes state */
.isp-map-results-section[data-results="open"] .isp-map-results-toggle--hide,
.isp-map-results-section[data-results="closed"] .isp-map-results-toggle--show {
  opacity: 1;
  color: #ecfdf5;
  border-color: transparent;
  background: linear-gradient(165deg, #14532d 0%, #01411c 58%, #0a3d24 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 22px rgba(1, 65, 28, 0.22);
}

.isp-map-results-section[data-results="open"] .isp-map-results-toggle--hide:hover,
.isp-map-results-section[data-results="closed"] .isp-map-results-toggle--show:hover {
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 22px rgba(52, 211, 153, 0.38);
}

.isp-map-results-section__body {
  padding-top: 0.35rem;
  padding-inline: clamp(0.65rem, 2.5vw, 1.25rem);
  max-height: 6000px;
  opacity: 1;
  transform: translateY(0);
  overflow: hidden;
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.28s ease,
    transform 0.28s ease;
}

.isp-map-results-section--collapsed .isp-map-results-section__body {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  padding-top: 0;
  margin: 0;
}

.isp-map-empty {
  text-align: center;
  color: #64748b;
  font-size: 1rem;
  padding: 2rem 1rem;
  margin: 0;
}

.isp-map-results-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

@media (min-width: 700px) {
  .isp-map-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1080px) {
  .isp-map-results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.isp-map-results-grid > li {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  min-width: 0;
}

.isp-office-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 100%;
  text-align: left;
  padding: 1.1rem 1.15rem 1.05rem;
  border: 1px solid rgba(1, 65, 28, 0.1);
  border-left: 4px solid #01411c;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: #0f172a;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  -webkit-appearance: none;
  appearance: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.isp-office-card:hover,
.isp-office-card:focus-visible {
  transform: translateY(-4px);
  box-shadow:
    0 16px 36px -12px rgba(1, 65, 28, 0.18),
    0 6px 16px rgba(15, 23, 42, 0.08);
  border-color: rgba(52, 211, 153, 0.55);
  border-left-color: #059669;
  outline: none;
}

.isp-office-card--active {
  border-color: rgba(1, 65, 28, 0.35);
  box-shadow:
    0 0 0 2px rgba(52, 211, 153, 0.35),
    0 8px 24px rgba(1, 65, 28, 0.12);
}

.isp-office-card--hover {
  border-color: rgba(52, 211, 153, 0.28);
}

.isp-office-card__provider {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #14532d;
  margin-bottom: 0.35rem;
}

.isp-office-card__name {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  color: #0f172a;
  margin: 0 0 0.5rem;
}

.isp-office-card__loc {
  font-size: 0.9rem;
  font-weight: 650;
  color: #334155;
  margin: 0 0 0.85rem;
}

.isp-office-card__rows {
  display: grid;
  gap: 0.45rem;
  margin-top: auto;
  font-size: 0.86rem;
  line-height: 1.45;
}

.isp-office-card__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: baseline;
}

.isp-office-card__k {
  font-weight: 750;
  color: #64748b;
  min-width: 4.5rem;
}

.isp-office-card__v {
  font-weight: 650;
  color: #1e293b;
  word-break: break-word;
}

.isp-office-card__v a {
  color: #14532d;
  font-weight: 800;
  text-decoration: none;
}

.isp-office-card__v a:hover {
  text-decoration: underline;
}

.isp-office-card__trust {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(1, 65, 28, 0.06);
}

.isp-office-card__trust .trust-strip--inline {
  gap: 0.3rem 0.45rem;
}

.isp-office-card__foot {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(1, 65, 28, 0.08);
  font-size: 0.82rem;
  font-weight: 800;
  color: #14532d;
}

.isp-office-card__foot-icon {
  flex-shrink: 0;
  color: #059669;
}

.isp-office-card__foot-text {
  letter-spacing: 0.02em;
}

/* Leaflet + cluster */
.isp-map-frame .leaflet-container {
  font-family: var(--font-sans);
  background: #e8edf2;
}

.isp-map-frame .leaflet-control-zoom a {
  color: #01411c;
}

.marker-cluster-small {
  background-color: rgba(14, 90, 43, 0.55);
}
.marker-cluster-small div {
  background-color: rgba(1, 65, 28, 0.88);
  color: #fff;
  font-weight: 800;
}

.marker-cluster-medium {
  background-color: rgba(63, 143, 92, 0.5);
}
.marker-cluster-medium div {
  background-color: rgba(10, 82, 48, 0.92);
  color: #fff;
}

.marker-cluster-large {
  background-color: rgba(143, 217, 170, 0.45);
}
.marker-cluster-large div {
  background-color: rgba(1, 65, 28, 0.95);
  color: #fff;
}

.isp-pin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.isp-pin--ptcl {
  background: #01411c;
}
.isp-pin--stormfiber {
  background: #0a5a2b;
}
.isp-pin--nayatel {
  background: #166534;
}
.isp-pin--jazz {
  background: #15803d;
}
.isp-pin--zong {
  background: #22c55e;
}
.isp-pin--optix {
  background: #14532d;
}
.isp-pin--connect {
  background: #166534;
}
.isp-pin--fiberlink {
  background: #14532d;
}
.isp-pin--transworld {
  background: #052e16;
}
.isp-pin--wateen {
  background: #0f3d24;
}
.isp-pin--generic {
  background: #6ee7b7;
  border-color: #01411c;
}

.isp-pin--highlight {
  box-shadow: 0 0 0 4px rgba(110, 231, 183, 0.95), 0 4px 18px rgba(1, 65, 28, 0.45);
  transform: scale(1.12);
  z-index: 1000 !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 14px;
  border: 1px solid rgba(1, 65, 28, 0.15);
}

.leaflet-popup-content {
  margin: 0.75rem 1rem;
  min-width: 14rem;
  max-width: 22rem;
}

.isp-popup {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}

.isp-popup__head {
  margin-bottom: 0.35rem;
}

.isp-popup__loc {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--text-heading);
}

.isp-popup__addr {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
}

.isp-popup__row {
  display: flex;
  gap: 0.35rem 0.55rem;
  margin: 0.22rem 0;
  align-items: baseline;
  font-size: 0.84rem;
}

.isp-popup__k {
  flex: 0 0 auto;
  min-width: 5.2rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.isp-popup__v {
  flex: 1 1 auto;
  font-weight: 650;
  word-break: break-word;
}

.isp-popup__coverage {
  margin: 0.45rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}

.isp-popup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(1, 65, 28, 0.1);
}

.isp-popup__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.65rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.isp-popup__action--primary {
  background: linear-gradient(135deg, rgba(0, 255, 140, 0.22), rgba(20, 184, 166, 0.12));
  border-color: rgba(1, 90, 50, 0.28);
  color: #01411c;
}

.isp-popup__action--primary:hover {
  border-color: rgba(1, 90, 50, 0.45);
  background: linear-gradient(135deg, rgba(0, 255, 140, 0.32), rgba(20, 184, 166, 0.18));
}

.isp-popup__action--secondary {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(1, 65, 28, 0.14);
  color: var(--text-heading);
}

.isp-popup__action--secondary:hover {
  border-color: rgba(1, 65, 28, 0.28);
  background: #fff;
}

.isp-popup__cite {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.isp-popup__prov {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--flag-green);
}

.isp-popup__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-heading);
}

.isp-popup__trust {
  margin: 0 0 0.45rem;
}

.isp-popup__trust .trust-strip--inline {
  gap: 0.3rem 0.45rem;
}

.isp-popup__a {
  color: #14532d;
  font-weight: 700;
}

[dir="rtl"] .isp-popup__row {
  flex-direction: row-reverse;
}

[dir="rtl"] .isp-popup__actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .isp-map-search-combo__row {
  flex-direction: row-reverse;
}

[dir="rtl"] .isp-office-card__row {
  flex-direction: row-reverse;
}
