/* Shared modern Header/Menu/Footer styles for non-home pages */
@font-face {
  font-family: "Sarabun";
  src: url("../../../assets/fonts/Sarabun-Regular.ttf") format("truetype");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Sarabun";
  src: url("../../../assets/fonts/Sarabun-Medium.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Sarabun";
  src: url("../../../assets/fonts/Sarabun-SemiBold.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Sarabun";
  src: url("../../../assets/fonts/Sarabun-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Athiti";
  src: url("../../../assets/fonts/Athiti-Regular.ttf") format("truetype");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Athiti";
  src: url("../../../assets/fonts/Athiti-Medium.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Athiti";
  src: url("../../../assets/fonts/Athiti-SemiBold.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Athiti";
  src: url("../../../assets/fonts/Athiti-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --indigo: #1a7c31;
  --indigo-mid: #2e9245;
  --violet: #1f8a3a;
  --violet-lt: #43a85d;
  --purple: #edbe5c;
  --blue-v: #d98d19;
  --sky: #edf7ee;
  --sky-deep: #d9efde;
  --accent: #edbe5c;
  --gold: #edbe5c;
  --gold-lt: #fff3cf;
  --white: #ffffff;
  --gray-50: #f5f8ff;
  --gray-100: #eef3fa;
  --gray-200: #d8e4f0;
  --gray-500: #6b86a8;
  --gray-700: #3a5068;
  --text: #0f2035;
  --radius: 10px;
  --shadow: 0 2px 16px rgba(26, 124, 49, 0.1);
  --shadow-md: 0 6px 28px rgba(26, 124, 49, 0.18);
}

.site-header a,
.topbar a,
footer a {
  text-decoration: none;
}

.footer-bottom a {
  color: inherit;
}

/* Keep footer links identical to home behavior when clicked/focused. */
footer a:focus,
footer a:active {
  outline: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.topbar {
  background: var(--indigo);
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 2px solid var(--accent);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.topbar a {
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.2s;
}
.topbar a:hover {
  color: #fff;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.ticker-label {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}
.ticker-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-width: 0;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 3%,
    black 97%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 3%,
    black 97%,
    transparent 100%
  );
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
  will-change: transform;
}
.ticker-track:hover {
  animation-play-state: paused;
}
.ticker-item {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  padding: 0 16px;
  cursor: default;
}
.ticker-item:hover {
  color: #fff;
}
.ticker-sep {
  color: var(--purple);
  font-size: 10px;
  flex-shrink: 0;
}
@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}
@media (max-width: 600px) {
  .ticker-label {
    display: none;
  }
}
.topbar-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: blink 2s infinite;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
.topbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.tb-group-font {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tb-sep {
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
}
.tb-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}
.tb-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.tb-link.tb-link-plain {
  cursor: default;
  pointer-events: none;
}

.tb-link.tb-link-plain:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
}

.tb-link-tel,
.tb-link-fb {
  pointer-events: auto;
}

.tb-icon-tel,
.tb-icon-fb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tb-link-fb .tb-label-text {
  display: none;
}

.tb-link-fb {
  background: rgba(24, 119, 242, 0.28);
}

.tb-link-fb:hover {
  background: #1877f2;
  color: #fff;
}

.tb-link-fb .tb-icon-fb i {
  font-size: 15px;
  color: #fff;
}

.tb-link-fb:hover .tb-icon-fb i {
  color: #fff;
}

.tb-link-tel:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.font-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  padding: 2px 9px;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Sarabun", sans-serif;
  font-size: 12px;
  transition: background 0.2s;
}
.font-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ï¿½"?ï¿½"?ï¿½"? COVER BANNER ï¿½"?ï¿½"?ï¿½"? */
.site-cover {
  display: block;
}
.cover-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 6;
  height: auto;
  max-height: min(480px, 46vh);
  min-height: clamp(190px, 28vw, 300px);
  background: var(--indigo);
  overflow: hidden;
}
.cover-img-wrap > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}
.cover-img-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(11, 61, 145, 0.22);
  pointer-events: none;
}
/* Floating logo centered on cover */
.cover-logo-float {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  pointer-events: none;
}
.cover-crest-float {
  width: clamp(80px, 11vw, 120px);
  height: clamp(80px, 11vw, 120px);
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 4px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}
.cover-crest-float img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.cover-title-float h1 {
  font-size: clamp(15px, 2.2vw, 24px);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
  margin-bottom: 3px;
}
.cover-title-float p {
  font-size: clamp(11px, 1.2vw, 14px);
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
/* Phone number chip ï¿½?" top right */
.cover-logo-bar {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 4;
}
.cover-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(11, 61, 145, 0.6);
  backdrop-filter: blur(4px);
  padding: 5px 12px;
  border-radius: 20px;
}
.cover-contact a {
  color: #fff;
  font-weight: 600;
}
/* Tagline bottom of cover */
.cover-tagline {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
  color: #fff;
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 700;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 1px 3px rgba(0, 0, 0, 0.4);
  padding: 0 24px;
  letter-spacing: 0.3px;
}
@media (max-width: 500px) {
  .cover-crest-float {
    width: 70px;
    height: 70px;
  }
  .cover-logo-float {
    gap: 6px;
  }
  .cover-logo-bar {
    top: 6px;
    right: 8px;
  }
  .cover-contact {
    font-size: 11px;
    padding: 4px 9px;
  }
  .cover-title-float h1 {
    font-size: clamp(12px, 3.5vw, 15px);
    color: var(--indigo);
    text-shadow: none;
    line-height: 1.35;
    margin: 0 auto 3px;
    padding: 6px 12px;
    display: inline-block;
    max-width: min(92vw, 420px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #fff;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  }
  .cover-tagline {
    display: block;
    font-size: clamp(12px, 3.8vw, 16px);
    line-height: 1.35;
    padding: 0 12px;
    bottom: 6px;
  }
  .cover-title-float p {
    display: none;
  }
  .cover-logo-float {
    top: 42%;
    transform: translate(-50%, -58%);
  }
}

/* ï¿½"?ï¿½"?ï¿½"? HEADER ï¿½"?ï¿½"?ï¿½"? */
.site-header {
  background: var(--white);
  box-shadow: 0 2px 12px rgba(11, 61, 145, 0.1);
  position: relative;
  top: auto;
  z-index: 200;
}
/* Row 1: Logo + contact info */
.header-top {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}
.header-top-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-contact-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-700);
}
.header-contact-item .hci {
  font-size: 15px;
}
.header-contact-item a {
  color: var(--violet);
  font-weight: 600;
}

/* Row 2: Nav bar full width */
.header-nav-bar {
  background: var(--indigo);
  border-top: 0;
}
.nav-bar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  align-items: center;
  width: 100%;
}
.main-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 0;
  width: 100%;
  justify-content: center;
}
.nav-item {
  position: relative;
  flex-shrink: 0;
}
.nav-item::after {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 0;
  width: 1px;
  height: 22px;
  background-color: rgba(237, 190, 92, 0.45);
}
.nav-item:last-child::after {
  display: none;
}
.nav-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 22px 18px;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  transition: all 0.2s;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 0;
}
.nav-link:hover {
  color: var(--gold);
  background: transparent;
  border-bottom-color: transparent;
}
.nav-link.active {
  color: var(--gold);
  background: transparent;
  border-bottom-color: transparent;
}

