/* ==========================================================================
   Khung chung theo Discovery Group: chọn ngôn ngữ, tìm kiếm, cụm nút
   liên hệ + về đầu trang (desktop), thanh đáy (mobile). Gốc: discoverygroup.vn
   ========================================================================== */
:root { --font-body: "Plus Jakarta Sans", sans-serif; }

/* --- Chọn ngôn ngữ --- */
/* Compact language picker: keep Vietnamese visible and reveal the other locales on demand. */
.language-dropdown {
  position: relative;
  isolation: isolate;
  overflow: visible !important;
  gap: 2px !important;
  padding: 4px 5px 4px 4px !important;
}
.language-dropdown .language-current,
.language-dropdown .language-toggle {
  width: 30px !important;
  height: 27px !important;
  display: inline-grid !important;
  place-items: center;
  border-radius: 999px;
}
.language-dropdown .language-current {
  grid-template-columns: 20px auto;
  gap: 4px;
  opacity: 1 !important;
  color: var(--gold);
}
.language-dropdown .language-current .language-code,
.language-dropdown .language-options .language-code {
  font-family: var(--font-body);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
}
.language-dropdown .language-toggle {
  position: relative;
  color: var(--ink);
  background: transparent;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.language-dropdown .language-toggle span {
  width: 7px;
  height: 7px;
  display: block;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .25s ease;
}
.language-dropdown .language-toggle:hover,
.language-dropdown .language-toggle:focus-visible {
  color: var(--gold);
  background: rgba(183, 149, 82, .11);
  outline: none;
}
.language-dropdown.is-open .language-toggle span { transform: translateY(2px) rotate(225deg); }
.language-dropdown .language-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 116px;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid rgba(183, 149, 82, .3);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 16px 30px rgba(40, 35, 24, .15);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(.97);
  transform-origin: top right;
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}
.language-dropdown.is-open .language-options {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.language-dropdown .language-options button {
  width: 100% !important;
  min-height: 32px;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--ink);
  opacity: .78;
  text-align: left;
}
.language-dropdown .language-options button:hover,
.language-dropdown .language-options button:focus-visible,
.language-dropdown .language-options button.is-active,
.language-dropdown .language-options button[aria-pressed="true"] {
  color: var(--gold);
  background: rgba(183, 149, 82, .1);
  opacity: 1;
  transform: none;
  outline: none;
}
.language-dropdown .language-options button img {
  width: 22px !important;
  height: 15px !important;
  flex: 0 0 auto;
}
.language-dropdown .language-options button::after { display: none; }
.language-dropdown > i { display: none !important; }

@media (max-width: 980px) {
  .hd .mobile-language.language-dropdown {
    width: max-content;
    min-height: 44px;
    padding: 5px 6px 5px 5px !important;
    gap: 2px;
  }
  .hd .mobile-language.language-dropdown .language-current,
  .hd .mobile-language.language-dropdown .language-toggle {
    width: 39px !important;
    height: 32px !important;
  }
  .hd .mobile-language.language-dropdown .language-current {
    grid-template-columns: 23px auto;
    gap: 4px;
  }
  .hd .mobile-language.language-dropdown .language-current img { width: 22px !important; height: 15px !important; }
  .hd .mobile-language.language-dropdown .language-current .language-code { font-size: 9px; }
  .hd .mobile-language.language-dropdown .language-options {
    top: calc(100% + 7px);
    right: 0;
    min-width: 128px;
  }
  .hd .mobile-language.language-dropdown .language-options button { min-height: 38px; }
}

