/* Layout helpers */
.presence{ padding:42px 0 80px; }

.eyebrow{ 
  color:var(--color-primary); 
  text-align:center; 
  margin:0 0 6px; 
  font-weight:400; 
}
.presence__title{ 
  text-align:center; 
  margin:0 0 24px; 
  font-size:clamp(22px,3.4vw,42px); 
  font-weight:800; 
}
.presence__desc{ 
  text-align:center; 
  margin:0 auto 48px; 
  max-width:72ch; 
  color:var(--color-muted); 
}

.presence__mapwrap{ 
  display: block;
  z-index:0;
  position:relative; 
  margin: 12px auto 14px; 
  pointer-events:none;
}
.presence__map{ width:100%; height:auto; display:block; }

/* Áp pattern xám cho tất cả nước */
#ne_10m_admin_0_countries path {
  fill: url(#dotGray);
  stroke: #cfd6e4;
  stroke-width: 0.3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* Blue color */
#VN, #KR, #US, #MX, #CN, #MY, #IN, #ID, #TH, #TW { fill: url(#dotBlue) !important; }
/* EU */
#TR, #SI, #SK, #DE {
  fill: url(#dotBlue) !important;
}


/* Country with office */
.country.has-office{ filter:hue-rotate(200deg) saturate(3) brightness(1.05); }

/* Markers */
.map-marker{
  position:absolute; 
  pointer-events: auto;
  z-index: 2;
  width:16px; 
  height:16px; 
  aspect-ratio:1 / 1;
  border-radius:50%;
  background:var(--color-primary); border:2px solid #fff; 
  transform:translate(-50%,-50%);
  box-shadow:0 0 0 4px rgba(59,91,255,.14);
  contain:layout paint;
}
.map-marker:after{ 
  content:""; 
  position:absolute; 
  inset:-4px; 
  border-radius:50%;
  box-shadow:0 0 18px rgba(59,91,255,.45); }

/* Tooltip */
.map-tip{
  position:fixed;
  z-index:9999;
  padding:10px 12px; 
  border-radius:10px; 
  background:#fff;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
  font-size:14px; 
  line-height:1.35; 
  max-width:320px;
  transform:translate(-50%,0);
  opacity:0; 
  pointer-events:none; 
  transition:opacity .15s ease;
}

/* mũi tên */
.map-tip::after{
  content:"";
  position:absolute;
  top:-10px;
  left: var(--arrow-left, 50%);  /* đọc từ JS, mặc định 50% */
  transform: translateX(-50%);
  border-width:6px; 
  border-style:solid;
  border-color: transparent transparent #fff transparent;
  filter: drop-shadow(0 -2px 2px rgba(0,0,0,.08));
}
.map-tip.show{ opacity:1;  pointer-events:auto; }
.map-tip .tip-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.map-tip .tip-addr {
  opacity: .85;
}

/* Legend */
.presence__legend{
  display:flex; 
  gap:32px; 
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
  margin:24px auto 0; 
  color:var(--color-text); 
  font-size:16px;
}
.legend-item{ 
  display:inline-flex; 
  align-items:center; 
  gap:12px; 
}

/* swatch 24×16 nhưng pattern 8×8, dot r=2.5 tại (5,5) */
.legend-swatch{
  width:24px;
  height:24px;
  border-radius:3px; 
  display:inline-block;
  border:1px solid #cfd6e4;
  background: radial-gradient(circle 2.5px at 5px 5px, #4eabff 99%, transparent 100%) 0 0/8px 8px repeat;
}

.legend-marker{
  width:16px; height:16px; border-radius:50%;
  background:var(--color-primary); border:2px solid #fff;
  box-shadow:0 0 0 5px rgba(59,91,255,.14);
}

/* Offices */
.presence__offices{
  margin:28px auto 26px; 
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:28px;
}
@media (max-width:960px){ 
  .presence__offices{ grid-template-columns:1fr; } 
}
.office-card{
  margin-top: 50px;
  background:#fff;
  box-shadow: 0 0 10px 2px rgba(0, 0, 0, .06);
  border-radius:4px;
  display:flex;
  flex-direction: column;
  padding:24px; }
.office-title{ 
  margin:0 0 8px; 
  font-weight:700; font-size:16px; }
.office-addr{ 
  margin:0 0 10px; 
  color:var(--color-muted);
  font-size: 14px;
}
.office-link{ 
  margin-top:auto;          /* đẩy xuống đáy */
  margin-bottom: 0;
}
.office-link a{ 
  text-decoration:none;
  font-size: 14px; 
  margin:0;
  color:var(--color-primary);
 }
.office-link a:hover{ 
  color:var(--color-primary-hover);
 }
/* CTA */
.presence__cta{ 
  text-align:center; 
  margin-top:50px; 
}
.presence__cta p{ 
  font-weight:700;
  font-size: 1.5rem;
  margin:0 0 12px; }
.btn{
  margin-top: 30px;
  display:inline-block; 
  padding:8px 10px; 
  border-radius:4px; 
}
.btn--primary{ 
  background:var(--color-primary); 
  color:#fff; }
.btn--primary:hover{ 
  background: var(--color-primary-hover); }
