.cookie-settings-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.625rem;
  border: 0;
  border-radius: 0.75rem;
  background: #f0f1f3;
  color: #20232e;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.75rem;
  text-align: left;
}

.cookie-settings-menu-item:hover,
.cookie-settings-menu-item:focus-visible {
  background: #e7e9ed;
}

.bkkthon-contact-widget {
  position: fixed;
  z-index: 9998;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  font-family: inherit;
}

.bkkthon-contact-widget[data-form-focused="true"] {
  display: none;
}

.bkkthon-chat-toggle {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #06c755;
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
  color: #fff;
  cursor: pointer;
}

.bkkthon-chat-toggle:hover {
  background: #05b64d;
}

.bkkthon-chat-toggle:focus-visible,
.bkkthon-chat-close:focus-visible,
.bkkthon-chat-actions a:focus-visible,
.bkkthon-chat-register:focus-visible,
.cookie-settings-menu-item:focus-visible {
  outline: 3px solid #1c66d5;
  outline-offset: 3px;
}

.bkkthon-chat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: flex;
  width: min(420px, calc(100vw - 32px));
  flex-direction: column;
  gap: 20px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 12px 40px rgb(0 0 0 / 20%);
  opacity: 0;
  padding: 20px;
  pointer-events: none;
  transform: translateY(16px);
  transition:
    opacity 250ms ease,
    transform 250ms ease,
    visibility 250ms ease;
  visibility: hidden;
}

.bkkthon-contact-widget[data-open="true"] .bkkthon-chat-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.bkkthon-chat-header {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.bkkthon-chat-badge {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  place-items: center;
  border-radius: 50%;
  background: #ea0428;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.bkkthon-chat-heading {
  min-width: 0;
  flex: 1;
}

.bkkthon-chat-heading h2 {
  margin: 0;
  padding: 0;
  text-align: left;
  color: #20232e;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.bkkthon-chat-heading p {
  margin: 2px 0 0;
  color: #555b68;
  font-size: 15px;
  line-height: 1.4;
}

.bkkthon-chat-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f0f1f4;
  color: #20232e;
  cursor: pointer;
}

.bkkthon-chat-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}

.bkkthon-chat-actions a {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.bkkthon-chat-line {
  background: #06c755;
  color: #052e16;
}

.bkkthon-chat-phone {
  background: #f0f1f4;
  color: #20232e;
}

.bkkthon-chat-register {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 16px;
  background: #ea0428;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.bkkthon-chat-register:hover {
  background: #cf0323;
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .bkkthon-chat-panel {
    transition: none;
  }
}
/* Keep the contact card and registration form inside narrow viewports. */
.bkkthon-contact-widget,
.bkkthon-contact-widget * {
  box-sizing: border-box;
}

@media (max-width: 639px) {
  .bkkthon-chat-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: calc(100dvh - 112px - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    padding: 16px;
    gap: 16px;
    border-radius: 24px;
  }
  .bkkthon-chat-header { gap: 10px; }
  .bkkthon-chat-badge {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
  .bkkthon-chat-heading h2 { font-size: 15px; overflow-wrap: anywhere; }
  .bkkthon-chat-heading p { font-size: 13px; text-align: left; }
  .bkkthon-chat-actions { gap: 8px; }
  .bkkthon-chat-actions a { font-size: 14px; gap: 6px; }
  .bkkthon-chat-register { font-size: 15px; }
  .site-header #top-register {
    width: auto;
    padding-left: 16px;
    padding-right: 16px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  #register-form > section:first-child > .container { min-width: 0; }
  #register-form > section:first-child .grid { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  #register-form > section:first-child .grid > div:last-child {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  #register-form .wpcf7,
  #register-form .wpcf7-form,
  #register-form .wpcf7-form-control-wrap { min-width: 0; max-width: 100%; }
  #register-form .wpcf7 input,
  #register-form .wpcf7 select,
  #register-form .wpcf7 textarea { box-sizing: border-box; max-width: 100%; }
}
@media (max-width: 639px) {
  .bkkthon-contact-widget .bkkthon-chat-panel {
    left: 12px;
    right: auto;
    width: calc(100% - 24px);
    min-width: 0;
    max-width: calc(100% - 24px);
    margin: 0;
    box-sizing: border-box;
  }
}
#site-nav-m .cookie-settings-menu-item {
  box-sizing: border-box;
  min-height: 48px;
  margin: 12px 0;
  padding: 12px;
  line-height: 24px;
  align-items: center;
}
#site-nav-m .cookie-settings-menu-item svg { flex-shrink: 0; }

/* Match the link padding on both sides of the cookie settings button. */
#site-nav-m #support-header-menu > li:last-child > a:first-child {
  padding-bottom: 8px !important;
}
#site-nav-m .cookie-settings-menu-item {
  margin-top: 12px;
  margin-bottom: 12px;
}
#site-nav-m .cookie-settings-menu-item + div > a:first-child {
  padding-top: 8px !important;
}
#site-nav-m .cookie-settings-menu-item { margin-top: 10px; margin-bottom: 14px; }

