/* ==========================================================================
   玹翔旅遊 V43 — R3 Header CSS Cascade Repair
   Final Header Authority Only
   Desktop > 1024px / Tablet-Mobile <= 1024px
   ========================================================================== */

#xx-site-header,
.xx-site-header {
  position: relative;
  z-index: 3000;
  width: 100%;
  background:
    linear-gradient(180deg, rgba(15, 13, 9, 0.985), rgba(8, 8, 8, 0.975));
  border-bottom: 1px solid rgba(216, 181, 109, 0.24);
  color: #fff7df;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

#xx-site-header *,
#xx-site-header *::before,
#xx-site-header *::after,
.xx-site-header *,
.xx-site-header *::before,
.xx-site-header *::after {
  box-sizing: border-box;
}

.xx-site-header .xx-nav-wrap {
  position: relative;
  width: min(calc(100% - clamp(24px, 3vw, 56px)), 1680px);
  min-height: clamp(72px, 5.2vw, 88px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.35vw, 24px);
  min-width: 0;
}

.xx-site-header .xx-brand,
.xx-site-header .xx-home-brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 0.8vw, 12px);
  flex: 0 0 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.xx-site-header .logo-img {
  display: block;
  width: clamp(44px, 3.8vw, 56px);
  height: clamp(44px, 3.8vw, 56px);
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.xx-site-header .brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  line-height: 1.06;
}

