@font-face {
  font-family: "MuangthaicapModern-Regular";
  src:
    url("/assets/fonts/MuangthaicapModern-Regular.ttf")
    format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "MuangthaicapText-Regular";
  src:
    url("/assets/fonts/MuangthaicapText-Regular.ttf")
    format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.page-branch-locator {
  --branch-primary: #0098dc;
  --branch-primary-hover: #0070c0;
  --branch-text: #4f4f4f;
  --branch-muted: #e0e0e0;
}

/* Navigation path */

.page-branch-locator .branch-locator-breadcrumb__inner {
  padding-block: 21.4px 42.24px;
}

.page-branch-locator .branch-locator-breadcrumb__list {
  display: flex;
  align-items: center;
  gap: 3px;

  margin: 0;
  padding: 0;

  list-style: none;

  font-family:
    var(
      --font-brand-medium,
      "MuangthaicapModern-Regular",
      sans-serif
    );
  font-size: 12px;
  line-height: 1;
}

.page-branch-locator .branch-locator-breadcrumb__home {
  color: #a6a6a6;
  text-decoration: none;
}

.page-branch-locator .branch-locator-breadcrumb__home:hover {
  color: var(--branch-primary);
}

.page-branch-locator .branch-locator-breadcrumb__separator {
  color: #404040;
}

.page-branch-locator .branch-locator-breadcrumb__current {
  color: var(--branch-primary);
}

/* Main layout */

.page-branch-locator .branch-locator {
  min-height: 0;

  /*
   * ยกเลิก overflow: hidden ที่ติดมาจาก .branch-locator
   * ใน site.css เดิม เพื่อให้ position: sticky ของแผนที่
   * อ้างอิงการ Scroll ของหน้าเว็บได้ตามปกติ
   */
  overflow: visible;

  /*
   * ลดพื้นที่ก่อน Footer:
   * เดิมสูง 64–96px จึงเกิดช่องว่างมากเกินไป
   * ค่านี้จะได้ระยะใกล้ต้นฉบับ แต่ยังยืดหยุ่นตามหน้าจอ
   */
  padding-bottom: clamp(40px, 3vw, 48px);

  background: #ffffff;
}

.page-branch-locator .branch-locator__container {
  height: auto;
}

.page-branch-locator .branch-locator__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 16px;
  align-items: stretch;

  padding-top: 8px;
}

.page-branch-locator .branch-locator__panel {
  min-width: 0;
  padding: 26px 0 0 12px;
}

.page-branch-locator .branch-locator__title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;

  margin: 0 0 20px;

  color: var(--branch-text);
  font-family: "MuangthaicapModern-Regular", sans-serif;
  font-size: clamp(22.8px, 1.4725vw, 26.6px);
  font-weight: 400;
  line-height: 1.15;
  white-space: nowrap;
}

.page-branch-locator .branch-locator__title-icon {
  display: block;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.page-branch-locator .branch-locator__title-muted {
  color: var(--branch-text);
}

.page-branch-locator .branch-locator__title-primary {
  color: var(--branch-primary);
}

/*
 * ซ่อน Label ไว้สำหรับโปรแกรมอ่านหน้าจอ
 * ปัจจุบัน class นี้ยังไม่มี CSS จึงทำให้ข้อความ
 * “ค้นหาสาขา” แสดงอยู่เหนือช่อง Input
 */
.page-branch-locator .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;

  margin: -1px;
  padding: 0;

  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Tabs */

.page-branch-locator .branch-locator-tabs {
  position: relative;
  display: grid;

  /*
   * Tab แรก: “พิมพ์เพื่อค้นหา” = 40%
   * Tab สอง: “ค้นหาจังหวัด อำเภอ ตำบล” = 60%
  */
  grid-template-columns: 2fr 3fr;
  margin-inline: 20px;
}

.page-branch-locator .branch-locator-tabs::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--branch-muted);
  content: "";
  pointer-events: none;
}

.page-branch-locator .branch-locator-tabs__button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  min-height: 42px;
  padding: 0 10px;

  border: 0;
  background: transparent;
  color: #bdbdbd;
  cursor: pointer;

  font-family: "MuangthaicapModern-Regular", sans-serif;
  font-size: clamp(12.75px, 0.935vw, 14.45px);
  font-weight: 400;

  transition:
    color 220ms ease;
}

.page-branch-locator .branch-locator-tabs__button::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: transparent;
  content: "";
  pointer-events: none;
  transition: background-color 220ms ease;
}