@media (max-width: 782px) {
  .bkkthon-contact-widget:not([data-form-focused="true"]),
  .cc-reconsent {
    visibility: visible !important;
    transform: none !important;
    transition: opacity 180ms ease;
    opacity: 1 !important;
  }
  .bkkthon-contact-widget:hover,
  .bkkthon-contact-widget:focus-within,
  .cc-reconsent:hover,
  .cc-reconsent:focus-visible { opacity: 1 !important; }
}
@media (max-width: 782px) {
  .bkkthon-contact-widget, .bkkthon-contact-widget[data-form-focused] { display: block !important; position: fixed !important; visibility: visible !important; }
  .cc-reconsent { display: grid !important; position: fixed !important; z-index: 9998; }
}

@media (max-width: 639px) {
  .bkkthon-contact-widget {
    right: var(--bkkthon-chat-right, 16px) !important;
  }
  .bkkthon-contact-widget .bkkthon-chat-panel {
    left: 12px !important;
    right: auto !important;
    width: var(--bkkthon-chat-card-width, calc(100% - 24px)) !important;
    max-width: var(--bkkthon-chat-card-width, calc(100% - 24px)) !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}
@media (min-width: 1024px) {
  .bkkthon-contact-widget { bottom: 62px; }
}

/* Keep the hamburger menu compact on larger screens, opening right under the button. */
@media (min-width: 640px) {
  .site-header > .container {
    position: relative;
  }
  .site-header #site-nav-m {
    box-sizing: border-box;
    top: calc(50% + var(--header-height, 70px) / 2);
    left: auto;
    right: 0;
    width: min(420px, calc(100% - 24px));
    max-width: 420px;
    margin-left: 0;
    margin-right: 0;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 12px 32px rgb(0 0 0 / 16%);
  }
  .site-header #site-nav-m.active {
    height: min(720px, calc(100dvh - 110px));
  }
  .site-header #site-nav-m .menu-container {
    box-sizing: border-box;
    height: 100%;
    overflow-y: auto;
    padding: 12px;
  }
}
@media (max-width: 639px) {
  .site-header #site-nav-m.active {
    height: auto;
    max-height: calc(100dvh - 116px);
    padding-bottom: 12px;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 12px 24px rgb(0 0 0 / 12%);
    overflow-y: auto;
  }
  .site-header #site-nav-m .menu-container {
    height: auto !important;
    max-height: none;
    overflow: visible !important;
  }
}
@media (max-width: 1023px) {
  .bkkthon-contact-widget { bottom: calc(var(--bkkthon-chat-visible-bottom, 16px) + env(safe-area-inset-bottom, 0px)) !important; }
}

@media (max-width: 639px) {
  .bkkthon-contact-widget {
    left: var(--bkkthon-chat-visible-right, calc(100% - 76px)) !important;
    right: auto !important;
    width: 60px;
    max-width: 60px;
  }
}

/* Chinese pages: no call button, LINE button spans the full width */
.bkkthon-contact-widget--cn .bkkthon-chat-actions {
  grid-template-columns: 1fr;
}

/* Some pages (e.g. Chinese register page) inline a global `path { fill: #fff }` rule; keep widget icons outlined. */
.bkkthon-contact-widget svg path {
  fill: none !important;
}
