/* Keep the native theme hooks and drawers available on the WooCommerce pages. */
.gudo-checkout-style #main-container > #gudo-store-header ~ #header.ct-header,
.gudo-checkout-style #main-container > #gudo-store-footer ~ #footer.ct-footer {
  display: none;
}

.gudo-checkout-style:has(#gudo-store-header) .gudo-member-header {
  display: none;
}

.gudo-checkout-style :is(#gudo-store-header, #gudo-store-footer) {
  --gudo-shell-line: #dfe2e6;
  --gudo-shell-ink: #17191c;
  --gudo-shell-blue: #005cff;
  --gudo-shell-active: #004acb;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
}

.gudo-checkout-style :is(#gudo-store-header, #gudo-store-footer) .wrap {
  box-sizing: border-box;
  width: min(1240px, calc(100% - 88px));
  margin-inline: auto;
}

.gudo-checkout-style #gudo-store-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 100;
  border-block-end: 1px solid var(--gudo-shell-line);
  color: var(--gudo-shell-ink);
  background: #fff;
  color-scheme: light;
}

.gudo-checkout-style.admin-bar #gudo-store-header {
  inset-block-start: var(--wp-admin--admin-bar--height, 32px);
}

#gudo-store-header .header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 82px;
}

#gudo-store-header :is(a, summary, .menu-button) {
  color: inherit;
  text-decoration: none;
}

#gudo-store-header .site-nav {
  display: flex;
  align-items: center;
  gap: 21px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.5;
}

#gudo-store-header .site-nav > a { padding-block: 12px; }
#gudo-store-header .site-nav a:not(.button):hover { color: var(--gudo-shell-active); }
#gudo-store-header .nav-dropdown { position: relative; margin: 0; }

#gudo-store-header .nav-dropdown > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

#gudo-store-header summary::-webkit-details-marker { display: none; }
#gudo-store-header .nav-dropdown > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-block-start: -4px;
  border-inline-end: 1.5px solid;
  border-block-end: 1.5px solid;
  transform: rotate(45deg);
}

#gudo-store-header .nav-dropdown[open] > summary::after {
  margin-block-start: 2px;
  transform: rotate(225deg);
}

#gudo-store-header .nav-dropdown > div {
  position: absolute;
  inset-block-start: calc(100% + 12px);
  inset-inline-start: -18px;
  display: grid;
  min-width: 230px;
  padding: 12px;
  border: 1px solid var(--gudo-shell-line);
  background: #fff;
  box-shadow: 0 12px 26px #10172012;
}

#gudo-store-header .nav-dropdown > div a { padding: 10px 12px; white-space: nowrap; }
#gudo-store-header .nav-dropdown > div a:hover { background: #f1f5fe; }

#gudo-store-header .nav-utility {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-inline-start: 2px;
  padding-inline-start: 22px;
  border-inline-start: 1px solid var(--gudo-shell-line);
}

#gudo-store-header .site-nav .button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid var(--gudo-shell-blue);
  border-radius: 4px;
  color: #fff;
  background: var(--gudo-shell-blue);
  line-height: 1.5;
  white-space: nowrap;
}

#gudo-store-header .site-nav .button:hover { background: var(--gudo-shell-active); }
#gudo-store-header .menu-button {
  display: none;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--gudo-shell-line);
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-weight: 750;
}

#gudo-store-header :is(a, button, summary):focus-visible {
  outline: 3px solid var(--gudo-shell-active);
  outline-offset: 4px;
}

#gudo-store-footer :is(ul, nav) { margin-block-end: 0; }
#gudo-store-footer .gudo-footer-badge img { max-height: none; }
#gudo-store-footer .gudo-footer-brand { text-decoration: none; }

@media (max-width: 1180px) {
  #gudo-store-header .header-row { gap: 20px; }
  #gudo-store-header .site-nav { gap: 14px; }
  #gudo-store-header .nav-utility { gap: 12px; padding-inline-start: 14px; }
  #gudo-store-header .site-nav .button { padding: 9px 12px; }
}

@media (max-width: 1100px) {
  .gudo-checkout-style :is(#gudo-store-header, #gudo-store-footer) .wrap { width: calc(100% - 52px); }
  #gudo-store-header .header-row { min-height: 70px; flex-wrap: wrap; }
  #gudo-store-header.gudo-nav-ready .menu-button { display: block; }
  #gudo-store-header.gudo-nav-ready .site-nav {
    position: absolute;
    inset: 100% 0 auto;
    display: none;
    max-height: calc(100dvh - 70px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 26px 20px;
    border-block-end: 1px solid var(--gudo-shell-line);
    background: #fff;
  }
  #gudo-store-header.gudo-nav-ready .site-nav.open { display: flex; }
  #gudo-store-header .site-nav { align-items: stretch; flex-basis: 100%; flex-direction: column; gap: 4px; }
  #gudo-store-header .site-nav > * { flex-shrink: 0; }
  #gudo-store-header .site-nav > a,
  #gudo-store-header .nav-dropdown summary { min-height: 45px; padding: 10px; font-size: 16px; }
  #gudo-store-header .nav-dropdown > div {
    position: static;
    min-width: 0;
    margin: 4px 0 12px 12px;
    padding: 0 12px;
    border: 0;
    border-inline-start: 2px solid var(--gudo-shell-blue);
    box-shadow: none;
  }
  #gudo-store-header .nav-utility {
    align-items: start;
    flex-direction: column;
    gap: 14px;
    margin: 10px 0 0;
    padding: 12px 0 4px;
    border: 0;
    border-block-start: 1px solid var(--gudo-shell-line);
  }
  #gudo-store-header .nav-utility > .button { margin-inline-start: 10px; padding: 11px 22px; }
}

@media (max-width: 782px) {
  .gudo-checkout-style.admin-bar #gudo-store-header { inset-block-start: var(--wp-admin--admin-bar--height, 46px); }
  .gudo-checkout-style :is(#gudo-store-header, #gudo-store-footer) .wrap { width: calc(100% - 36px); }
}

@media (max-width: 600px) {
  .gudo-checkout-style.admin-bar #gudo-store-header { inset-block-start: 0; }
}