/* Keep header links consistent with home style on click/focus (override Bootstrap focus ring). */
.site-header a:focus,
.site-header a:active {
  outline: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.site-header .nav-link:focus,
.site-header .nav-link:active {
  background: transparent;
}
.nav-caret {
  font-size: 13px;
  line-height: 1;
  opacity: 0.95;
  transition: transform 0.2s;
}
.nav-item:hover > .nav-link > .nav-caret {
  transform: rotate(180deg);
}

/* ï¿½"?ï¿½"? Level 1 Dropdown ï¿½"?ï¿½"? */
.dropdown {
  position: absolute;
  top: 80%;
  left: 0;
  background: var(--white);
  border-radius: 0;
  box-shadow: var(--shadow-md);
  border: 1px solid #e7ece7;
  min-width: 220px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0);
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 400;
}
.nav-item:hover > .dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
  top: 100%;
}

/* ï¿½"?ï¿½"? Level 1 items ï¿½"?ï¿½"? */
.dropdown > .dd-item {
  position: relative;
}
.dropdown > .dd-item > a,
.dropdown > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 0;
  font-size: 15px;
  color: var(--gray-700);
  transition: all 0.15s;
  gap: 6px;
  border-left: 4px solid var(--indigo);
  border-bottom: 1px solid #eef3ee;
}
.dropdown > .dd-item > a:hover,
.dropdown > a:hover {
  background: var(--indigo);
  color: #fff;
  padding-left: 20px;
  border-left-width: 12px;
}
.dd-caret {
  font-size: 13px;
  line-height: 1;
  opacity: 0.9;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.dd-item:hover > a > .dd-caret {
  transform: rotate(-90deg);
  opacity: 1;
}

/* ï¿½"?ï¿½"? Level 2 Dropdown ï¿½"?ï¿½"? */
.dd-sub {
  position: absolute;
  top: 0;
  left: 100%;
  background: var(--white);
  border-radius: 0;
  box-shadow: var(--shadow-md);
  border: 1px solid #e7ece7;
  min-width: 220px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(0);
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 410;
}
.dd-item:hover > .dd-sub {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

/* ï¿½"?ï¿½"? Level 2 items ï¿½"?ï¿½"? */
.dd-sub > .dd-item2 {
  position: relative;
}
.dd-sub > .dd-item2 > a,
.dd-sub > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: 0;
  font-size: 15px;
  color: var(--gray-700);
  transition: all 0.15s;
  gap: 6px;
  border-left: 4px solid var(--indigo);
  border-bottom: 1px solid #eef3ee;
}
.dd-sub > .dd-item2 > a:hover,
.dd-sub > a:hover {
  background: var(--indigo);
  color: #fff;
  padding-left: 20px;
  border-left-width: 12px;
}

/* ï¿½"?ï¿½"? Level 3 Dropdown ï¿½"?ï¿½"? */
.dd-sub2 {
  position: absolute;
  top: 0;
  left: 100%;
  background: var(--white);
  border-radius: 0;
  box-shadow: var(--shadow-md);
  border: 1px solid #e7ece7;
  min-width: 210px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(0);
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 420;
}
.dd-item2:hover > .dd-sub2 {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}
.dd-sub2 > a {
  display: block;
  padding: 9px 14px;
  border-radius: 0;
  font-size: 15px;
  color: var(--gray-700);
  transition: all 0.15s;
  border-left: 4px solid var(--indigo);
  border-bottom: 1px solid #eef3ee;
}
.dd-sub2 > a:hover {
  background: var(--indigo);
  color: #fff;
  padding-left: 20px;
  border-left-width: 12px;
}

/* ï¿½"?ï¿½"? Divider inside dropdown ï¿½"?ï¿½"? */
.dd-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 4px 8px;
}
.dd-group-label {
  display: block;
  padding: 6px 14px 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--violet);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-left: auto;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: background 0.2s;
}
.hamburger:hover {
  background: rgba(255, 255, 255, 0.2);
}
.ham-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ham-lines span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}
.ham-text {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: "Sarabun", sans-serif;
  letter-spacing: 0.3px;
}

