/* Talking Headsets Dealer Header Layouts v2 — Astra/Spectra/WooCommerce/FiboSearch */
.thdh-header {
  --thdh-green: #08746d;
  --thdh-green-2: #0a8a80;
  --thdh-green-dark: #005a55;
  --thdh-green-deep: #043f3b;
  --thdh-red: #d8212f;
  --thdh-ink: #0b2630;
  --thdh-muted: #60777c;
  --thdh-soft: #f3f8f7;
  --thdh-soft-2: #e7f2f0;
  --thdh-line: #d7e7e4;
  --thdh-white: #ffffff;
  --thdh-shadow: 0 16px 42px rgba(4, 63, 59, .13);
  --thdh-shadow-soft: 0 10px 28px rgba(4, 63, 59, .08);
  --thdh-radius: 18px;
  position: relative;
  z-index: 900;
  width: 100%;
  background: #fff;
  color: var(--thdh-ink);
  font-family: inherit;
  line-height: 1.35;
  box-shadow: 0 1px 0 var(--thdh-line);
}
.thdh-header,
.thdh-header * { box-sizing: border-box; }
.thdh-header a { color: inherit; text-decoration: none; }
.thdh-header img { max-width: 100%; height: auto; display: block; }
.thdh-container { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }
.thdh-sticky { position: sticky; top: 0; }
body.admin-bar .thdh-sticky { top: 32px; }

