
.ion-service-area,
.ion-service-area *,
.ion-service-area *::before,
.ion-service-area *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.ion-service-area {
  --ion-navy-950: #0f1e2e;
  --ion-navy-800: #182d43;
  --ion-navy-700: #1e3552;
  --ion-amber-700: #7a4014;
  --ion-amber-500: #e6a23c;
  --ion-amber-300: #f4c77a;
  --ion-white: #ffffff;
  --ion-sun-cream: #fbefdd;
  --ion-cream: #faf6ef;
  --ion-warm-panel: #f3ece0;
  --ion-text-body: #2c3540;
  --ion-text-muted: #66707c;
  --ion-border-warm: #e4dbcd;
  --ion-border: rgba(24,45,67,0.12);

  font-family: "Barlow Semi Condensed", "Prompt", sans-serif;
  position: relative;
  overflow: hidden;
  padding: 72px 24px 78px;
  color: var(--ion-text-body);
  background:
    radial-gradient(circle at 88% 12%, rgba(230,162,60,0.18) 0%, rgba(230,162,60,0) 32%),
    linear-gradient(180deg, var(--ion-cream) 0%, var(--ion-warm-panel) 100%);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

.ion-service-area::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(860px, 90vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(230,162,60,0.42), transparent);
  pointer-events: none;
}

.ion-service-area__inner {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
}

.ion-service-area__header {
  text-align: center;
  margin-bottom: 46px;
}

.ion-service-area__h2 {
  font-family: "Barlow Semi Condensed", "Prompt", sans-serif;
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  font-weight: 700;
  color: var(--ion-navy-800);
  line-height: 1.55;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.ion-service-area__rule {
  width: 92px;
  height: 3px;
  margin: 0 auto;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--ion-amber-500), var(--ion-amber-300), transparent);
  box-shadow: 0 0 16px rgba(230,162,60,0.18);
}

.ion-region-flex-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  align-items: stretch;
}

.ion-region-card {
  position: relative;
  overflow: hidden;
  flex: 0 1 calc(33.333% - 16px);
  min-width: 320px;
  padding: 30px 25px;
  border-radius: 24px;
  text-align: center;
  background: transparent;
  border: 1px solid var(--ion-border);
  box-shadow:
    0 16px 38px rgba(15,30,46,0.06),
    inset 0 1px 0 rgba(255,255,255,0.70);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;

  /* Perf: ข้าม render การ์ดที่ยังไม่เลื่อนถึง (auto = จำขนาดจริงหลัง render ครั้งแรก) */
  content-visibility: auto;
  contain-intrinsic-size: auto 340px;
}

.ion-region-card:hover {
  transform: translateY(-5px);
  border-color: rgba(230,162,60,0.68);
  background: transparent;
  box-shadow:
    0 20px 46px rgba(15,30,46,0.09),
    0 0 20px rgba(230,162,60,0.10),
    inset 0 1px 0 rgba(255,255,255,0.78);
}

.ion-region-shine {
  position: absolute;
  top: 0;
  left: 18%;
  width: 64%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ion-amber-500), transparent);
  pointer-events: none;
}

.ion-region-header {
  display: block;
  width: 100%;
  margin-bottom: 20px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--ion-border);
  font-family: "Barlow Semi Condensed", "Prompt", sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ion-navy-800);
  line-height: 1.5;
}

.ion-province-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.ion-p-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--ion-border);
  color: var(--ion-text-muted);
  font-family: "Barlow Semi Condensed", "Prompt", sans-serif;
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.35;
  text-decoration: none;
  user-select: none;
}

/* transition เฉพาะ pill ที่เป็นลิงก์ (มี hover) — ลด style recalc บน pill ทั่วไป */
a.ion-p-pill.active {
  background: var(--ion-sun-cream);
  border-color: var(--ion-amber-500);
  color: var(--ion-amber-700);
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

a.ion-p-pill.active:hover,
a.ion-p-pill.active:focus {
  transform: translateY(-2px);
  background: var(--ion-amber-500);
  border-color: var(--ion-amber-500);
  color: var(--ion-navy-950);
  box-shadow: 0 8px 18px rgba(122,64,20,0.16);
}

a.ion-p-pill.active:focus-visible {
  outline: 3px solid var(--ion-amber-700);
  outline-offset: 3px;
}

@media (max-width: 1024px) {
  .ion-service-area {
    padding: 66px 22px 74px;
  }

  .ion-region-flex-container {
    gap: 18px;
  }

  .ion-region-card {
    flex: 0 1 calc(50% - 9px);
    min-width: 300px;
    padding: 28px 22px;
  }
}

@media (max-width: 768px) {
  .ion-service-area {
    padding: 56px 18px 62px;
  }

  .ion-service-area__header {
    margin-bottom: 38px;
  }

  .ion-service-area__h2 {
    font-size: clamp(1.35rem, 6vw, 1.7rem);
  }

  .ion-region-flex-container {
    flex-direction: column;
    gap: 16px;
  }

  .ion-region-card {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    padding: 28px 20px;
    border-radius: 20px;
  }

  .ion-region-header {
    font-size: 1.08rem;
  }

  .ion-p-pill {
    font-size: 0.82rem;
    min-height: 30px;
    padding: 6px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ion-region-card,
  a.ion-p-pill.active {
    transition: none;
  }

  .ion-region-card:hover,
  a.ion-p-pill.active:hover,
  a.ion-p-pill.active:focus {
    transform: none;
  }
}