.xx-site-header .brand-text strong {
  color: #f7df9b;
  font-size: clamp(15px, 1.15vw, 20px);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.xx-site-header .brand-text small {
  color: rgba(255, 242, 189, 0.76);
  font-size: clamp(9px, 0.62vw, 11px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Desktop */
.xx-site-header .xx-menu,
.xx-site-header .xx-home-nav,
.xx-site-header .nav-links {
  position: relative;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: clamp(2px, 0.52vw, 9px) !important;

  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;

  flex: 1 1 auto !important;
  margin: 0 0 0 auto !important;
  padding: 0 !important;

  overflow: visible !important;
  grid-template-columns: none !important;
  align-content: normal !important;
}

.xx-site-header .drop,
.xx-site-header .xx-mega {
  position: relative !important;
  display: block !important;

  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;

  flex: 0 0 auto !important;

  margin: 0 !important;
  padding: 0 !important;
}

.xx-site-header .xx-home-nav__link,
.xx-site-header .xx-menu > a,
.xx-site-header .drop-btn,
.xx-site-header .xx-nav-cta-primary,
.xx-site-header .xx-v43-search-button {
  min-height: 44px !important;
  height: auto !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  flex: 0 0 auto !important;

  margin: 0 !important;
  border: 0;
  border-radius: 999px;

  padding: 0.58rem clamp(0.5rem, 0.72vw, 0.82rem) !important;

  background: transparent;
  color: #f7ead0;

  font: inherit;
  font-size: clamp(12px, 0.77vw, 14px) !important;
  font-weight: 700;
  line-height: 1.2;

  text-decoration: none;
  text-align: center;
  white-space: nowrap !important;

  cursor: pointer;
}

.xx-site-header .xx-nav-cta-primary {
  background: linear-gradient(135deg, #fff0b8, #d8b56d) !important;
  color: #1a1409 !important;
}

.xx-site-header .xx-v43-search-button {
  border: 1px solid rgba(216, 181, 109, 0.26);
}

/* Dropdown */
.xx-site-header .drop-btn::after {
  content: "▾";
  margin-left: 0.42rem;
  font-size: 0.72em;
  line-height: 1;
  transition: transform 0.2s ease;
}

.xx-site-header .drop.active > .drop-btn::after,
.xx-site-header .drop:focus-within > .drop-btn::after {
  transform: rotate(180deg);
}

.xx-site-header .drop-list,
.xx-site-header .xx-home-nav__dropdown {
  position: absolute !important;

  top: calc(100% + 10px) !important;
  left: 50% !important;
  right: auto !important;

  z-index: 3200 !important;

  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;

  width: min(360px, calc(100vw - 32px)) !important;
  min-width: 260px !important;

  min-height: 0 !important;
  height: auto !important;
  max-height: min(70vh, 620px) !important;

  overflow: auto !important;

  margin: 0 !important;
  padding: 12px !important;

  border: 1px solid rgba(216, 181, 109, 0.25);
  border-radius: 18px;

  background:
    linear-gradient(145deg, rgba(14, 16, 20, 0.99), rgba(7, 8, 11, 0.99));

  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.48);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translate(-50%, 8px) !important;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}

.xx-site-header .drop-list a,
.xx-site-header .xx-home-nav__dropdown a {
  display: grid !important;
  grid-template-columns: 1fr !important;

  gap: 2px !important;

  width: 100% !important;
  min-height: 48px !important;
  height: auto !important;

  margin: 0 !important;
  padding: 10px 12px !important;

  border-radius: 12px;

  color: #f7ead0;

  text-decoration: none;
  white-space: normal !important;
}

.xx-site-header .drop-list a small,
.xx-site-header .xx-home-nav__dropdown a small {
  margin: 0 !important;
  color: rgba(247, 234, 208, 0.66);
  font-size: 0.78rem;
  line-height: 1.45;
}

.xx-site-header .drop.active > .drop-list,
.xx-site-header .drop.active > .xx-home-nav__dropdown,
.xx-site-header .drop:focus-within > .drop-list,
.xx-site-header .drop:focus-within > .xx-home-nav__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transform: translate(-50%, 0) !important;
}

@media (hover: hover) and (pointer: fine) {
  .xx-site-header .drop:hover > .drop-list,
  .xx-site-header .drop:hover > .xx-home-nav__dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: translate(-50%, 0) !important;
  }
}

/* Focus */
.xx-site-header a:focus-visible,
.xx-site-header button:focus-visible,
.xx-site-header .xx-hamburger:focus-visible {
  outline: 2px solid #fff2bd;
  outline-offset: 4px;
}

/* Checkbox */
.xx-site-header .xx-nav-toggle {
  position: absolute !important;

  width: 1px !important;
  height: 1px !important;

  padding: 0 !important;
  margin: -1px !important;

  overflow: hidden !important;

  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;

  white-space: nowrap !important;

  border: 0 !important;
}

.xx-site-header .xx-hamburger {
  display: none !important;
}

/* Tablet + Mobile */
@media (max-width: 1024px) {

  .xx-site-header .xx-nav-wrap {
    width: min(calc(100% - clamp(20px, 4vw, 32px)), 1680px);

    min-height: 70px;

    flex-wrap: wrap !important;
    align-content: flex-start !important;

    gap: 0 !important;

    padding-block: 8px !important;
  }

  .xx-site-header .xx-hamburger {
    display: inline-flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;

    margin: 4px 0 4px auto !important;
    padding: 0 !important;

    border: 1px solid rgba(216, 181, 109, 0.32);
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.04);

    color: #fff2bd;

    cursor: pointer;
  }

  .xx-site-header .xx-menu,
  .xx-site-header .xx-home-nav,
  .xx-site-header .nav-links {
    position: static !important;

    display: none !important;

    width: 100% !important;
    min-width: 0 !important;

    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;

    flex: 0 0 100% !important;

    margin: 0 !important;
    padding: 8px 0 12px !important;

    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    align-content: flex-start !important;

    gap: 4px !important;

    overflow: visible !important;

    grid-template-columns: 1fr !important;
  }

  body.xx-nav-open .xx-site-header .xx-menu,
  body.xx-nav-open .xx-site-header .xx-home-nav,
  body.xx-nav-open .xx-site-header .nav-links,
  .xx-site-header .xx-nav-toggle:checked ~ .xx-menu,
  .xx-site-header .xx-nav-toggle:checked ~ .xx-home-nav,
  .xx-site-header .xx-nav-toggle:checked ~ .nav-links {
    display: flex !important;
  }

  .xx-site-header .drop,
  .xx-site-header .xx-mega {
    position: static !important;

    display: block !important;

    width: 100% !important;
    min-width: 0 !important;

    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;

    flex: 0 0 auto !important;

    margin: 0 !important;
    padding: 0 !important;
  }

  .xx-site-header .xx-home-nav__link,
  .xx-site-header .xx-menu > a,
  .xx-site-header .drop-btn,
  .xx-site-header .xx-nav-cta-primary,
  .xx-site-header .xx-v43-search-button {
    width: 100% !important;

    min-height: 48px !important;
    height: auto !important;
    max-height: none !important;

    flex: 0 0 auto !important;

    margin: 0 !important;
    padding: 0.72rem 0.84rem !important;

    justify-content: space-between !important;
    align-items: center !important;

    border-radius: 12px;

    text-align: left !important;
    white-space: normal !important;
  }

  .xx-site-header .drop-list,
  .xx-site-header .xx-home-nav__dropdown {
    position: static !important;

    top: auto !important;
    left: auto !important;
    right: auto !important;

    display: none !important;

    grid-template-columns: 1fr !important;

    width: 100% !important;
    min-width: 0 !important;

    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;

    margin: 4px 0 8px !important;
    padding: 8px !important;

    gap: 4px !important;

    overflow: visible !important;

    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;

    transform: none !important;

    border-radius: 14px;

    box-shadow: none;
  }

  .xx-site-header .drop.active > .drop-list,
  .xx-site-header .drop.active > .xx-home-nav__dropdown {
    display: grid !important;
  }

  .xx-site-header .drop-list a,
  .xx-site-header .xx-home-nav__dropdown a {
    min-height: 44px !important;
    padding: 9px 10px !important;
  }
}