/* Top strip */
.thdh-top-strip {
  background: var(--thdh-green-deep);
  color: #e9f8f6;
  font-size: 13px;
}
.thdh-top-strip-light { background: #f7fbfa; color: var(--thdh-green-dark); border-bottom: 1px solid var(--thdh-line); }
.thdh-top-strip-portal { background: linear-gradient(90deg, var(--thdh-green-deep), var(--thdh-green)); }
.thdh-top-inner {
  min-height: 40px;
  padding-top: 8px;
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.thdh-top-message { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; }
.thdh-top-message::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--thdh-red); box-shadow: 0 0 0 4px rgba(216,33,47,.17); }
.thdh-top-contact { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; color: rgba(255,255,255,.86); }
.thdh-top-strip-light .thdh-top-contact { color: var(--thdh-muted); }
.thdh-top-contact a { color: inherit !important; font-weight: 850; }
.thdh-top-contact a:hover { color: #fff !important; }
.thdh-top-strip-light .thdh-top-contact a:hover { color: var(--thdh-green-dark) !important; }

/* Core rows */
.thdh-main-row,
.thdh-compact-row,
.thdh-portal-row {
  display: grid;
  align-items: center;
  gap: 22px;
}
.thdh-main-row { grid-template-columns: 238px minmax(320px, 1fr) auto auto; min-height: 92px; }
.thdh-compact-row { grid-template-columns: 215px minmax(360px, 1fr) auto auto; min-height: 74px; }
.thdh-portal-row { grid-template-columns: 225px minmax(200px, 1fr) auto auto; min-height: 76px; }

.thdh-logo { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.thdh-logo img { width: 230px; max-width: 100%; height: auto; }
.thdh-logo-text { display: none; color: var(--thdh-green-dark); font-weight: 900; letter-spacing: -.02em; }

/* FiboSearch: force full bar, right aligned submit button, mobile-friendly sizing */
.thdh-fibosearch { width: 100%; min-width: 0; }
.thdh-fibosearch .dgwt-wcas-search-wrapp { width: 100% !important; max-width: none !important; min-width: 0 !important; }
.thdh-fibosearch .dgwt-wcas-search-form,
.thdh-fibosearch .dgwt-wcas-sf-wrapp {
  width: 100% !important;
  min-width: 0 !important;
}
.thdh-fibosearch .dgwt-wcas-sf-wrapp {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  padding: 5px !important;
  border: 2px solid rgba(8,116,109,.18) !important;
  border-radius: 999px !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(4,63,59,.08) !important;
  overflow: visible !important;
}
.thdh-fibosearch input[type="search"],
.thdh-fibosearch .dgwt-wcas-search-input {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 48px !important;
  height: 48px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: var(--thdh-ink) !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 650 !important;
  padding-left: 18px !important;
  padding-right: 78px !important;
}
.thdh-fibosearch input[type="search"]::placeholder,
.thdh-fibosearch .dgwt-wcas-search-input::placeholder { color: #80989c !important; opacity: 1; }
.thdh-fibosearch .dgwt-wcas-search-submit,
.thdh-fibosearch button[type="submit"] {
  position: absolute !important;
  inset: 8px 8px 8px auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 54px !important;
  width: 54px !important;
  height: auto !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--thdh-green) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(8,116,109,.24) !important;
  cursor: pointer;
  opacity: 1 !important;
}
.thdh-fibosearch .dgwt-wcas-search-submit:hover,
.thdh-fibosearch button[type="submit"]:hover { background: var(--thdh-green-dark) !important; color: #fff !important; }
.thdh-fibosearch .dgwt-wcas-search-submit svg,
.thdh-fibosearch .dgwt-wcas-search-submit path { fill: #fff !important; color: #fff !important; }
.thdh-fibosearch .dgwt-wcas-ico-magnifier { opacity: 1 !important; }
.thdh-fibosearch .dgwt-wcas-layout-icon,
.thdh-fibosearch .dgwt-wcas-search-icon { width: 100% !important; }

.thdh-fibosearch-fallback {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  padding: 5px;
  border: 2px solid rgba(8,116,109,.18);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--thdh-shadow-soft);
}
.thdh-fibosearch-fallback input[type="search"] { min-height: 48px; border: 0; outline: 0; padding: 0 18px; color: var(--thdh-ink); background: transparent; font-weight: 650; min-width: 0; }
.thdh-fibosearch-fallback button { min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--thdh-green); color: #fff; font-weight: 900; cursor: pointer; white-space: nowrap; }
.thdh-fibosearch-fallback button:hover { background: var(--thdh-green-dark); }

/* Actions and buttons */
.thdh-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; white-space: nowrap; }
.thdh-btn,
.thdh-btn:visited,
.thdh-icon-link,
.thdh-icon-link:visited,
.thdh-cart-link,
.thdh-cart-link:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 999px;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.05;
  text-decoration: none !important;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.thdh-btn:hover,
.thdh-icon-link:hover,
.thdh-cart-link:hover { transform: translateY(-1px); }
.thdh-btn-primary,
.thdh-btn-primary:visited,
.thdh-cart-link,
.thdh-cart-link:visited { background: var(--thdh-green) !important; color: #fff !important; border: 1px solid var(--thdh-green) !important; box-shadow: 0 10px 22px rgba(8,116,109,.20); }
.thdh-btn-primary:hover,
.thdh-cart-link:hover { background: var(--thdh-green-dark) !important; border-color: var(--thdh-green-dark) !important; color: #fff !important; }
.thdh-btn-outline,
.thdh-btn-outline:visited,
.thdh-icon-link,
.thdh-icon-link:visited { background: #fff !important; color: var(--thdh-green-dark) !important; border: 1px solid var(--thdh-line) !important; }
.thdh-btn-outline:hover,
.thdh-icon-link:hover { border-color: rgba(8,116,109,.36) !important; background: var(--thdh-soft) !important; color: var(--thdh-green-dark) !important; }
.thdh-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--thdh-green-dark); font-size: 12px; line-height: 1; }
.thdh-account-card { display: grid; gap: 1px; align-content: center; min-height: 46px; padding: 8px 14px; border: 1px solid var(--thdh-line); border-radius: 15px; background: var(--thdh-soft); }
.thdh-account-card span { color: var(--thdh-ink); font-size: 13px; font-weight: 900; line-height: 1.1; }
.thdh-account-card a { color: var(--thdh-green) !important; font-size: 12px; font-weight: 900; }

/* WordPress menu styling */
.thdh-nav-row { border-top: 1px solid var(--thdh-line); border-bottom: 1px solid var(--thdh-line); background: linear-gradient(180deg, #fff, #fbfefd); }
.thdh-nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 54px; }
.thdh-nav { min-width: 0; flex: 1 1 auto; }
.thdh-menu,
.thdh-menu ul { list-style: none; margin: 0; padding: 0; }
.thdh-menu { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
.thdh-menu > li { position: relative; display: inline-flex; }
.thdh-menu a {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--thdh-ink) !important;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  text-decoration: none !important;
}
.thdh-menu a:hover,
.thdh-menu .current-menu-item > a,
.thdh-menu .current-menu-ancestor > a { background: var(--thdh-soft); color: var(--thdh-green-dark) !important; }
.thdh-menu .menu-item-has-children > a::after {
  content: "⌄";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: .52rem;
  line-height: 1;
  font-size: .9em;
  color: var(--thdh-green);
  transform: translateY(-1px);
}
.thdh-menu .sub-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  min-width: 238px;
  max-width: min(92vw, 430px);
  padding: 10px;
  border: 1px solid var(--thdh-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--thdh-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 30;
}
.thdh-menu .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.thdh-menu li:hover > .sub-menu,
.thdh-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.thdh-menu .sub-menu li { display: block; position: relative; }
.thdh-menu .sub-menu a { display: flex; width: 100%; justify-content: space-between; min-height: 38px; padding: 9px 11px; border-radius: 12px; color: var(--thdh-green-dark) !important; font-size: 13px; background: transparent; }
.thdh-menu .sub-menu a:hover { background: var(--thdh-soft); }
.thdh-menu .sub-menu .sub-menu { left: calc(100% + 8px); top: 0; }

/* Mobile toggle */
.thdh-mobile-toggle { display: none; align-items: center; justify-content: center; flex-direction: column; gap: 4px; width: 48px; height: 48px; border: 1px solid var(--thdh-line); border-radius: 15px; background: #fff; cursor: pointer; padding: 0; }
.thdh-mobile-toggle span { display: block; width: 21px; height: 2px; border-radius: 99px; background: var(--thdh-green-dark); transition: transform .18s ease, opacity .18s ease; }
.thdh-mobile-toggle em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.thdh-mobile-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.thdh-mobile-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.thdh-mobile-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.thdh-mobile-actions { display: none; }

/* Compact Commerce Bar */
.thdh-compact-commerce-bar { border-top: 3px solid var(--thdh-green); }
.thdh-compact-commerce-bar .thdh-logo img { width: 205px; }
.thdh-nav-inline .thdh-menu { justify-content: center; flex-wrap: nowrap; overflow: visible; }
.thdh-nav-inline .thdh-menu a { font-size: 13px; padding-left: 10px; padding-right: 10px; }
.thdh-actions-compact .thdh-account-card { display: none; }
.thdh-compact-search-strip { background: var(--thdh-soft); border-top: 1px solid var(--thdh-line); }
.thdh-compact-search-inner { display: grid; grid-template-columns: auto minmax(280px, 1fr); align-items: center; gap: 16px; min-height: 66px; }
.thdh-search-caption { color: var(--thdh-green-dark); font-size: 12px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.thdh-compact-mobile-panel { display: none; border-top: 1px solid var(--thdh-line); background: #fff; }

/* Dealer Portal Stack */
.thdh-portal-stack { background: #fff; }
.thdh-portal-identity { background: #fff; border-bottom: 1px solid var(--thdh-line); }
.thdh-portal-copy { display: grid; gap: 2px; min-width: 0; }
.thdh-portal-copy strong { color: var(--thdh-green-dark); font-size: 15px; font-weight: 950; letter-spacing: -.01em; }
.thdh-portal-copy span { color: var(--thdh-muted); font-size: 13px; font-weight: 750; }
.thdh-portal-search-wrap { background: linear-gradient(135deg, var(--thdh-green-deep), var(--thdh-green)); padding: 14px 0; }
.thdh-portal-search-row { display: block; }
.thdh-portal-search-wrap .thdh-fibosearch .dgwt-wcas-sf-wrapp,
.thdh-portal-search-wrap .thdh-fibosearch-fallback { border-color: rgba(255,255,255,.45) !important; box-shadow: 0 16px 40px rgba(0,0,0,.14) !important; }
.thdh-portal-panel { background: #fff; }

/* Logged out nudges */
.thdh-user-logged-out .thdh-account-card { display: none; }

@media (max-width: 1180px) {
  .thdh-main-row { grid-template-columns: 210px minmax(280px, 1fr) auto auto; }
  .thdh-compact-row { grid-template-columns: 190px minmax(260px, 1fr) auto auto; gap: 14px; }
  .thdh-portal-row { grid-template-columns: 205px minmax(180px, 1fr) auto auto; }
  .thdh-account-card { display: none; }
  .thdh-menu a { padding-left: 9px; padding-right: 9px; font-size: 13px; }
}

@media (max-width: 1000px) {
  .thdh-container { width: min(100% - 28px, 1240px); }
  .thdh-top-inner { justify-content: center; text-align: center; flex-wrap: wrap; gap: 8px 14px; }
  .thdh-top-contact { justify-content: center; }
  .thdh-main-row,
  .thdh-compact-row,
  .thdh-portal-row {
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 12px;
    min-height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .thdh-logo img,
  .thdh-compact-commerce-bar .thdh-logo img { width: 202px; }
  .thdh-fibosearch { grid-column: 1 / -1; order: 3; }
  .thdh-actions,
  .thdh-actions-compact,
  .thdh-portal-copy,
  .thdh-nav-inline { display: none; }
  .thdh-mobile-toggle { display: inline-flex; justify-self: end; }
  .thdh-nav-row,
  .thdh-compact-mobile-panel { display: none; }
  .thdh-mobile-panel.is-open { display: block; }
  .thdh-mobile-panel {
    border-top: 1px solid var(--thdh-line);
    border-bottom: 1px solid var(--thdh-line);
    background: #fff;
    max-height: calc(100vh - 168px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 14px 32px rgba(4,63,59,.10);
  }
  .thdh-nav-inner { display: block; min-height: 0; padding-top: 12px; padding-bottom: 18px; }
  .thdh-menu { display: grid; gap: 7px; width: 100%; }
  .thdh-menu > li { display: block; width: 100%; }
  .thdh-menu a { display: flex; justify-content: space-between; width: 100%; min-height: 46px; padding: 12px 14px; border-radius: 14px; background: var(--thdh-soft); color: var(--thdh-ink) !important; font-size: 15px; }
  .thdh-menu .menu-item-has-children > a::after { margin-left: 14px; font-size: 1rem; }
  .thdh-menu .sub-menu,
  .thdh-menu .sub-menu .sub-menu {
    position: static;
    max-width: none;
    min-width: 0;
    width: 100%;
    padding: 7px 0 2px 12px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .thdh-menu .sub-menu::before { display: none; }
  .thdh-menu .sub-menu a { min-height: 42px; padding: 10px 12px; background: #fff; border: 1px solid var(--thdh-line); font-size: 14px; }
  .thdh-mobile-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--thdh-line); }
  .thdh-mobile-actions .thdh-icon-link,
  .thdh-mobile-actions .thdh-cart-link { width: 100%; min-height: 44px; padding-left: 10px; padding-right: 10px; }
  .thdh-compact-search-inner { grid-template-columns: 1fr; gap: 8px; padding-top: 10px; padding-bottom: 12px; }
  .thdh-search-caption { text-align: center; }
  .thdh-portal-search-wrap { padding: 10px 0 12px; }
}

@media (max-width: 600px) {
  body.admin-bar .thdh-sticky { top: 46px; }
  .thdh-container { width: min(100% - 22px, 1240px); }
  .thdh-top-strip { font-size: 12px; }
  .thdh-top-inner { padding-top: 9px; padding-bottom: 9px; }
  .thdh-top-message { line-height: 1.25; }
  .thdh-top-contact { display: none; }
  .thdh-logo img,
  .thdh-compact-commerce-bar .thdh-logo img { width: 186px; }
  .thdh-mobile-toggle { width: 46px; height: 46px; border-radius: 14px; }
  .thdh-fibosearch .dgwt-wcas-sf-wrapp { padding: 4px !important; border-radius: 18px !important; }
  .thdh-fibosearch input[type="search"],
  .thdh-fibosearch .dgwt-wcas-search-input { min-height: 46px !important; height: 46px !important; padding-left: 14px !important; padding-right: 68px !important; font-size: 14px !important; }
  .thdh-fibosearch .dgwt-wcas-search-submit,
  .thdh-fibosearch button[type="submit"] { inset: 7px 7px 7px auto !important; width: 50px !important; min-width: 50px !important; }
  .thdh-fibosearch-fallback { grid-template-columns: minmax(0, 1fr) 50px; border-radius: 18px; padding: 4px; }
  .thdh-fibosearch-fallback input[type="search"] { min-height: 46px; padding-left: 14px; }
  .thdh-fibosearch-fallback button { min-height: 46px; width: 50px; padding: 0; overflow: hidden; text-indent: -999px; position: relative; }
  .thdh-fibosearch-fallback button::after { content: "⌕"; position: absolute; inset: 0; display: grid; place-items: center; text-indent: 0; font-size: 20px; }
  .thdh-mobile-panel { max-height: calc(100vh - 156px); }
  .thdh-mobile-actions { grid-template-columns: 1fr; }
  .thdh-menu a { font-size: 14px; }
  .thdh-menu .sub-menu a { font-size: 13px; }
}
