/* BestDoors Core — Navbar
   Matches: logo + tagline | centered menu | search / account / cart
*/

.bdc-site-header {
  --bdc-text: #2c2c2c;
  --bdc-tagline: #b08d57;
  --bdc-bg: #ffffff;
  --bdc-header-height: 88px;
  position: relative;
  z-index: 200;
  color: var(--bdc-text);
  font-family: var(--bdc-font-family, system-ui, -apple-system, "Segoe UI", sans-serif);
}

.bdc-site-header.is-sticky {
  position: sticky;
  top: 0;
}

.bdc-site-header.bdc-style-solid {
  background: var(--bdc-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.bdc-site-header.bdc-style-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.55) 55%, rgba(255, 255, 255, 0) 100%);
  border-bottom: 0;
}

.bdc-site-header.bdc-style-overlay.is-sticky.is-scrolled {
  position: fixed;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.bdc-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  min-height: var(--bdc-header-height);
  padding: 0.75rem 1.5rem;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 1rem;
}

/* Brand */
.bdc-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
}

.bdc-brand-link {
  text-decoration: none;
  color: inherit;
  line-height: 1;
}

.bdc-brand-title {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bdc-text);
}

.bdc-logo {
  display: block;
  max-height: var(--bdc-logo-height, 48px);
  height: var(--bdc-logo-height, 48px);
  width: auto;
}

.bdc-tagline {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bdc-tagline);
  font-weight: 500;
  line-height: 1.3;
}

/* Nav */
.bdc-nav {
  justify-self: center;
}

.bdc-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 1.75rem;
}

.bdc-menu > li {
  position: relative;
}

.bdc-menu a {
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--bdc-text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.bdc-menu a:hover,
.bdc-menu a:focus,
.bdc-menu .current-menu-item > a {
  opacity: 0.65;
}

.bdc-menu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: 0.18s ease;
  z-index: 20;
}

.bdc-menu > li:hover > .sub-menu,
.bdc-menu > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.bdc-menu .sub-menu a {
  display: block;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

/* Actions */
.bdc-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bdc-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bdc-text);
  cursor: pointer;
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.bdc-action:hover,
.bdc-action:focus {
  background: rgba(0, 0, 0, 0.05);
  color: var(--bdc-text);
}

.bdc-cart-count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--bdc-tagline);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.bdc-cart-count.is-empty {
  display: none;
}

/* Mobile toggle */
.bdc-menu-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  padding: 0.45rem 0.7rem;
  color: var(--bdc-text);
  cursor: pointer;
}

.bdc-menu-toggle-bars,
.bdc-menu-toggle-bars::before,
.bdc-menu-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
}

.bdc-menu-toggle-bars::before,
.bdc-menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.bdc-menu-toggle-bars::before {
  top: -6px;
}

.bdc-menu-toggle-bars::after {
  top: 6px;
}

/* Search panel */
.bdc-search-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1rem 1.5rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.bdc-search-panel[hidden] {
  display: none;
}

.bdc-search-form {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.bdc-search-field {
  flex: 1;
  min-height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  padding: 0.5rem 0.85rem;
  font-size: 1rem;
}

.bdc-search-submit {
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  background: #1a1a1a;
  color: #fff;
  padding: 0 1rem;
  cursor: pointer;
  font-weight: 600;
}

.bdc-search-close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 0.25rem 0.5rem;
}

/* Overlay layout: push content only for solid style */
body.bdc-header-style-solid .bd-site-content,
body.bdc-header-style-solid .bdc-site-content {
  /* default flow */
}

body.bdc-header-style-overlay.admin-bar .bdc-site-header.is-sticky.is-scrolled {
  top: 32px;
}

/* Screen reader */
.bdc-site-header .screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Responsive */
@media (max-width: 900px) {
  .bdc-header-inner {
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "brand toggle actions"
      "nav nav nav";
  }

  .bdc-brand {
    grid-area: brand;
  }

  .bdc-menu-toggle {
    display: inline-flex;
    grid-area: toggle;
  }

  .bdc-actions {
    grid-area: actions;
  }

  .bdc-nav {
    grid-area: nav;
    display: none;
    width: 100%;
    justify-self: stretch;
    padding-bottom: 0.75rem;
  }

  .bdc-nav.is-open {
    display: block;
  }

  .bdc-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .bdc-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    padding-left: 1rem;
    background: transparent;
  }

  .bdc-site-header.bdc-style-overlay {
    background: rgba(255, 255, 255, 0.96);
  }
}