/* --- Hộp tìm kiếm --- */
body.dg-search-open { overflow: hidden !important; }
.dg-search-dialog[hidden] { display: none !important; }
.dg-search-dialog {
  position: fixed;
  z-index: 2500;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: max(80px, 10vh) 24px 32px;
  font-family: "Plus Jakarta Sans", sans-serif;
}
.dg-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 23, 22, .58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dg-search-panel {
  position: relative;
  width: min(780px, 100%);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: clamp(28px, 4vw, 48px);
  color: #20231f;
  background: #fffdf8;
  border: 1px solid rgba(183, 149, 82, .58);
  box-shadow: 0 34px 90px rgba(13, 20, 18, .28);
}
.dg-search-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.dg-search-heading span { color: #9a741f; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.dg-search-heading h2 { margin: 8px 0 0; font-family: "Montserrat", sans-serif; font-size: clamp(28px, 4vw, 44px); font-weight: 500; line-height: 1.08; }
.dg-search-heading > button { width: 42px; height: 42px; flex: 0 0 42px; color: #7b5b21; background: transparent; border: 1px solid rgba(183, 149, 82, .55); font-size: 26px; line-height: 1; cursor: pointer; }
.dg-search-form { height: 58px; margin-top: 30px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid #b79552; }
.dg-search-form > span { position: relative; width: 25px; height: 25px; }
.dg-search-form > span::before { content: ""; position: absolute; left: 1px; top: 1px; width: 13px; height: 13px; border: 1.5px solid #76551d; border-radius: 50%; }
.dg-search-form > span::after { content: ""; position: absolute; left: 14px; top: 15px; width: 8px; height: 1.5px; background: #76551d; transform: rotate(45deg); transform-origin: left center; }
.dg-search-form input { min-width: 0; height: 100%; padding: 0 12px; color: #252722; background: transparent; border: 0; outline: 0; font: 14px "Plus Jakarta Sans", sans-serif; }
.dg-search-form button { height: 40px; padding: 0 18px; color: #fff; background: #a77d2d; border: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.dg-search-status { margin: 20px 0 8px; color: #7a776f; font-size: 11.5px; }
.dg-search-results { display: grid; }
.dg-search-results a { min-height: 54px; padding: 12px 2px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 24px; align-items: center; gap: 10px; color: #30322e; border-top: 1px solid rgba(183, 149, 82, .22); text-decoration: none; transition: color .2s ease, padding-left .2s ease; }
.dg-search-results a > span { color: #b28a43; font-size: 11.5px; }
.dg-search-results a > strong { font-size: 13px; font-weight: 500; }
.dg-search-results a > i { color: #a77d2d; font-size: 16px; font-style: normal; text-align: right; }
.dg-search-results a:hover,
.dg-search-results a:focus-visible { padding-left: 8px; color: #8a641f; outline: 0; }

@media (max-width: 620px) {
  .dg-search-dialog { padding: 76px 14px 20px; }
  .dg-search-panel { max-height: calc(100dvh - 96px); padding: 24px 20px 28px; }
  .dg-search-heading h2 { font-size: 28px; }
  .dg-search-form { grid-template-columns: 34px minmax(0, 1fr); }
  .dg-search-form button { display: none; }
}


/* --- Cụm liên hệ + về đầu trang --- */
.floating-actions {
  position: fixed;
  z-index: 90;
  right: clamp(18px, 2.4vw, 36px);
  bottom: max(clamp(18px, 2.4vw, 34px), env(safe-area-inset-bottom));
  --floating-action-size: 42px;
  display: grid;
  grid-template-columns: repeat(5, var(--floating-action-size));
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(183, 149, 82, .42);
  border-radius: 8px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 13px 30px rgba(77, 51, 12, .12), inset 0 1px 0 rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(.92);
  transition:
    opacity .34s ease,
    visibility .34s ease,
    transform .42s cubic-bezier(.22, 1, .36, 1);
}

.floating-actions.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.contact-dock {
  display: contents;
}

.contact-dock-link,
.back-to-top {
  position: relative;
  width: var(--floating-action-size);
  height: var(--floating-action-size);
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(183, 149, 82, .55);
  border-radius: 6px;
}

.contact-dock-link {
  color: #9c6b20;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .88);
  transition: color .25s ease, background-color .25s ease, border-color .25s ease, transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease;
}

.back-to-top {
  color: #fffdf8;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 242, 196, .34), transparent 31%),
    linear-gradient(145deg, #ddb65b, #9c6b20 58%, #c99637);
  box-shadow: 0 9px 19px rgba(77, 51, 12, .2), inset 0 1px 0 rgba(255, 255, 255, .36);
  cursor: pointer;
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease, filter .3s ease;
}

.contact-dock-link:hover,
.contact-dock-link:focus-visible {
  color: #fffdf8;
  border-color: rgba(244, 216, 146, .88);
  background: linear-gradient(145deg, #ddb65b, #9c6b20 58%, #c99637);
  box-shadow: 0 9px 19px rgba(77, 51, 12, .18), inset 0 1px 0 rgba(255, 255, 255, .34);
  transform: translateY(-3px);
  outline: none;
}

.contact-dock-link:active { transform: translateY(-1px) scale(.97); }

.social-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  line-height: 1;
}

.social-icon-facebook {
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.social-icon-zalo {
  width: auto;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -.04em;
}

.social-icon-youtube {
  width: 19px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
}

.social-icon-youtube::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 0;
  height: 0;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  border-left: 5px solid currentColor;
}

.social-icon-email {
  width: 19px;
  height: 14px;
  overflow: hidden;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.social-icon-email::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.back-to-top::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 249, 227, .2);
  border-radius: 3px;
  pointer-events: none;
}

.back-to-top > span {
  position: relative;
  width: 17px;
  height: 20px;
  display: block;
}

.back-to-top > span::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  width: 10px;
  height: 10px;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

.back-to-top > span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 1.5px;
  height: 16px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.back-to-top:is(:hover, :focus-visible) {
  filter: brightness(1.07);
  box-shadow: 0 17px 34px rgba(77, 51, 12, .27), inset 0 1px 0 rgba(255, 255, 255, .45);
  transform: translateY(-3px) scale(1.02);
  outline: none;
}

.back-to-top:active {
  transform: translateY(-1px) scale(.98);
}

@media (max-width: 620px) {
  .floating-actions {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    --floating-action-size: 39px;
    gap: 4px;
    padding: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-actions,
  .back-to-top,
  .contact-dock-link { transition: opacity .2s ease, visibility .2s ease; }
}

@media (prefers-reduced-transparency: reduce) {
  .floating-actions {
    background: #fffdf8;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* --- Thanh đáy mobile --- */
:root {
  --dg-bottom-gold: #b79552;
  --dg-bottom-gold-deep: #8c6220;
  --dg-bottom-ink: #656963;
}

.dg-mobile-bottom-bar {
  display: none;
}

@media (max-width: 620px) {
  /* Chừa đúng chiều cao thanh đáy để nội dung cuối trang không bị che. */
  body.has-dg-mobile-bottom-bar {
    padding-bottom: 62px;
  }

  .floating-actions {
    display: none !important;
  }

  .dg-mobile-bottom-bar {
    position: fixed;
    z-index: 90;
    right: 0;
    bottom: env(safe-area-inset-bottom);
    left: 0;
    width: 100%;
    height: 64px;
    padding: 2px 8px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: stretch;
    overflow: hidden;
    color: var(--dg-bottom-ink);
    background: #fff;
    border: 1.5px solid transparent;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(71, 52, 17, .13);
    font-family: var(--font-body, "Plus Jakarta Sans", sans-serif);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    filter: blur(5px);
    transform: translateY(calc(100% + 12px));
    transform-origin: 50% 100%;
    transition:
      visibility .34s ease,
      filter .48s ease,
      transform .62s cubic-bezier(.22, 1, .36, 1);
  }

  .dg-mobile-bottom-bar.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    filter: blur(0);
    transform: translateY(0);
  }

  body.nav-open .dg-mobile-bottom-bar,
  body.dg-nav-open .dg-mobile-bottom-bar,
  body.splash-active .dg-mobile-bottom-bar {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    filter: blur(4px);
    transform: translateY(calc(100% + 12px));
  }

  .dg-mobile-bottom-contour {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
  }

  .dg-mobile-bottom-brand,
  .dg-mobile-bottom-item {
    position: relative;
    z-index: 2;
    min-width: 0;
    height: 60px;
    padding: 0;
    display: grid;
    place-items: center;
    align-content: center;
    color: inherit;
    background: transparent;
    border: 0;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .dg-mobile-bottom-brand img {
    width: 27px;
    height: 40px;
    display: block;
    object-fit: contain;
  }

  .dg-mobile-bottom-item.is-home {
    color: var(--dg-bottom-gold-deep);
  }

  .dg-mobile-bottom-icon {
    width: 21px;
    height: 21px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.55;
  }

  .dg-mobile-bottom-icon.is-solid {
    fill: currentColor;
    stroke: none;
  }

  .dg-mobile-bottom-item.is-home .dg-mobile-bottom-icon {
    width: 23px;
    height: 23px;
    fill: currentColor;
    stroke-width: 1.35;
  }

  .dg-mobile-bottom-brand:active,
  .dg-mobile-bottom-item:active {
    transform: scale(.96);
  }
}

@media (max-width: 360px) {
  .dg-mobile-bottom-bar {
    padding-inline: 5px;
  }
}

@media (prefers-reduced-motion: reduce) and (max-width: 0px) {
  .dg-mobile-bottom-bar,
  .dg-mobile-bottom-brand,
  .dg-mobile-bottom-item {
    transition: none !important;
  }
}

/* Three reviewable mobile dock directions. Option 1 is the production
   default; append ?bottom-bar=2 or ?bottom-bar=3 to preview the alternatives. */
@media (max-width: 620px) {
  /* Thanh đáy sát mép dưới màn hình, cao cố định 62px, bo hai góc trên.
     Không cộng env(safe-area-inset-bottom): trang không bật viewport-fit=cover
     nên nội dung vốn không nằm dưới thanh hệ thống, nhưng Chrome Android có
     thanh 3 nút vẫn báo vùng an toàn ~48px. Bản cũ cộng giá trị đó hai lần
     (vào chiều cao và phần đệm, trên nền content-box) nên thanh cao tới 169px
     với một khoảng trắng lớn dưới hàng icon. */
  .dg-mobile-bottom-bar[data-variant="option-1"] {
    box-sizing: border-box;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 62px;
    padding: 6px 8px;
    align-items: center;
    border: 0;
    border-top: 1px solid rgba(183, 149, 82, .3);
    border-radius: 18px 18px 0 0;
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 -8px 24px rgba(42, 34, 19, .1);
  }

  .dg-mobile-bottom-bar[data-variant="option-1"] .dg-mobile-bottom-contour {
    display: none;
  }

  .dg-mobile-bottom-bar[data-variant="option-1"] .dg-mobile-bottom-brand,
  .dg-mobile-bottom-bar[data-variant="option-1"] .dg-mobile-bottom-item {
    height: 46px;
    border-radius: 13px;
    transition: background .22s ease, color .22s ease, transform .22s ease;
  }

  /* Vạch ngăn mảnh chỉ cao nửa thanh, không cắt ngang cả chiều cao. */
  .dg-mobile-bottom-bar[data-variant="option-1"] .dg-mobile-bottom-item + .dg-mobile-bottom-item,
  .dg-mobile-bottom-bar[data-variant="option-1"] .dg-mobile-bottom-brand + .dg-mobile-bottom-item {
    border-left: 0;
    background: linear-gradient(rgba(183, 149, 82, .24), rgba(183, 149, 82, .24)) left center / 1px 50% no-repeat;
  }

  .dg-mobile-bottom-bar[data-variant="option-1"] .dg-mobile-bottom-item.is-home {
    background: #f4ead5;
    color: var(--dg-bottom-gold-deep);
  }

  .dg-mobile-bottom-bar[data-variant="option-1"] .dg-mobile-bottom-brand img {
    width: 21px;
    height: 31px;
  }

  .dg-mobile-bottom-bar[data-variant="option-2"] {
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom) + 14px);
    left: 14px;
    width: auto;
    height: 72px;
    padding: 7px;
    border: 1px solid rgba(222, 191, 119, .52);
    border-radius: 24px;
    color: #e8e0d0;
    background: rgba(17, 24, 32, .94);
    box-shadow: 0 18px 42px rgba(11, 15, 20, .28);
    backdrop-filter: blur(18px);
  }

  .dg-mobile-bottom-bar[data-variant="option-2"] .dg-mobile-bottom-contour {
    display: none;
  }

  .dg-mobile-bottom-bar[data-variant="option-2"] .dg-mobile-bottom-brand,
  .dg-mobile-bottom-bar[data-variant="option-2"] .dg-mobile-bottom-item {
    height: 56px;
    border-radius: 17px;
    transition: background .22s ease, color .22s ease, transform .22s ease;
  }

  .dg-mobile-bottom-bar[data-variant="option-2"] .dg-mobile-bottom-brand img {
    width: 24px;
    height: 36px;
    filter: brightness(0) invert(1) sepia(.22) saturate(.72);
  }

  .dg-mobile-bottom-bar[data-variant="option-2"] .dg-mobile-bottom-item.is-home {
    color: #171b20;
    background: linear-gradient(145deg, #e4c889, #b79552);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 4px 12px rgba(183, 149, 82, .22);
  }

  .dg-mobile-bottom-bar[data-variant="option-2"] .dg-mobile-bottom-item:not(.is-home):active,
  .dg-mobile-bottom-bar[data-variant="option-2"] .dg-mobile-bottom-brand:active {
    background: rgba(255, 255, 255, .09);
  }

  .dg-mobile-bottom-bar[data-variant="option-3"] {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(70px + env(safe-area-inset-bottom));
    padding: 4px 10px env(safe-area-inset-bottom);
    border: 0;
    border-top: 3px solid var(--dg-bottom-gold);
    border-radius: 20px 20px 0 0;
    color: #60645f;
    background: #fff;
    box-shadow: 0 -10px 28px rgba(70, 55, 27, .12);
  }

  .dg-mobile-bottom-bar[data-variant="option-3"] .dg-mobile-bottom-contour {
    display: none;
  }

  .dg-mobile-bottom-bar[data-variant="option-3"] .dg-mobile-bottom-brand,
  .dg-mobile-bottom-bar[data-variant="option-3"] .dg-mobile-bottom-item {
    height: 56px;
    border-radius: 14px;
    transition: background .22s ease, color .22s ease, transform .22s ease;
  }

  .dg-mobile-bottom-bar[data-variant="option-3"] .dg-mobile-bottom-brand img {
    position: relative;
    z-index: 1;
    width: 23px;
    height: 32px;
    filter: brightness(0) invert(1);
  }

  .dg-mobile-bottom-bar[data-variant="option-3"] .dg-mobile-bottom-brand::before {
    content: "";
    position: absolute;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--dg-bottom-gold);
  }

  .dg-mobile-bottom-bar[data-variant="option-3"] .dg-mobile-bottom-item.is-home {
    position: relative;
    color: var(--dg-bottom-gold-deep);
    background: rgba(183, 149, 82, .14);
  }

  .dg-mobile-bottom-bar[data-variant="option-3"] .dg-mobile-bottom-item.is-home::after {
    content: "";
    position: absolute;
    right: 22%;
    bottom: 2px;
    left: 22%;
    height: 2px;
    border-radius: 999px;
    background: var(--dg-bottom-gold);
  }
}
