/* ============================================================
   Unified Global Presence Map Component
   ============================================================ */

.map-module {
  display: grid;
  grid-template-columns: 1.5fr 0.5fr;
  gap: 20px;
  align-items: stretch;
  height: 540px;
  margin: 0 auto;
}

@media (max-width: 1180px) {
  .map-module { 
    grid-template-columns: 1fr; 
    height: auto;
  }
}

/* ── Main Map Card ────────────────────────────────────────── */
.map-card {
  position: relative;
  background: rgba(10, 15, 30, 0.4);
  backdrop-filter: blur(20px);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.map-bg {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: 
    opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  filter: brightness(0.85) contrast(1.1); /* Base state */
}

.map-card:hover .map-bg {
  transform: scale(1.03);
  filter: brightness(1.1) contrast(1.2); /* Boost state (Brighter!) */
}

.map-bg.active {
  opacity: 1;
}

.map-bg img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
}

.map-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 20%, rgba(4, 8, 18, 0.4) 100%);
  pointer-events: none;
}

.map-grid-overlay {
  position: absolute;
  inset: 0;
  background-size: 40px 40px;
  pointer-events: none;
}

.map-scan {
  position: absolute;
  top: 0; left: 0; right: 0; height: 150px;
  background: linear-gradient(180deg, 
    transparent 0%, 
    rgba(99, 169, 255, 0.08) 50%, 
    transparent 100%
  );
  z-index: 25; /* Above label, below pin */
  animation: scan 8s linear infinite;
  pointer-events: none;
}

@keyframes scan {
  0% { transform: translateY(-150px); }
  100% { transform: translateY(540px); }
}

/* ── Glowing Map Pin (Highlighter) ────────────────────────── */
.map-pin {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 30; /* Topmost element */
  transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  border: 2px solid #fff;
  box-shadow: 0 0 20px currentColor;
}

.map-pin::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.5;
  animation: pinPulse 2s cubic-bezier(0.23, 1, 0.32, 1) infinite;
}

@keyframes pinPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(4); opacity: 0; }
}

/* ── Map Label HUD (Main) ─────────────────────────────────── */
.map-label {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 20;
  max-width: 520px;
  padding: 32px;
  background: rgba(4, 8, 18, 0.74);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.map-label * {
  pointer-events: auto;
}

.map-label .eyebrow-lite {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffd8bf;
  margin-bottom: 12px;
}

.map-label .eyebrow-lite::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff8a33, #ff6600);
  box-shadow: 0 0 12px rgba(255, 102, 0, 0.42);
}

.map-title {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #fff;
  margin-bottom: 12px;
}

.map-address {
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 20px;
}

.map-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.map-actions .btn {
  padding: 14px 20px;
  font-size: 14px;
  border-radius: 16px;
  font-weight: 700;
  transition: all 0.24s cubic-bezier(0.22, 0.9, 0.25, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  color: #fff;
  border: 0;
  background: linear-gradient(180deg, #ff8a33, #ff6600);
  box-shadow: 0 12px 24px rgba(255, 102, 0, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(255, 102, 0, 0.24);
}

.btn-secondary {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 102, 0, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

/* ── Side Panel ───────────────────────────────────────────── */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dynamic-info-card {
  padding: 26px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dynamic-info-card .text-card {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
}

.dynamic-info-card .big {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.1;
}

.dynamic-info-card .small {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* ── Mini Map Navigation Grid ────────────────────────────── */
.mini-map-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  flex-grow: 1;
}

.mini-map-btn {
  position: relative;
  width: 100%;
  height: 110px; /* Restored to fit within the 540px height with 1.5fr/0.5fr ratio */
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #040812;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mini-map-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.mini-map-btn.active {
  border-color: var(--orange);
  box-shadow: 0 0 20px rgba(255, 102, 0, 0.15);
}

.mini-map-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.6) saturate(0.8);
  transition: filter 0.3s ease;
}

.mini-map-btn:hover .mini-map-bg,
.mini-map-btn.active .mini-map-bg {
  filter: brightness(0.85) saturate(1);
}

.mini-map-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(4, 8, 18, 0.8) 100%);
}

.mini-map-label {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 12px 14px;
  background: rgba(10, 15, 30, 0.74);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  z-index: 5;
  pointer-events: none;
}

.mini-map-label strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
  letter-spacing: -0.02em;
}

.mini-map-label span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.mini-map-pin {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  box-shadow: 0 0 8px currentColor;
}

/* ── Mobile Animation Kill Switch (max-width: 900px) ───────────────────────
   Halts map scan overlay and pin pulse loops on mobile to eliminate
   continuous gradient translation and scale repaints.
────────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Moving gradient scan line — renders over a 540px container continuously */
  .map-scan {
    animation: none !important;
    display: none !important;
  }

  /* Per-pin scale/opacity pulse loops — multiple active elements */
  .map-pin::after {
    animation: none !important;
    transform: scale(1.5) !important;
    opacity: 0.4 !important;
  }

  /* ── Filter & Backdrop-Filter Reduction ─────────────────────────────────
     .map-bg carries a filter: brightness/contrast transition that fires on
     every JS-driven location swap. filter forces GPU rasterization on each
     transition tick. Stripping it to opacity-only eliminates that cost.
     Fallback: background on .map-label and .mini-map-label is already
     rgba(4,8,18,0.74) / rgba(10,15,30,0.74) — opaque enough without blur.
  ─────────────────────────────────────────────────────────────────────── */
  .map-bg {
    transition: opacity 0.5s ease !important;
    filter: none !important;
  }

  /* Hover filter on .map-card is inert on touch screens — active GPU cost */
  .map-card:hover .map-bg {
    transform: none !important;
    filter: none !important;
  }

  /* Remove two independent composited blur stacking contexts during scroll */
  .map-label {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(4, 8, 18, 0.92) !important;
  }

  .mini-map-label {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(10, 15, 30, 0.92) !important;
  }
}

@media (max-width: 768px) {
  .map-label,
  .mini-map-grid,
  .map-pin {
    display: none !important;
  }
  /* Let the map card breathe */
  .map-card {
    min-height: 320px;
  }
}