.page-branch-locator .branch-locator-tabs__button svg {
  width: 20px;
  height: 20px;

  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.page-branch-locator .branch-locator-tabs__button.is-active {
  color: var(--branch-primary);
}

.page-branch-locator .branch-locator-tabs__button.is-active::after {
  background: var(--branch-primary);
}

/* Search */

.page-branch-locator .branch-locator-search {
  padding-top: 19px;
}

.page-branch-locator .branch-locator-search__input {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  padding: 0 20px;

  border: 1px solid #d1d5db;
  border-radius: 5px;
  outline: 0;
  color: var(--branch-text);

  font-family: "MuangthaicapText-Regular", sans-serif;
  font-size: 15px;
}

.page-branch-locator .branch-locator-search__input:focus {
  border-color: var(--branch-primary);
  box-shadow: 0 0 0 3px rgb(0 152 220 / 14%);
}

.page-branch-locator .branch-locator-search__submit,
.page-branch-locator .branch-locator-search__nearby {
  width: 100%;
  height: 45px;

  border-radius: 5px;

  font-family: "MuangthaicapModern-Regular", sans-serif;
  font-size: 15.3px;
  font-weight: 400;
  cursor: pointer;

  transition:
    background-color 350ms ease,
    color 350ms ease,
    border-color 350ms ease;
}

.page-branch-locator .branch-locator-search__submit {
  margin-top: 30px;

  border: 1px solid var(--branch-primary);
  background: var(--branch-primary);
  color: #ffffff;
}

.page-branch-locator .branch-locator-search__submit:hover {
  background: var(--branch-primary-hover);
  border-color: var(--branch-primary-hover);
}

.page-branch-locator .branch-locator-search__divider {
  display: flex;
  align-items: center;
  gap: 10px;

  margin: 12px 21px;
  color: #8b8b8b;

  font-family: "MuangthaicapModern-Regular", sans-serif;
  font-size: 14.4px;
}

.page-branch-locator .branch-locator-search__divider::before,
.page-branch-locator .branch-locator-search__divider::after {
  flex: 1;
  height: 1px;
  background: var(--branch-muted);
  content: "";
}

.page-branch-locator .branch-locator-search__nearby {
  border: 1px solid var(--branch-primary);
  background: #ffffff;
  color: var(--branch-primary);
}

.page-branch-locator .branch-locator-search__nearby:hover {
  background: var(--branch-primary);
  color: #ffffff;
}

.page-branch-locator .branch-locator-results {
  height: clamp(348px, calc(22vw - 12px), 402px);
  min-height: 0;
  margin-top: 15px;
  overflow-y: auto;

  border: 1px solid #f0f0f0;
  border-radius: 10px;
  background: #ffffff;

  scroll-behavior: smooth;
}

.page-branch-locator .branch-results__message {
  margin: 0;
  padding: 24px 20px;

  color: #4b4d4c;
  font-family: "MuangthaicapText-Regular", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.page-branch-locator .branch-result {
  min-height: 92px;
  border-bottom: 1px solid #e4e4e4;
  background: #ffffff;
}

.page-branch-locator .branch-result:last-child {
  border-bottom: 0;
}

.page-branch-locator .branch-result__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  min-height: 92px;
  padding: 0 32px 0 40px;
}

.page-branch-locator .branch-result__name {
  margin: 0;

  color: #4b4d4c;
  font-family: var(
    --font-brand-medium,
    "MuangthaicapModern-Regular",
    sans-serif
  );
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}

.page-branch-locator
  .branch-result:not(.is-active)
  .branch-result__name {
  font-size: 14.5px;
  font-weight: 500;
}

.page-branch-locator .branch-result__toggle {
  display: grid;
  flex: 0 0 auto;
  place-items: center;

  width: 34px;
  height: 34px;
  padding: 0;

  border: 0;
  background: transparent;
  color: var(--branch-primary);
  cursor: pointer;
}

.page-branch-locator .branch-result__toggle svg {
  width: 23px;
  height: 23px;

  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 250ms ease;
}

.page-branch-locator .branch-result.is-active {
  min-height: 0;
  background: #f0fafd;
}

.page-branch-locator .branch-result.is-active .branch-result__toggle svg {
  transform: rotate(180deg);
}

.page-branch-locator .branch-result.is-active .branch-result__summary {
  box-sizing: border-box;
  align-items: flex-start;

  min-height: 0;
  padding: 35px 32px 12px 40px;
}

.page-branch-locator
  .branch-result.is-active.has-multiline-name
  .branch-result__summary {
  padding-bottom: 25px;
}

.page-branch-locator .branch-result.is-active .branch-result__toggle {
  visibility: hidden;
  pointer-events: none;
}

.page-branch-locator .branch-result:not(.is-active) .branch-result__details {
  display: none;
}

.page-branch-locator .branch-result__details {
  padding: 0 40.5px 35px;
}

.page-branch-locator .branch-result.is-active .branch-result__name {
  font-size: 14.5px;
  font-weight: 600;
}

.page-branch-locator .branch-result.is-active .branch-result__address,
.page-branch-locator .branch-result.is-active .branch-result__info,
.page-branch-locator .branch-result.is-active .branch-result__phone {
  font-size: 14px;
}

.page-branch-locator .branch-result.is-active .branch-result__phone a {
  font-size: 14px;
}

.page-branch-locator .branch-result__address,
.page-branch-locator .branch-result__info,
.page-branch-locator .branch-result__phone {
  margin: 0;

  color: #4b4d4c;
  font-family: "MuangthaicapText-Regular", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.page-branch-locator .branch-result__address,
.page-branch-locator .branch-result__info {
  margin-bottom: 15.6px;
}

.page-branch-locator .branch-result__phone {
  margin-bottom: 15.25px;
}

.page-branch-locator .branch-result__info,
.page-branch-locator .branch-result__phone {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.page-branch-locator .branch-result__info-icon {
  display: inline-flex;
  flex: 0 0 21.6px;
  justify-content: flex-end;
  padding-top: 2px;

  color: var(--branch-primary);
}

.page-branch-locator .branch-result__info-icon img {
  display: block;

  width: 18px;
  height: 18px;
  object-fit: contain;
}

.page-branch-locator
  .branch-result__info
  .branch-result__info-icon
  img {
  width: 21.6px;
  height: 21.6px;
}

.page-branch-locator .branch-result__phone a {
  color: var(--branch-primary);
  font-family: var(
    --font-brand-medium,
    "MuangthaicapModern-Regular",
    sans-serif
  );
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.page-branch-locator .branch-result__directions {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-width: 0;
  height: 47.6px;
  margin-top: 2px;
  padding: 0;

  border-radius: 5px;
  background: #feef3d;
  color: var(--branch-primary);

  font-family: var(
    --font-brand-medium,
    "MuangthaicapModern-Regular",
    sans-serif
  );
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;

  transition:
    background-color 350ms ease,
    color 350ms ease;
}

.page-branch-locator .branch-result__directions:hover {
  background: var(--branch-primary);
  color: #ffffff;
}

.page-branch-locator .branch-result__phone a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Province / district / subdistrict filter */

.page-branch-locator .branch-locator-filter {
  padding-top: 26px;
}

.page-branch-locator .branch-locator-filter__field {
  position: relative;
  margin-top: 10.8px;
}

.page-branch-locator .branch-locator-filter__field:first-child {
  margin-top: 0;
}

.page-branch-locator .branch-locator-filter__select {
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  height: 40.5px;
  padding: 0 55px 0 20px;

  border: 1px solid #d1d5db;
  border-radius: 5px;
  outline: 0;
  background: #ffffff;
  color: #858585;
  cursor: pointer;

  font-family: "MuangthaicapText-Regular", sans-serif;
  font-size: 16px;
}

.page-branch-locator .branch-locator-filter__select:focus {
  border-color: var(--branch-primary);
  box-shadow: 0 0 0 3px rgb(0 152 220 / 14%);
}

.page-branch-locator .branch-locator-filter__select:disabled {
  background: #ffffff;
  color: #ababab;
  cursor: not-allowed;
  opacity: 1;
}

.page-branch-locator .branch-locator-filter__arrow {
  position: absolute;
  top: 50%;
  right: 38px;

  width: 0;
  height: 0;

  border-top: 10px solid var(--branch-primary);
  border-right: 8px solid transparent;
  border-left: 8px solid transparent;

  pointer-events: none;
  transform: translateY(-40%);
}

.page-branch-locator .branch-locator-filter__submit {
  width: 100%;
  height: 45px;
  margin-top: 27.2px;

  border: 1px solid var(--branch-primary);
  border-radius: 5px;
  background: var(--branch-primary);
  color: #ffffff;
  cursor: pointer;

  font-family: "MuangthaicapModern-Regular", sans-serif;
  font-size: 15.3px;
  font-weight: 400;

  transition:
    background-color 350ms ease,
    border-color 350ms ease;
}

.page-branch-locator .branch-locator-filter__submit:hover {
  border-color: var(--branch-primary-hover);
  background: var(--branch-primary-hover);
}

.page-branch-locator .branch-locator-filter__submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

/* Map */

.page-branch-locator .branch-locator__map {
  position: static;
  align-self: stretch;

  min-height: 0;
  overflow: hidden;
}

.page-branch-locator .branch-locator__map iframe,
.page-branch-locator .branch-locator__map-canvas {
  display: block;
  width: 100%;
  height: 100%;

  border: 0;
}

/* Tablet / mobile */

@media (max-width: 1024px) {
  .page-branch-locator .branch-locator__layout {
    grid-template-columns: 1fr;
  }

  .page-branch-locator .branch-locator__map {
    position: static;
    aspect-ratio: 16 / 10;
    min-height: 0;
  }
}

@media (max-width: 800px) {
  .page-branch-locator .branch-locator-tabs__button {
    min-height: 48px;
    justify-content: flex-start;
    font-size: 14px;
  }

  .page-branch-locator .branch-locator__title {
    font-size: 25px;
  }
}

@media (max-width: 480px) {
  .page-branch-locator .branch-locator-tabs {
    margin-inline: 0;
  }

  .page-branch-locator .branch-locator-tabs__button {
    min-height: 56px;
    gap: 7px;
    padding-inline: 7px;
    font-size: 13px;
    line-height: 1.25;
  }

  .page-branch-locator .branch-locator-tabs__button svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
  }
}