/* ï¿½"?ï¿½"? Mobile Nav ï¿½"?ï¿½"? */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  max-height: 75vh;
  overflow-y: auto;
}
.mobile-nav.is-open {
  display: flex;
}
body.mobile-nav-open {
  overflow: hidden;
}
.mobile-nav .mn-top {
  display: flex;
  align-items: center;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--indigo);
  border-bottom: 1px solid var(--gray-100);
  gap: 8px;
}
.mobile-nav .mn-top:hover {
  background: var(--sky);
}

/* L1 group */
.mn-group {
  border-bottom: 1px solid var(--gray-100);
}
.mn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--indigo);
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}
.mn-head:hover {
  background: var(--sky);
}
.mn-head.open {
  background: var(--sky);
  color: var(--violet);
}
.mn-arrow {
  font-size: 11px;
  transition: transform 0.25s;
  flex-shrink: 0;
}
.mn-head.open .mn-arrow {
  transform: rotate(180deg);
}
.mn-body {
  display: none;
  flex-direction: column;
  background: #f8fbff;
  padding: 4px 0 8px;
  border-top: 1px solid var(--gray-200);
}
.mn-body.open {
  display: flex;
}
.mn-body > a {
  padding: 9px 20px 9px 36px;
  font-size: 14px;
  color: var(--gray-700);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.15s;
}
.mn-body > a:hover {
  background: var(--sky);
  color: var(--violet);
}

