/* ============================================================
   Header layout styles — shared across all pages
   (extracted from include/header.php)
   ============================================================ */

/* ─── Health Solutions Mega Dropdown ─── */
.hs-mega-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0;
}
.hs-category-card {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  text-decoration: none !important;
  color: #444;
  gap: 10px;
  transition: background .2s;
}
.hs-category-card:hover {
  background: #f5f2fc;
  border-radius: 8px;
}
.hs-cat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #f2eff8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hs-cat-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.hs-cat-label {
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.2;
}
.hs-cat-label strong {
  color: var(--color-primary);
  font-weight: 700;
}
.hs-bi-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0;
}
.hs-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-evenly;
  gap: 16px;
  width: 100%;
}
.hs-logos a { opacity: .85; transition: opacity .2s; }
.hs-logos a:hover { opacity: 1; }
.hs-logos img { max-height: 85px; width: auto; }

/* ─── Topbar Language Flags (inside .social-icons) ─── */
.topbar-lang-sep,
.topbar-lang-sep ~ li {
  display: flex;
  align-items: center;
}
.topbar-lang-sep {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,0.25);
}
/* Match social icon circle size exactly */
.header-topbar .social-icons .lang-flag-btn {
  width: 34px;
  height: 34px;
}

/* ─── Navbar Language Flags (sticky navbar, desktop xl+) ─── */
.navbar-lang-flags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
/* แสดงเมื่อ navbar กลายเป็น sticky (scroll > 150px) */
.sticky-navbar.is-sticky .navbar-lang-flags {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Mobile Language Flags ─── */
.mobile-lang-flags {
  gap: 6px;
  margin-left: auto;   /* mobile: ดันไปชิดขวาก่อน hamburger */
  margin-right: 40px;
}
/* lg–xl: เต็มเมนูแสดง — ย้าย flags ไปหลัง collapse (ชิดขวา) */
@media (min-width: 992px) and (max-width: 1199px) {
  .mobile-lang-flags {
    order: 4;
    margin-left: 0;
    margin-right: 24px;
  }
}
.lang-flag-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
  transition: filter .2s, opacity .2s;
}
.lang-flag-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Inactive = grayscale + dim */
.lang-flag-btn:not(.lang-flag-active) {
  filter: grayscale(100%);
  opacity: 0.45;
}

/* Theme sets display:block at xl+ and kills vertical centering — restore it */
@media (min-width: 1200px) {
  .header-topbar {
    display: flex !important;
    align-items: center;
  }
}

@media (min-width: 992px) {
  /* Constrain mega dropdown to container width */
  .navbar .nav-item.has-dropdown.has-mega-dropdown > .mega-dropdown-menu {
    width: 1140px !important;
    max-width: calc(100vw - 40px) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }
  /* Reset container padding that theme overrides to 50px */
  .navbar .nav-item.has-dropdown > .mega-dropdown-menu .container {
    max-width: 100% !important;
    padding: 24px 20px !important;
  }
}

/* Top contact bar — vivid purple (overrides .header-topbar's var(--color-accent)
   in style.css; same specificity, loaded later so it wins). */
.header-topbar {
  background-color: #7a12b8;
}
