/**
 * 100Tik Desktop Header — Dark Theme & Theme Control Stabilizer
 * Version: 0.89.0
 * Scope: desktop header only (>= 992px)
 */

@media (min-width: 992px) {
  .htk-header-d.tik10-header-d {
    box-sizing: border-box !important;
    isolation: isolate;
    transition: background .22s ease, border-color .22s ease, box-shadow .22s ease !important;
  }

  .htk-header-d.tik10-header-d .htk-container {
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  .htk-header-d.tik10-header-d .htk-head-right,
  .htk-header-d.tik10-header-d .htk-head-mid,
  .htk-header-d.tik10-header-d .htk-head-left {
    min-width: 0 !important;
  }

  /* Keep all utility controls on one stable baseline. */
  .htk-header-d.tik10-header-d .htk-head-left {
    align-items: center !important;
    flex-wrap: nowrap !important;
  }

  .htk-header-d.tik10-header-d .htk-city-btn,
  .htk-header-d.tik10-header-d .htk-wallet-box,
  .htk-header-d.tik10-header-d .htk-action-btn,
  .htk-header-d.tik10-header-d .tik10-theme-desktop,
  .htk-header-d.tik10-header-d .tik10-lang-desktop {
    box-sizing: border-box !important;
    margin-block: 0 !important;
  }

  /* Theme button: fixed geometry, one icon, no Font Awesome/text collision. */
  .htk-header-d.tik10-header-d .tik10-theme-desktop {
    appearance: none !important;
    -webkit-appearance: none !important;
    position: relative !important;
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    transform: none !important;
    text-indent: 0 !important;
    white-space: nowrap !important;
  }

  .htk-header-d.tik10-header-d .tik10-theme-desktop [data-theme-icon] {
    box-sizing: border-box !important;
    position: static !important;
    flex: 0 0 18px !important;
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    color: currentColor !important;
    font-size: 16px !important;
    line-height: 18px !important;
    text-align: center !important;
    transform: none !important;
  }

  .htk-header-d.tik10-header-d .tik10-theme-desktop [data-theme-icon]::before {
    display: block !important;
    margin: 0 !important;
    line-height: 1 !important;
  }

  .htk-header-d.tik10-header-d .tik10-theme-desktop:hover {
    transform: translateY(-1px) !important;
  }

  .htk-header-d.tik10-header-d .tik10-theme-desktop:active {
    transform: scale(.96) !important;
  }

  .htk-header-d.tik10-header-d .tik10-theme-desktop:focus-visible,
  .htk-header-d.tik10-header-d .tik10-lang-desktop a:focus-visible,
  .htk-header-d.tik10-header-d .htk-city-btn:focus-visible,
  .htk-header-d.tik10-header-d .htk-wallet-box:focus-visible,
  .htk-header-d.tik10-header-d .htk-action-btn:focus-visible,
  .htk-header-d.tik10-header-d .htk-nav-btn:focus-visible {
    outline: 2px solid #ffd800 !important;
    outline-offset: 2px !important;
  }

  /* Language switcher: prevent the active pill from clipping or changing height. */
  .htk-header-d.tik10-header-d .tik10-lang-desktop {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 4px !important;
    gap: 1px !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .htk-header-d.tik10-header-d .tik10-lang-desktop a {
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    min-width: 28px !important;
    height: 28px !important;
    padding: 0 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    line-height: 1 !important;
  }

  /* Light theme keeps the original 100Tik identity, with cleaner control borders. */
  html[data-theme="light"] .htk-header-d.tik10-header-d {
    background: linear-gradient(135deg, #00244b 0%, #035fc7 42%, #087bf0 100%) !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
    box-shadow: 0 8px 25px rgba(3,115,236,.22) !important;
  }

  html[data-theme="light"] .htk-header-d.tik10-header-d .tik10-theme-desktop,
  html[data-theme="light"] .htk-header-d.tik10-header-d .tik10-lang-desktop {
    background: rgba(0,36,75,.52) !important;
    border: 1px solid rgba(255,255,255,.22) !important;
    color: #fff !important;
  }

  /* Dark theme: replace the legacy bright-blue background image, not only background-color. */
  html[data-theme="dark"] .htk-header-d.tik10-header-d {
    background: linear-gradient(135deg, #081522 0%, #0b1d30 48%, #0d2c4a 100%) !important;
    border-bottom: 1px solid rgba(109,157,210,.19) !important;
    box-shadow:
      0 12px 32px rgba(0,0,0,.30),
      inset 0 -1px 0 rgba(255,255,255,.025) !important;
    color: #f5f8fc !important;
  }

  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-titles,
  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-titles h1,
  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-titles p,
  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-nav-btn,
  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-nav-btn span,
  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-wallet-val,
  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-wallet-val small {
    color: #f4f8ff !important;
  }

  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-titles p {
    opacity: .78 !important;
  }

  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-nav-btn {
    border: 1px solid transparent !important;
  }

  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-nav-btn:hover {
    background: rgba(91,154,224,.10) !important;
    border-color: rgba(119,178,241,.12) !important;
  }

  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-nav-btn:hover i,
  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-nav-btn:hover span {
    color: #ffd800 !important;
  }

  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-city-btn,
  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-wallet-box,
  html[data-theme="dark"] .htk-header-d.tik10-header-d .tik10-theme-desktop,
  html[data-theme="dark"] .htk-header-d.tik10-header-d .tik10-lang-desktop {
    background: rgba(5,17,31,.64) !important;
    border-color: rgba(142,181,225,.22) !important;
    color: #f7faff !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025) !important;
  }

  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-city-btn:hover,
  html[data-theme="dark"] .htk-header-d.tik10-header-d .htk-wallet-box:hover,
  html[data-theme="dark"] .htk-header-d.tik10-header-d .tik10-theme-desktop:hover {
    background: rgba(17,50,82,.78) !important;
    border-color: rgba(255,216,0,.58) !important;
  }

  html[data-theme="dark"] .htk-header-d.tik10-header-d .tik10-lang-desktop a {
    color: #dce9f8 !important;
  }

  html[data-theme="dark"] .htk-header-d.tik10-header-d .tik10-lang-desktop a:hover {
    background: rgba(255,255,255,.07) !important;
    color: #fff !important;
  }

  html[data-theme="dark"] .htk-header-d.tik10-header-d .tik10-lang-desktop a.active {
    background: #edf5ff !important;
    color: #102c4e !important;
    box-shadow: 0 1px 5px rgba(0,0,0,.22) !important;
  }

  html[data-theme="dark"] .htk-header-d.tik10-header-d .cart-items-count {
    border-color: #0b1d30 !important;
    box-shadow: 0 2px 7px rgba(0,0,0,.30) !important;
  }

}

/* Avoid control collision in medium desktop widths without changing the legacy breakpoint. */
@media (min-width: 992px) and (max-width: 1420px) {
  .htk-header-d.tik10-header-d .htk-container {
    gap: 8px !important;
  }
  .htk-header-d.tik10-header-d .htk-head-left {
    gap: 4px !important;
  }
  .htk-header-d.tik10-header-d .htk-head-mid {
    gap: 2px !important;
  }
}

@media (min-width: 992px) and (max-width: 1260px) {
  .htk-header-d.tik10-header-d .tik10-theme-desktop {
    flex-basis: 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .htk-header-d.tik10-header-d,
  .htk-header-d.tik10-header-d *,
  .htk-header-d.tik10-header-d *::before,
  .htk-header-d.tik10-header-d *::after {
    transition: none !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}