/* L2 group */
.mn-group2 {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.mn-head2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 20px 9px 36px;
  font-size: 14px;
  font-weight: 600;
  color: var(--violet);
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}
.mn-head2:hover {
  background: var(--sky-deep);
}
.mn-head2.open {
  background: var(--sky-deep);
}
.mn-arrow2 {
  font-size: 10px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.mn-head2.open .mn-arrow2 {
  transform: rotate(180deg);
}
.mn-body2 {
  display: none;
  flex-direction: column;
  background: #eef6ff;
  border-top: 1px solid var(--sky-deep);
}
.mn-body2.open {
  display: flex;
}
.mn-body2 > a {
  padding: 8px 20px 8px 52px;
  font-size: 13px;
  color: var(--gray-700);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.15s;
}
.mn-body2 > a::before {
  content: "›  ";
  color: var(--violet);
}
.mn-body2 > a:hover {
  background: var(--sky);
  color: var(--violet);
}

footer {
  background: #1a7c31;
  color: rgba(255, 255, 255, 0.75);
  padding: 48px 24px 24px;
}

.footer-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fb h2 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.fb p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
}

footer.modern-footer .fb p a[href^="tel:"] {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

footer.modern-footer .fb p a[href^="tel:"]:hover {
  color: #edbe5c;
}

.social-row {
  display: flex;
  gap: 10px;
}

.soc-btn {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
}

.soc-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

footer .fc h3,
.fc h3 {
  font-family: "Athiti", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.68;
  color: #fff;
  margin: 0 0 12px;
  padding: 0 0 8px;
  border-bottom: 2px solid var(--purple);
  display: inline-block;
  text-transform: none;
  letter-spacing: normal;
}

.fc ul {
  list-style: none;
}

.fc ul li {
  margin-bottom: 8px;
}

.fc ul li a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  transition: all 0.2s;
}

.fc ul li a:hover {
  color: var(--accent);
  padding-left: 6px;
}

.footer-bottom {
  max-width: 1240px;
  margin: 0 auto;
  padding-top: 20px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  width: 100%;
  box-sizing: border-box;
}

.footer-bottom span {
  display: inline;
  white-space: nowrap;
}

.footer-bottom a {
  display: inline;
  white-space: nowrap;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.42s;
  cursor: pointer;
}

.popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.popup-overlay.is-closing {
  pointer-events: none;
}

.popup-overlay.hidden {
  display: none !important;
  pointer-events: none !important;
}

.popup-box {
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  width: fit-content;
  max-width: min(760px, calc(100vw - 40px));
  opacity: 0;
  transform: scale(0.97) translateZ(0);
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
  cursor: default;
}

.popup-overlay.is-open .popup-box {
  opacity: 1;
  transform: scale(1) translateZ(0);
}

@media (prefers-reduced-motion: reduce) {
  .popup-overlay,
  .popup-box {
    transition-duration: 0.01ms !important;
  }
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.popup-banner {
  display: block;
  line-height: 0;
  width: fit-content;
  max-width: min(760px, calc(100vw - 40px));
}

.popup-banner img {
  width: auto;
  height: auto;
  display: block;
  max-width: min(760px, calc(100vw - 40px));
  max-height: min(70vh, 560px);
  object-fit: contain;
}

.cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 800;
  background: linear-gradient(90deg, rgba(26, 124, 49, 0.97), rgba(46, 146, 69, 0.97));
  border-top: 3px solid #edbe5c;
  padding: 14px 24px;
  transition: transform 0.4s ease;
  box-shadow: 0 -4px 24px rgba(26, 124, 49, 0.35);
}