/* Small phones */
@media (max-width: 640px) {

  .xx-site-header .xx-nav-wrap {
    width: calc(100% - 24px);
    min-height: 66px;
  }

  .xx-site-header .logo-img {
    width: 46px;
    height: 46px;
  }

  .xx-site-header .brand-text strong {
    font-size: 15px;
  }

  .xx-site-header .brand-text small {
    display: none;
  }
}

@media (max-width: 390px) {

  .xx-site-header .xx-nav-wrap {
    width: calc(100% - 20px);
  }

  .xx-site-header .logo-img {
    width: 42px;
    height: 42px;
  }

  .xx-site-header .xx-home-nav__link,
  .xx-site-header .xx-menu > a,
  .xx-site-header .drop-btn,
  .xx-site-header .xx-nav-cta-primary,
  .xx-site-header .xx-v43-search-button {
    font-size: 14px !important;
  }
}

/* Wide desktop */
@media (min-width: 1600px) {
  .xx-site-header .xx-nav-wrap {
    width: min(calc(100% - 64px), 1760px);
  }
}

@media (min-width: 2200px) {
  .xx-site-header .xx-nav-wrap {
    width: min(calc(100% - 96px), 1920px);
  }
}

/* ==========================================================================
   R3 Header — Mobile Legacy Cascade Kill Switch
   ========================================================================== */

@media (max-width: 1024px) {

  html body #xx-site-header .xx-menu.xx-home-nav.nav-links,
  html body #xx-site-header #xx-primary-navigation {
    position: static !important;

    display: none !important;

    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    flex: 0 0 100% !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    flex-basis: 100% !important;

    flex-direction: column !important;

    justify-content: flex-start !important;
    align-items: stretch !important;
    align-content: flex-start !important;

    gap: 4px !important;
    row-gap: 4px !important;
    column-gap: 4px !important;

    margin: 0 !important;
    padding: 8px 0 12px !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    overflow: visible !important;

    grid-template-columns: none !important;
  }

  /*
   * R3 Mobile Open State Authority
   * Explicitly outranks the legacy CLOSED authority above.
   */
  html body.xx-nav-open #xx-site-header .xx-menu.xx-home-nav.nav-links,
  html body.xx-nav-open #xx-site-header #xx-primary-navigation {
    display: flex !important;
  }


  html body.xx-nav-open #xx-site-header .xx-menu.xx-home-nav.nav-links,
  html body #xx-site-header .xx-nav-toggle:checked ~ .xx-menu.xx-home-nav.nav-links {
    display: flex !important;
  }

  html body #xx-site-header .drop.xx-mega {
    position: static !important;

    display: block !important;

    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    flex: 0 0 auto !important;

    margin: 0 !important;
    padding: 0 !important;
  }

  html body #xx-site-header .drop.xx-mega > .drop-list,
  html body #xx-site-header .drop.xx-mega > .xx-home-nav__dropdown {
    position: static !important;

    display: none !important;

    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    margin: 4px 0 8px !important;
    padding: 8px !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;

    transform: none !important;

    overflow: visible !important;
  }

  html body #xx-site-header .drop.xx-mega.active > .drop-list,
  html body #xx-site-header .drop.xx-mega.active > .xx-home-nav__dropdown {
    display: grid !important;
  }

  html body #xx-site-header .drop-btn {
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;

    justify-content: space-between !important;

    margin: 0 !important;
  }
}