/* ---------- Header/Footer dùng chung (LINE WORKS + TIAH) ----------
   header.html/footer.html/header-ja.html/footer-ja.html (assets/partials/)
   là markup DUY NHẤT cho cả 2 site — CSS ở đây cũng dùng chung để 2 site
   không lệch style. Chỉ dùng token --header-*/--color-text/--color-white/
   --transition-base/--header-height (định nghĩa khớp nhau tuyệt đối ở cả
   tokens.css và tiah-tokens.css) — không dùng token riêng của từng site
   (--color-brand-gold, --color-heading, --color-primary...). */

#site-header {
  display: block;
  min-height: var(--header-height);
}
.site-header {
  height: var(--header-height);
  background: var(--color-white);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  font-family: var(--header-font);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 auto;
}
.logo {
  flex-shrink: 0;
}
.logo img {
  height: auto;
  width: 120px;
}
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: 983px;
}
.header-top-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 50px;
  font-size: 13px;
  white-space: nowrap;
}
.header-top-row .tel {
  font-weight: 700;
  font-size: 19px;
  line-height: 33px;
  color: var(--color-text);
  font-family: fangsong;
}
.lang-switch {
  display: flex;
  gap: 15px;
  font-weight: bold;
}
.lang-switch a {
  display: inline-block;
  padding: 5px;
  font-size: 13px;
  color: var(--header-dark);
}
.lang-switch li.active {
  background: var(--header-accent);
}
.lang-switch li.active a {
  color: var(--color-white);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--header-dark);
  transition:
    transform var(--transition-base),
    opacity var(--transition-base);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.main-nav {
  width: 100%;
}
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 30px;
  white-space: nowrap;
}
.main-nav a {
  position: relative;
  font-size: 1rem;
  color: var(--color-text);
  font-weight: bold;
  white-space: nowrap;
  transition: color var(--transition-base);
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--header-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}
.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
}
.main-nav a.active {
  color: var(--header-accent);
}
.main-nav li {
  position: relative;
}
.main-nav .sub-menu {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  width: 220px;
  background: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(16, 52, 84, 0.16);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition:
    opacity var(--transition-base),
    transform var(--transition-base),
    visibility var(--transition-base);
  z-index: 200;
}
.has-dropdown:hover > .sub-menu,
.has-dropdown:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sub-menu li {
  position: static;
}
.sub-menu li.has-dropdown {
  position: relative;
}
.sub-menu .sub-menu {
  top: -10px;
  left: 100%;
  transform: translateY(0) translateX(4px);
}
.has-dropdown:hover > .sub-menu.sub-menu,
.has-dropdown:focus-within > .sub-menu.sub-menu {
  transform: translateY(0) translateX(0);
}
.sub-menu li + li {
  margin-top: 2px;
}
.sub-menu a {
  display: block;
  padding: 11px 12px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  white-space: normal;
  line-height: 1.4;
  transition:
    background var(--transition-base),
    color var(--transition-base);
}
.sub-menu a:hover {
  background: var(--header-hover-bg);
  color: var(--header-accent);
}
.sub-menu a::after {
  display: none;
}
.nav-row {
  display: contents;
}
.submenu-toggle {
  display: none;
}
.lang-switch-mobile {
  display: none;
}

.scroll-top {
  position: fixed;
  right: 40px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--header-accent);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: none;
  z-index: 20;
  transition:
    background var(--transition-base),
    transform var(--transition-base);
}
.scroll-top:hover {
  background: var(--header-dark);
  transform: translateY(-4px);
}

.site-footer {
  background:
    linear-gradient(rgba(24, 24, 24, 0.82), rgba(24, 24, 24, 0.82)),
    url("../img/banner-footer.jpg") center / cover no-repeat;
  color: var(--color-white);
  padding-top: 44px;
}
.footer-columns {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 30px;
}
.footer-brand {
  padding-right: 24px;
}
.footer-logo {
  display: inline-block;
}
.footer-logo img {
  width: 170px;
  height: auto;
}
.footer-tagline {
  margin-top: 16px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
  max-width: 32em;
}
.site-footer .footer-col h4 {
  font-size: 18px;
  font-weight: bold;
  color: var(--header-accent);
  margin-bottom: 1rem;
}
.footer-col ul li {
  margin-bottom: 8px;
}
.site-footer .footer-col a {
  font-size: 1rem;
  color: var(--color-white);
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-bottom-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.lang-select {
  background: transparent;
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 14px;
  padding: 5px 10px;
}
.footer-store-badges {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-store-badges img {
  height: 40px;
  width: auto;
  display: block;
}
.social-icons {
  display: flex;
  gap: 14px;
}
.social-icons a {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbbbbb;
}
.social-icons svg {
  width: 18px;
  height: 18px;
  fill: #bbbbbb;
}
.site-info {
  padding: 14px 0 20px;
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: #999999;
}
.site-info a {
  color: #999999;
}

/* ---------- Mobile/Tablet: < 980px ---------- */
@media (max-width: 979px) {
  .nav-toggle {
    display: flex;
  }
  .header-right {
    gap: 0;
  }
  .header-top-row {
    display: none;
  }
  .footer-store-badges img {
    width: 100%;
    height: auto;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    box-shadow: 0 8px 1rem rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }
  .main-nav.is-open {
    display: block;
    height: 100vh;
    z-index: 501;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }
  .main-nav li {
    width: 100%;
  }
  .main-nav a {
    display: block;
    padding: 1rem 20px;
  }
  .main-nav a::after {
    display: none;
  }
  /* Dropdown: accordion - an mac dinh, bam nut mui ten ben phai de mo/dong.
     Ap dung cho ca cap 1 (.main-nav > ul > li) va cap long nhau (sub-menu
     trong sub-menu), vi cung dung chung class .has-dropdown/.submenu-toggle. */
  .main-nav .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-radius: 0;
    width: auto;
    padding: 0 0 0 20px;
    background: var(--header-hover-bg);
    display: none;
  }
  .main-nav .sub-menu.is-open {
    display: block;
    padding-bottom: 8px;
  }
  .sub-menu a {
    padding: 10px 0;
    border-radius: 0;
  }
  .sub-menu a:hover {
    background: none;
  }
  .nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .nav-row a {
    flex: 1;
  }
  .submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    background: none;
  }
  .submenu-toggle-icon {
    display: block;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--header-dark);
    border-bottom: 2px solid var(--header-dark);
    transform: rotate(45deg);
    transition: transform var(--transition-base);
    margin-top: -4px;
  }
  .submenu-toggle[aria-expanded="true"] .submenu-toggle-icon {
    transform: rotate(-135deg);
    margin-top: 4px;
  }

  /* Chuyen ngon ngu (JP/EN/VN): .header-top-row bi an het tren mobile nen
     khong con cach nao doi ngon ngu - hien lai rieng .lang-switch trong
     panel menu hamburger. */
  .lang-switch-mobile {
    display: block;
    padding: 16px 20px 24px;
    border-top: 1px solid var(--color-divider, #eee);
    margin-top: 8px;
  }
  .lang-switch-mobile .lang-switch {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
  }
  .lang-switch-mobile .lang-switch li {
    width: auto;
  }
  .lang-switch-mobile .lang-switch a {
    display: inline-block;
    padding: 5px 10px;
  }
}