.cookie-bar.hidden {
  transform: translateY(110%);
  pointer-events: none;
}

.cookie-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-text {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.6;
}

.cookie-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.cookie-text strong {
  color: #fff;
  display: block;
  margin-bottom: 2px;
  font-size: 15px;
}

.cookie-text a {
  color: #fff3cf;
}

.cookie-btns {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-accept {
  background: #edbe5c;
  color: #1a4f2a;
  border: none;
  border-radius: 9px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  font-family: "Sarabun", sans-serif;
  cursor: pointer;
}

.cookie-accept:hover {
  background: #d98d19;
  color: #fff;
}

.cookie-decline {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 9px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: "Sarabun", sans-serif;
  cursor: pointer;
}

.cookie-decline:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-overlay {
  display: none;
}

.sb-float-btn {
  display: none;
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 698;
  flex-direction: column;
  align-items: center;
  background: var(--indigo);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 14px 8px;
  gap: 6px;
  border-radius: 10px 0 0 10px;
  box-shadow: -3px 0 12px rgba(11, 61, 145, 0.25);
  font-family: "Sarabun", sans-serif;
  font-size: 11px;
  font-weight: 700;
  writing-mode: vertical-rl;
}

.sb-float-icon {
  font-size: 18px;
  writing-mode: horizontal-tb;
}

/* Bottom-right floating stack: banner · messenger · contacts */
.modern-floating-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.modern-floating-stack .mq-complaint-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.modern-floating-stack .mq-close {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.modern-floating-stack .mq-complaint-link {
  display: block;
  line-height: 0;
}

.modern-floating-stack .mq-complaint-link img {
  width: auto;
  height: auto;
  max-width: none;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  display: block;
}

.modern-floating-stack .mq-messenger-link {
  display: block;
  line-height: 0;
}

.modern-floating-stack .mq-messenger-link img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  display: block;
}

.modern-floating-stack .chat-float {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.chat-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(11, 61, 145, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-toggle:hover {
  background: var(--indigo);
}

.chat-panel {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(11, 61, 145, 0.18);
  width: 220px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  display: none;
}

.chat-panel.open {
  display: block;
}

.chat-panel-head {
  background: var(--indigo);
  color: #fff;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
}

.chat-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}

.chat-channel:last-child {
  border-bottom: none;
}

.chat-channel:hover {
  background: var(--sky);
  color: var(--violet);
}

.chat-ch-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }

  .hamburger {
    display: flex !important;
  }

  .header-contact-item {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Tablet + mobile: ticker scroll + phone/Facebook icons only */
@media (max-width: 1024px) {
  .topbar-inner {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .topbar-left {
    min-width: 0;
    flex: 1;
  }

  .topbar-right .tb-desktop-only,
  .topbar-right .tb-extra {
    display: none !important;
  }

  .topbar-right .tb-link-tel,
  .topbar-right .tb-link-fb {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 4px 7px;
    min-width: 30px;
  }

  .topbar-right .tb-link-fb .tb-label-text {
    display: none;
  }

  .topbar-right .tb-link-tel {
    gap: 5px;
    max-width: min(42vw, 200px);
    font-size: clamp(10px, 2.6vw, 12px);
  }

  .topbar-right .tb-link-tel .tb-label {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-right .tb-icon-tel i,
  .topbar-right .tb-icon-fb i {
    font-size: 14px;
    line-height: 1;
  }

  .topbar-right .tb-link-fb {
    padding: 4px 9px;
    background: rgba(24, 119, 242, 0.35);
  }

  .topbar-right .tb-link-fb:hover {
    background: #1877f2;
  }

  .topbar-right .tb-icon-fb i {
    color: #fff;
  }

  .ticker-item {
    font-size: clamp(11px, 2.8vw, 12px);
    padding: 0 10px;
  }

  .ticker-track {
    animation-duration: 32s;
  }
}

@media (max-width: 768px) {
  .cover-logo-float {
    width: min(94vw, 520px);
    top: 44%;
    transform: translate(-50%, -58%);
  }

  .cover-tagline {
    bottom: 10px;
    font-size: clamp(11px, 3.2vw, 15px);
    line-height: 1.3;
    padding: 0 14px;
  }

  .topbar-inner,
  .site-cover,
  .footer-grid {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (max-width: 600px) {
  .cookie-inner {
    flex-direction: column;
  }

  .cookie-btns {
    width: 100%;
  }

  .cookie-accept,
  .cookie-decline {
    flex: 1;
    text-align: center;
  }

  .modern-floating-stack {
    right: 14px;
    bottom: 14px;
    gap: 8px;
  }

  .modern-floating-stack .mq-complaint-link img {
    max-width: 110px;
  }

  .modern-floating-stack .mq-messenger-link img,
  .modern-floating-stack .chat-toggle {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 500px) {
  .cover-img-wrap {
    height: clamp(180px, 42vw, 240px);
  }

  .cover-tagline {
    font-size: clamp(11px, 3.2vw, 15px);
    bottom: 5px;
    line-height: 1.25;
  }

  .cover-logo-float {
    top: 40%;
    transform: translate(-50%, -56%);
  }
}

@media (max-width: 600px) {
  .footer-bottom {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 10px;
    line-height: 1.5;
  }

  .footer-bottom span,
  .footer-bottom a {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Hide orphan sidebar tab on inner pages (no #mainSidebar) */
body.inner-font-compact .sb-float-btn,
body.legacy-body-page .sb-float-btn {
  display: none !important;
}

/* Responsive safety — all modern shell pages (home + inner) */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.wrap,
.main-wrap,
.theme-padding {
  max-width: 100%;
}

.wrap {
  overflow-x: clip;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

iframe,
object,
embed {
  max-width: 100%;
}

table {
  width: 100%;
  max-width: 100%;
}

.post-desc table,
.entry-content table,
.content table,
.detail-img table,
.faq-desc table,
.page-detail-body table,
.table-responsive table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.calendar table,
.ui-datepicker table,
.datepicker table {
  display: table !important;
  overflow-x: visible !important;
}

pre,
code,
.post-desc,
.detail-img,
.faq-desc,
.page-detail-body {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.map-frame iframe,
.fb-page-embed iframe {
  width: 100% !important;
  max-width: 100% !important;
}

.modern-floating-stack {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 991px) {
  .container-fluid,
  .main-wrapper,
  .content-wrap {
    width: 100%;
    max-width: 100%;
  }

  /* .container ใน main-wrap ใช้ max-width 1240px จาก inner-body.css */

  .row {
    margin-left: 0;
    margin-right: 0;
  }

  [class*="col-"] {
    min-width: 0;
  }

  body.legacy-body-page .main-wrap .row > .col-md-9,
  body.legacy-body-page .main-wrap .row > .col-md-9.col-sm-8,
  body.inner-font-compact .main-wrap .row > .col-md-9,
  body.inner-font-compact .main-wrap .row > .col-md-9.col-sm-8,
  body.legacy-body-page .main-wrap .row > .col-lg-3.col-md-3,
  body.legacy-body-page .main-wrap .row > .custom-re,
  body.inner-font-compact .main-wrap .row > .col-lg-3.col-md-3,
  body.inner-font-compact .main-wrap .row > .custom-re {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
  }
}

@media (max-width: 768px) {
  body.inner-font-compact .main-wrap > .theme-padding,
  body.legacy-body-page .main-wrap.legacy-body-main > .theme-padding {
    padding-top: 30px !important;
    padding-bottom: 30px !important;
  }

  .legacy-body-main .side-bar,
  .legacy-body-main .side-bar .widget,
  .legacy-body-main .custom-re {
    max-width: 100%;
  }

  .legacy-body-main .side-bar img {
    max-width: 100%;
    height: auto;
  }

  .popup-box {
    width: min(92vw, 520px);
    max-height: 88vh;
    overflow-y: auto;
  }
}

