/* Dystant shared header v1. Product styles provide the design tokens; fallbacks keep the shell usable. */
.dystant-header-host { display: contents; }

.v9-site-header.site-header,
.dystant-header {
  position: sticky;
  z-index: 100;
  top: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line, #d8d8d2) 78%, transparent);
  border-radius: 0;
  background: color-mix(in srgb, var(--bg, #fff) 91%, transparent);
  box-shadow: none;
  backdrop-filter: blur(16px) saturate(140%);
}

.v9-header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-5, 1.25rem);
  width: min(var(--content, 80rem), calc(100% - 3rem));
  min-height: 4.25rem;
  margin-inline: auto;
}

.v9-brand.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--text, #171715); text-decoration: none; }
.v9-brand .brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--text, #171715);
  border-radius: 50%;
  background: var(--text, #171715);
  color: var(--bg, #fff);
  box-shadow: none;
  font-size: .75rem;
  font-weight: 800;
}
.v9-brand .brand-mark.has-image {
  overflow: visible;
  width: 2.05rem;
  height: 2.55rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.v9-brand .brand-mark.has-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px color-mix(in srgb, #3b2408 20%, transparent));
}
.v9-brand-copy { display: grid; }
.v9-brand strong { font-size: .83rem; letter-spacing: .15em; }
.v9-brand small { margin: .05rem 0 0; color: var(--text-faint, #70706a); font-size: .62rem; letter-spacing: .06em; }

.v9-primary-nav { justify-self: center; }
.v9-primary-nav ul { display: flex; align-items: center; gap: .15rem; margin: 0; padding: 0; list-style: none; }
.v9-primary-nav li { margin: 0; }
.v9-primary-nav a {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  padding: 0 .58rem;
  border-radius: var(--radius-sm, .45rem);
  color: var(--text-soft, #494944);
  font-size: .79rem;
  font-weight: 640;
  text-decoration: none;
}
.v9-primary-nav a:hover { background: var(--bg-subtle, #f4f4f0); color: var(--text, #171715); }
.v9-primary-nav a[aria-current="page"] { background: var(--accent-soft, #f1eee4); color: var(--accent-strong, #6f5717); }

.v9-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.v9-icon-button,
.v9-search-button,
.v9-menu-button,
.dystant-product-link,
.dystant-auth-button {
  display: inline-flex;
  min-width: 2.75rem;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: 0 .72rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, .45rem);
  background: transparent;
  color: var(--text-soft, #494944);
  font: inherit;
  font-size: .78rem;
  font-weight: 680;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.v9-icon-button:hover,
.v9-search-button:hover,
.v9-menu-button:hover,
.dystant-product-link:hover,
.dystant-auth-button:hover { border-color: var(--line, #d8d8d2); background: var(--bg-raised, #fff); color: var(--text, #171715); }
.v9-search-button,
.dystant-product-link { border-color: var(--line, #d8d8d2); background: var(--bg-raised, #fff); }
.dystant-auth-button { min-width: 5.25rem; border-color: var(--text, #171715); background: var(--text, #171715); color: var(--bg, #fff); }
.dystant-auth-button:hover { border-color: var(--accent-strong, #6f5717); background: var(--accent-strong, #6f5717); color: #fff; }
.dystant-auth-button:disabled { opacity: .58; cursor: wait; }
.dystant-auth-button.is-error { border-color: var(--line-strong, #aaa); background: var(--bg-raised, #fff); color: var(--text, #171715); }
.dystant-auth-slot { display: inline-flex; }
.v9-menu-button { display: none; }
.v9-menu-lines,
.v9-menu-lines::before,
.v9-menu-lines::after { display: block; width: 1.05rem; height: 1.5px; background: currentColor; content: ""; }
.v9-menu-lines { position: relative; }
.v9-menu-lines::before { position: absolute; top: -.34rem; }
.v9-menu-lines::after { position: absolute; top: .34rem; }

.v9-search-dialog {
  width: min(42rem, calc(100% - 2rem));
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--line, #d8d8d2);
  border-radius: var(--radius-lg, 1rem);
  background: var(--bg-raised, #fff);
  color: var(--text, #171715);
  box-shadow: var(--shadow-md, 0 1rem 3rem rgba(0, 0, 0, .14));
}
.v9-search-dialog::backdrop { background: rgba(15, 15, 13, .5); backdrop-filter: blur(4px); }
.v9-search-dialog form { padding: var(--space-6, 1.5rem); }
.v9-search-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4, 1rem); margin-bottom: var(--space-4, 1rem); }
.v9-search-dialog-head strong { font-size: 1.05rem; }
.v9-dialog-close { min-width: 2.75rem; min-height: 2.75rem; border: 0; border-radius: 50%; background: var(--bg-subtle, #f4f4f0); cursor: pointer; }
.v9-dialog-field { display: grid; grid-template-columns: 1fr auto; gap: .6rem; }
.v9-dialog-field input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0 1rem;
  border: 1px solid var(--line-strong, #aaa);
  border-radius: var(--radius-md, .7rem);
  background: var(--bg, #fff);
  color: var(--text, #171715);
}
.v9-dialog-field button { min-height: 3.25rem; padding: 0 1.1rem; border: 0; border-radius: var(--radius-md, .7rem); background: var(--text, #171715); color: var(--bg, #fff); font-weight: 720; cursor: pointer; }
.v9-dialog-help { margin: .8rem 0 0; color: var(--text-faint, #70706a); font-size: .78rem; }

.dystant-header :is(a, button, input):focus-visible { outline: 3px solid var(--accent, #9d7d24); outline-offset: 2px; }

@media (max-width: 68rem) {
  .v9-header-inner { grid-template-columns: auto 1fr auto; }
  .v9-menu-button { display: inline-flex; }
  .v9-primary-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    width: 100%;
    justify-self: stretch;
    display: none;
    padding: .75rem 1.5rem 1rem;
    border-bottom: 1px solid var(--line, #d8d8d2);
    background: var(--bg-raised, #fff);
    box-shadow: var(--shadow-md, 0 1rem 3rem rgba(0, 0, 0, .14));
  }
  .v9-site-header[data-menu-open="true"] .v9-primary-nav { display: block; }
  .v9-primary-nav ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .v9-primary-nav a { justify-content: center; }
}

@media (max-width: 48rem) {
  .v9-header-inner { width: min(100% - 2rem, var(--content, 80rem)); }
  .v9-brand small { display: none; }
  .v9-search-button span,
  .v9-search-button kbd { display: none; }
  .v9-search-button::before { content: "⌕"; font-size: 1.3rem; font-weight: 500; line-height: 1; }
  .v9-icon-button { display: none; }
  .v9-primary-nav { padding-inline: 1rem; }
  .v9-primary-nav ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v9-primary-nav a { justify-content: flex-start; }
}

@media (max-width: 30rem) {
  .v9-header-inner { gap: .5rem; }
  .v9-brand-copy { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .v9-icon-button,
  .v9-search-button,
  .v9-menu-button,
  .dystant-product-link,
  .dystant-auth-button { padding-inline: .48rem; }
  .dystant-auth-button { min-width: 4.5rem; }
  .v9-dialog-field { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .dystant-header *,
  .dystant-header *::before,
  .dystant-header *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
