/* 補上共用控制項的互動狀態，以及企劃指定的夥伴選單。 */
.affiliate-header.affiliate-site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: 60px;
  background: transparent;
  border: 0;
  box-shadow: none;
  transition: none;
  --color-white: #fff;
  --color-primary: rgb(24 37 54);
  --color-primary-rgba: rgb(24 37 54 / 87%);
  --color-primary-rgba-6: rgb(24 37 54 / 6%);
  --color-primary-rgba-54: rgb(24 37 54 / 54%);
  --color-primary-rgba-70: rgb(24 37 54 / 70%);
  --color-link-primary: #213b7e;
  --color-bg-primary: #fafafa;
  --color-bg-secondary: rgb(4 16 32);
  --color-bg-secondary-3: rgb(4 16 32 / 3%);
  --color-bg-secondary-6: rgb(4 16 32 / 6%);
}

.affiliate-site-header [hidden] {
  display: none !important;
}

.affiliate-site-header button.nav-link {
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.affiliate-site-header .main_button {
  padding: 8px 16px;
  border-radius: 4px;
  color: #fff;
  background-color: var(--color-link-red, #e9493f);
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
}

.affiliate-site-header .main_button:hover {
  color: #fff;
  background-color: var(--color-link-red-hover, #cb221a);
}

.affiliate-site-header .t3navbar-bg {
  z-index: 1029;
}

.affiliate-site-header .t3navbar .nav-link > .icon {
  color: inherit;
}

.affiliate-site-header .t3navbar-nav {
  z-index: 1030;
}

.affiliate-site-header .t3navbar-cards,
.affiliate-site-header .t3navbar-searchbox {
  z-index: 1031;
}

.affiliate-site-header .smwrap {
  opacity: 0;
}

.affiliate-site-header .search_bg {
  display: none;
  position: fixed;
  inset: 60px 0 0;
  background: rgb(0 0 0 / 30%);
  z-index: 1028;
}

.affiliate-site-header.open-searchbox .search_bg {
  display: block;
}

.affiliate-site-header.open-searchbox .t3navbar-searchbox {
  opacity: 1;
  pointer-events: auto;
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
}

.affiliate-site-header .header-notice-entry {
  display: inline-flex;
  align-items: center;
  position: relative;
  text-decoration: none;
}

.affiliate-site-header .header-notice-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #de241c;
  pointer-events: none;
}

.affiliate-site-header .member-toggle {
  cursor: pointer;
}

.affiliate-site-header .partner-avatar {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background-color: #6415e8;
  color: #fff;
}

.affiliate-site-header .partner-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.affiliate-site-header .partner-avatar img[hidden],
.affiliate-site-header .partner-avatar [data-partner-avatar-initial][hidden] {
  display: none;
}

.affiliate-site-header .partner-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.affiliate-site-header .t3navbar-cards-member .partner-footer {
  display: flex;
  flex-direction: column;
  padding: 10px 18px;
}

.affiliate-site-header .partner-footer button,
.affiliate-site-header .header-dialog-actions button {
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.affiliate-site-header .partner-footer button {
  text-align: left;
}

.affiliate-site-header .partner-signout {
  color: #9a5050;
}

.affiliate-site-header .t3navbar-nav-l1menu .nav-link .icon {
  margin-right: 8px;
}

.affiliate-site-header .t3navbar-cards .card-header {
  min-height: 72px;
}

.affiliate-site-header .header-switch-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid #d5d9df;
  border-radius: 6px;
  color: #182225;
  background: #fff;
  font-size: 15px;
}

.affiliate-site-header .header-switch-dialog::backdrop {
  background: rgb(0 0 0 / 45%);
}

.affiliate-site-header .header-switch-dialog h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.affiliate-site-header .header-switch-dialog p {
  margin: 0 0 16px;
  line-height: 1.7;
}

.affiliate-site-header .header-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.affiliate-site-header .header-dialog-actions [data-switch-confirm] {
  color: #fff;
  background: #243f78;
  border-radius: 4px;
}

.affiliate-site-header [aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.affiliate-site-header .header-action-error {
  color: #b42318;
}

.affiliate-site-header .header-floating-error {
  position: fixed;
  top: 68px;
  right: 16px;
  z-index: 1032;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border: 1px solid #f1bbb5;
  background: #fff4f2;
}

.affiliate-site-header :focus-visible {
  outline: 2px solid #2375bd;
  outline-offset: 2px;
}

@media (min-width: 992px) {
  .affiliate-site-header .t3navbar-nav-l1menu {
    overflow: visible;
  }

  .affiliate-site-header[data-partner="true"] .t3navbar-nav-links > li:has([data-key="open-searchbox"]),
  .affiliate-site-header[data-partner="true"] .t3navbar-nav-links > li:has(a[href="/cart"]) {
    display: none !important;
  }

  .affiliate-site-header .t3navbar-nav-l1menu > .nav-item[data-key] {
    position: static;
  }

  .affiliate-site-header .t3navbar-nav-l1menu .add_.l3menu {
    left: 308px;
  }

  .affiliate-site-header.open-l2-b2 .t3navbar-nav-l1menu .add_.l3menu {
    left: 422px;
  }

  .affiliate-site-header .t3navbar-cards {
    pointer-events: none;
  }

  .affiliate-site-header .t3navbar-cards > .card {
    pointer-events: auto;
  }
}

@media (max-width: 991.98px) {
  .affiliate-site-header .t3navbar-nav {
    height: 100dvh;
    padding-top: 0;
  }

  .affiliate-site-header .t3navbar-nav-avatar-info {
    list-style: none;
  }

  .affiliate-site-header .t3navbar-nav-l1menu .nav-link {
    width: 100%;
    font-weight: 600;
  }

  .affiliate-site-header[data-partner="true"] .t3navbar-nav-l1menu > .nav-item[data-key].mt-2 {
    margin-top: 0 !important;
  }

  .affiliate-site-header .t3navbar-nav-l1menu .smwrap.has-subcategory {
    display: flex !important;
    top: 54px;
    bottom: 0;
    height: auto;
    left: 0;
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
  }

  .affiliate-site-header.open-menu.open-l2-b1 .nav-item[data-key="open-l2-b1"] > .l3menu {
    left: 0 !important;
    opacity: 1;
    pointer-events: auto;
  }

  .affiliate-site-header .t3navbar-bg-tools {
    align-items: center;
  }

  .affiliate-site-header[data-partner="true"] [data-cart-link] {
    display: none;
  }

  .affiliate-site-header .t3navbar-nav-l1menu {
    overscroll-behavior: contain;
  }

  .affiliate-site-header .t3navbar-cards > .card {
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
  }
}
