/* Header-Next Block
 * Mobile-first responsive navigation
 * Follows CSS specificity rules: base → modifiers → states
 */

/* ==========================================================================
   Z-index map
   --------------------------------------------------------------------------
   .header is position:fixed + z-index:100 — this creates a stacking context.
   Every panel, drawer, and overlay rendered inside .header (whether owned by
   header.css or a sibling block like minicart.css / search-drawer.css) stacks
   *locally* against the values below; .header itself is the only thing inside
   this file that stacks globally above page content.

   Global fixed elements OUTSIDE the header competing at the page level:
      100  .header                       (this file)
       30  .document-reader-toc          reader TOC panel (styles/document-reader.css)
            — above in-content overlays (faceted-filters 20, interactive-platform 10,
              carousel slide-link overlay 2), below the header.

   Positioned descendants of .header competing for paint order. DOM parents
   vary — these are stacking relationships, not direct children. Following
   mobile-first ordering: base values apply on mobile; desktop adds or
   overrides under @media (width >= 900px).

   ── Mobile (base) ─────────────────────────────────────────────────────
     200  .nav-panel           submenu drawer (slides in below header bar)
     200  .nav-language-panel  globe panel    (slides in below header bar)
     101  .search-drawer-panel search panel (search-drawer.css)
      99  .nav-sections        main menu container

   On mobile, .nav-panel / .nav-language-panel are inset below the header
   bar (top: var(--header-height)) and need 200 to sit above .nav-sections
   (99) so the submenu paints over the main menu when both are open. The
   header bar stays visible by geometry, not z-order — the panels start
   below it.

   .nav-panel-backdrop is mounted as a sibling of .nav-sections (not inside
   it) so the slide-in panels escape .nav-sections's transform-driven
   containing block and reach the viewport. .nav-panel-backdrop itself has
   no mobile z-index — only its descendant .nav-panel does.

   ── Desktop (@media width >= 900px) ───────────────────────────────────
     10000  .nav-panel-backdrop  flyout shell (overrides mobile non-styling)
      1000  .minicart-drawer     cart panel (minicart.css)
       999  .minicart-overlay    cart click-capture (minicart.css)
       101  .search-drawer-panel search panel (search-drawer.css)
       —    .nav-panel           reset to in-flow content inside the backdrop
       —    .nav-sections        becomes position:static (no own z-index)

   The flyout backdrop sits above the cart drawer/overlay so an open flyout
   paints and receives pointer events over an open cart — matches the
   classic site and resolves PROTO-395 (the cart overlay was blocking the
   path to the open flyout). .nav-tools.minicart is unpositioned, so the
   minicart elements stack at the .header level alongside .nav-panel-backdrop
   rather than inside .nav-tools.

   Update this map any time a panel z-index in this file or in a sibling
   header-mounted block changes.
   ========================================================================== */

/* ==========================================================================
   Base Header Styles (Mobile)
   ========================================================================== */

.header {
  /* Comp rhythm (Figma Nav-Platform node 1400-18508), in rems: cards own a
     0.75rem field (the hover box) with a 0.75rem inter-card pitch; the icon
     gutter is 1.25rem. Title-to-desc gaps stay at space-xs — the comp's 12px
     sits between leading-trimmed text boxes, and CSS line-height already
     carries that difference. No 12px global spacing token exists, so the
     rhythm lives as block-local tokens. */
  --nav-card-rhythm: 0.75rem; /* comp: 12px */
  --nav-icon-gutter: 1.25rem; /* comp: 20px icon-to-text */

  /* Fluid tokens matching current header */
  --topbar-height: clamp(80px, 26px + 6vw, 110px);
  --nav-collapsed-height: clamp(60px, 24px + 4vw, 80px);
  --nav-logo-width: clamp(80px, 44px + 4vw, 100px);
  --nav-gap: clamp(1rem, -0.8rem + 3.2vw, 2rem);
  --nav-font-size: 1rem; /* Mobile: fixed 16px */
  --nav-item-padding-x: clamp(0.5rem, 0.25rem + 0.75vw, 1.25rem);
  --nav-item-padding-y: clamp(0.25rem, 0.125rem + 0.25vw, 0.375rem);
  --nav-tool-icon-size: clamp(36px, 28px + 0.6vw, 44px);
  --nav-tool-icon-img: clamp(24px, 18px + 0.5vw, 32px);

  /* Panel content sizes - use body tokens for mobile, fluid on desktop */
  --nav-panel-header-size: var(--body-font-size-m);
  --nav-panel-title-size: var(--body-font-size-m);
  --nav-panel-desc-size: 0.75rem; /* card fine print — 12px at all breakpoints per comps */

  /* Icon sizes */
  --nav-chevron-size: 1.25rem; /* 20px - between space-m and space-l */

  /* Color tokens */
  --header-text: var(--digicert-black, #222);
  --header-text-muted: var(--digicert-neutral-800, #48565e);
  --header-bg: var(--background-color, #fff);
  --header-border: var(--border-color, #d2dce3);
  --header-primary: var(--digicert-blue, #0174c3);
  --header-height: var(--topbar-height);
  --header-transition: var(--duration-fast) var(--ease-out);

  /* Panel styling */
  --header-panel-bg: var(--surface-color);
  --header-shadow: 0 10px 15px 5px rgb(160 171 179 / 15%);
  --header-divider: var(--digicert-neutral-100, #e9eef1);

  /* Layout constraints - inherits --header-max-width from tokens.css */
  --header-panel-inset: var(--space-4xl); /* Inset from header max-width */
  --header-panel-max-width: calc(var(--header-max-width) - var(--header-panel-inset) * 2);

  /* Base styles */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: var(--background-color, #fff);
  border-bottom: 1px solid var(--border-color, #d2dce3);
  transition: height var(--duration-normal, 300ms) var(--ease-out);
}

/* Collapsed header on scroll - desktop only, see @media (width >= 900px) */

/* Mobile: hamburger left, brand right, tools hidden until menu open */
.header nav {
  display: grid;
  grid-template:
    'hamburger brand tools' var(--header-height)
    'sections sections sections' 1fr / auto 1fr auto;
  align-items: center;
  gap: 0 var(--space-s, 8px);
  box-sizing: border-box;
  max-width: var(--header-max-width);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  font-family: var(--body-font-family, 'Roboto', sans-serif);
}

/* Mobile menu open - full height, tools stay in header bar */
.header nav[aria-expanded='true'] {
  grid-template:
    'hamburger brand tools' var(--header-height)
    'sections sections sections' 1fr / auto 1fr auto;
  overflow-y: auto;
  min-height: 100dvh;
}

/* Sentinel for scroll detection */
.header-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* ==========================================================================
   Brand Section
   ========================================================================== */

.header .nav-brand {
  grid-area: brand;
  justify-self: start; /* Logo left-locked next to hamburger per Figma */
}

.header .nav-brand a {
  display: block;
  line-height: 0;
}

.header .nav-brand picture {
  display: block; /* Remove inline baseline gap between picture and img */
}

.header .nav-brand img {
  display: block;
  width: var(--nav-logo-width);
  height: auto;
  transition: width var(--duration-normal, 300ms) var(--ease-out);
}

/* ==========================================================================
   Hamburger (Mobile)
   ========================================================================== */

.header .nav-hamburger {
  --hamburger-size: var(--space-2xl);
  --hamburger-icon-size: var(--space-l);

  grid-area: hamburger;
  display: flex;
  align-items: center;
  margin-left: calc((var(--hamburger-icon-size) - var(--hamburger-size)) / 2);
}

.header .nav-hamburger button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--hamburger-size);
  height: var(--hamburger-size);
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.header .nav-hamburger-icon {
  position: relative;
  width: var(--hamburger-icon-size);
  height: 2px;
  background: var(--header-text);
  transition: background var(--header-transition);
}

.header .nav-hamburger-icon::before,
.header .nav-hamburger-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--header-text);
  transition: transform var(--header-transition);
}

.header .nav-hamburger-icon::before {
  top: calc(-1 * var(--space-s));
}

.header .nav-hamburger-icon::after {
  top: var(--space-s);
}

/* Hamburger open state */
.header nav[aria-expanded='true'] .nav-hamburger-icon {
  background: transparent;
}

.header nav[aria-expanded='true'] .nav-hamburger-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.header nav[aria-expanded='true'] .nav-hamburger-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ==========================================================================
   Nav Sections (Mobile)
   ========================================================================== */

.header .nav-sections {
  grid-area: sections;
  position: fixed;
  inset: var(--header-height) 0 0 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  background: var(--header-bg);
  border-top: 1px solid var(--header-border);
  overflow: hidden auto;

  /* Hidden state */
  transform: scaleY(0);
  transform-origin: top;
  opacity: 0;
  visibility: hidden;

  /* Closing transition */
  transition:
    transform var(--duration-normal) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out),
    visibility 0ms var(--duration-normal);
}

/* Mobile menu open - reveal from top */
.header nav[aria-expanded='true'] .nav-sections {
  transform: scaleY(1);
  opacity: 1;
  visibility: visible;
  transition:
    transform var(--duration-slow) var(--ease-spring),
    opacity var(--duration-normal) var(--ease-out),
    visibility 0ms 0ms;
}


.header .nav-sections .default-content-wrapper {
  flex: 1;
  padding: var(--space-m, 16px) var(--container-padding, 20px);
}

.header .nav-sections ul,
.header .nav-panel-backdrop ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.header .nav-sections > .default-content-wrapper > ul {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.header .nav-sections > .default-content-wrapper > ul > li {
  border-bottom: 1px solid var(--header-border);
}

/* ==========================================================================
   Nav Items (Mobile Base)
   ========================================================================== */

.header .nav-item-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-m) 0;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: var(--body-font-size-m);
  font-weight: 600;
  line-height: var(--line-height-normal);
  color: var(--header-text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.header .nav-item-toggle:active {
  color: var(--header-primary);
}

.header .nav-item-toggle::after {
  content: '';
  width: var(--space-l);
  height: var(--space-l);
  background: url('/icons/arrow-right.svg') center/contain no-repeat;
  flex-shrink: 0;
}

.header .nav-link {
  display: block;
  padding: var(--space-m) 0;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: var(--body-font-size-m);
  font-weight: 600;
  line-height: var(--line-height-normal);
}

.header .nav-link p {
  margin: 0;
}

.header .nav-link a {
  display: block;
  color: var(--header-text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   Nav Panel (Mobile Submenu - Stage 2)
   Slides in below the header bar so the X (hamburger close), brand, search,
   and cart icons stay visible at the top — same shape for the language panel.
   ========================================================================== */

/* Backdrop: no visual on mobile — panels inside escape via position:fixed */

.header .nav-panel {
  position: fixed;
  inset: var(--header-height) 0 0 0;
  background: var(--background-color);
  border-top: 1px solid var(--header-border);
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  overflow: hidden auto;
  z-index: 200;
  padding: 0 var(--container-padding) var(--space-3xl);

  /* Closing animation - slide out with fade */
  transition:
    transform var(--duration-slow) var(--ease-in),
    opacity var(--duration-normal) var(--ease-out),
    visibility 0ms var(--duration-slow);

  /* Hide scrollbar while keeping scroll functional */
  scrollbar-width: none; /* Firefox */
}

.header .nav-panel::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

/* Panel open state - slide in from right */
.header .nav-panel.active {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;

  /* Opening animation - snappy entrance */
  transition:
    transform var(--duration-normal) var(--ease-spring),
    opacity var(--duration-fast) var(--ease-out),
    visibility 0ms 0ms;
}

/* Back button - reset global button styles, clean styling per Figma */
.header .nav-back {
  /* Reset global button styles from buttons.css */
  all: unset;
  box-sizing: border-box;

  /* Layout */
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;

  /* Padding - vertical only, horizontal from parent panel */
  padding: var(--space-l) 0;

  /* Typography */
  font-family: var(--body-font-family);
  font-size: var(--body-font-size-m);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  text-align: left;

  /* Appearance - no border per Figma */
  color: var(--header-primary);
  background: var(--background-color);
  border: none;
  border-radius: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.header .nav-back:active {
  opacity: 0.7;
}

.header .nav-back .icon-chevron-left {
  width: var(--nav-chevron-size);
  height: var(--nav-chevron-size);
}

.header .nav-back .icon-chevron-left::before {
  content: '';
  display: block;
  width: var(--nav-chevron-size);
  height: var(--nav-chevron-size);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230174c3' stroke-width='2'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ==========================================================================
   Nav Panel Content (Mobile Submenu)
   ========================================================================== */

.header .nav-panel-content {
  padding: var(--space-m) 0 var(--space-3xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.header .nav-column,
.header .nav-umbrella,
.header .nav-promo {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

/* Umbrella band — divider beneath at all breakpoints; on mobile it bleeds
   over the panel's content inset so the rule runs edge to edge, same
   mechanism as the promo/gray-band bleeds (desktop re-bleeds against the
   backdrop inset instead) */
.header .nav-umbrella {
  border-bottom: 1px solid var(--border-color);
  margin-inline: calc(-1 * var(--container-padding));
  padding-inline: var(--container-padding);
  padding-bottom: var(--space-l);
}

/* Horizontal divider between stacked sections on mobile — only where the
   author drew a `line`; plain column breaks flow with the stack gap alone
   (mobile comp: cards run continuously across the column boundary) */
.header .nav-column.nav-column-divided {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-xl);
}

/* Promo band — light gray strip bleeding over the .nav-panel padding
   (--container-padding sides, --space-3xl bottom) so it reaches the panel
   edges and the end of the mobile scroll. The .nav-panel-content padding is
   zeroed by the backdrop ul reset, so only the panel's own padding is offset. */
.header .nav-promo {
  background: var(--digicert-neutral-50);
  margin: 0 calc(-1 * var(--container-padding)) calc(-1 * var(--space-3xl));
  padding: var(--space-xl) var(--container-padding) var(--space-3xl);
}

/* Narrow / bg-neutral columns — read as a gray band on mobile,
   mirroring the promo bleed (narrow has no width meaning in the stacked
   layout, so it takes the band treatment per the comps); desktop restyles
   them (narrow = narrow column, bg-neutral keeps its fill). The gray edge
   itself separates on mobile, so border-top: 0 deliberately absorbs an
   authored `line` divider. */
.header .nav-column.nav-column-narrow,
.header .nav-column.nav-column-bg-neutral {
  background: var(--digicert-neutral-50);
  border-top: 0;
  margin: 0 calc(-1 * var(--container-padding));
  padding: var(--space-xl) var(--container-padding);
}

/* Promo banner variant — authored via the `<!-- promo (banner) -->` marker,
   the promo renders as a filled banner. Mirrors .theme-primary: button tokens
   flip to the light variant so a bold CTA renders as a white pill on the
   blue field, and the text/link/hover tokens flip to white so any authored
   shape (cards, headings, standalone links) reads white on the field. */
.header .nav-promo.nav-promo-banner {
  --btn-primary-bg: var(--btn-primary-bg-light);
  --btn-primary-fg: var(--btn-primary-fg-light);
  --btn-primary-bg-hover: var(--btn-primary-bg-hover-light);
  --text-color: var(--digicert-white);
  --text-muted: var(--digicert-white);
  --header-text-muted: var(--digicert-white);
  --link-color: var(--digicert-white);
  --header-primary: var(--digicert-white);

  background: var(--digicert-blue);
}

/* Section headers - Figma: 18px SemiBold, 24px line-height */
.header .nav-section-header {
  font-family: var(--heading-font-family);
  font-size: var(--nav-panel-header-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight); /* comps: 24/20 ≈ tight */
  color: var(--text-color);
  margin: 0;
  padding-bottom: var(--space-s);
}

/* Vertical rhythm: subsequent headers get top margin for section breaks */
.header .nav-section-header:not(:first-child) {
  margin-top: var(--space-2xl);
}

/* Linked headers - same as plain text, but hover blue */
.header .nav-section-header a {
  color: inherit;
  font: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

/* Linked headers carry a top-right arrow (Figma column-header). The glyph is
   masked, so color is pure CSS: muted at rest, link blue together with the
   text on hover — no per-color SVG variants, no filter colorization. */
.header .nav-section-header a::after {
  content: '';
  display: inline-block;

  /* Figma column-header: 20px icon box beside 20px type = 1em, 8px gap;
     the glyph is inset in the box per the exported asset */
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  margin-left: var(--space-s);
  background-color: var(--digicert-neutral-600); /* ≥3:1 on white (WCAG 1.4.11) */
  mask: url('/icons/arrow-top-right.svg') center / contain no-repeat;
  transition: background-color var(--duration-fast) var(--ease-out);
}

/* ==========================================================================
   Nav Cards (title + description pairs, grouped by JS)
   ========================================================================== */

/* Cards container */
.header .nav-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  -webkit-tap-highlight-color: transparent;
}

/* Card title - Figma: 16px medium */
.header .nav-card-title {
  display: block;
  font-family: var(--heading-font-family);
  font-size: var(--nav-panel-title-size);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  color: var(--text-color);
  text-decoration: none;
}

/* Stretched link - makes entire card clickable */
.header .nav-card-title::after {
  content: '';
  position: absolute;
  inset: 0;
}

/* Card description - fluid sizing */
.header .nav-card-description {
  font-family: var(--body-font-family);
  font-size: var(--nav-panel-desc-size);
  font-weight: var(--font-weight-regular);
  line-height: 1.3;
  color: var(--text-muted);
  white-space: normal;
  overflow-wrap: break-word;
}

/* Standalone nav links (no description) — condensed regular at all
   breakpoints, a step below the section headers; desktop bumps only the
   font-size back to title size. Real buttons (banner CTA) are exempt —
   they keep the global button typography. */
.header .nav-item-link a:where(:not(.button)) {
  display: block;
  font-family: var(--heading-font-family);
  font-size: var(--body-font-size-s); /* 16px — not the 12px fine-print token: links stay tappable */
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--text-color);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   Nav Item Icons (loaded from DAM)
   ========================================================================== */

.header .nav-item-icon {
  --nav-icon-size: var(--space-xl);

  width: var(--nav-icon-size);
  height: var(--nav-icon-size);
  flex-shrink: 0;
}

/* Cards with icons - horizontal layout, padding for hover stability.
   The comp's 0.75rem field is desktop-only — mobile has no hover field,
   so stacked cards keep the compact inset. */
.header .nav-card.has-icon {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-m);
  padding: var(--space-xs) var(--space-m);
  border-radius: var(--border-radius-m, 8px);
}

/* Content wrapper for icon cards - title + description stack vertically */
.header .nav-card-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
}

/* Icon + link (no description) - inline row layout */
.header .nav-icon-link {
  --nav-icon-link-size: var(--space-xl);

  display: flex;
  align-items: center;
  gap: var(--space-s);
  -webkit-tap-highlight-color: transparent;
}

.header .nav-icon-link .nav-item-icon {
  width: var(--nav-icon-link-size);
  height: var(--nav-icon-link-size);
  border: 1px solid var(--header-divider);
  border-radius: var(--border-radius-m);
  padding: var(--space-xs);
  box-sizing: border-box;
  object-fit: contain;
}

.header .nav-icon-link a {
  font-family: var(--heading-font-family);
  font-size: var(--nav-panel-title-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  color: var(--text-color);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.header .nav-icon-link:hover a {
  color: var(--header-primary);
}

/* ==========================================================================
   Band Content Overrides (umbrella / promo)
   After the generic card/link rules they specialise.
   ========================================================================== */

/* Umbrella title reads as the panel's heading, above card-title size;
   promo card titles keep the standard card-title scale */
.header .nav-umbrella .nav-card-title {
  font-size: var(--heading-font-size-s);
  font-weight: var(--font-weight-semibold);
}

/* Band/narrow-column CTA — a standalone text link in the band is its call
   to action: link-colored; any trailing arrow comes from the authored text */
.header .nav-promo .nav-item-link a:where(:not(.button)),
.header .nav-umbrella .nav-item-link a:where(:not(.button)),
.header .nav-column-narrow .nav-item-link a,
.header .nav-column-bg-neutral .nav-item-link a {
  color: var(--link-color);
}

/* Freestanding text — loose lis in bands and columns alike read as muted
   body copy (Figma: Roboto 16px; the 12px desc token is column-card fine
   print, not intro-copy scale). One rule so the treatments can't drift. */
/* stylelint-disable no-descending-specificity -- loose lis share only the li element with .nav-sections/.nav-tools rules */
.header .nav-umbrella > li:not(.nav-section-header, .nav-item-link),
.header .nav-promo > li:not(.nav-section-header, .nav-item-link),
.header .nav-column > li:not(.nav-section-header, .nav-item-link, .nav-icon-link) {
  font-family: var(--body-font-family);
  font-size: var(--body-font-size-s);
  line-height: var(--line-height-normal);
  color: var(--header-text-muted);
}

/* Banner copy reads as a heading on the blue field, not muted description */
.header .nav-promo-banner > li:not(.nav-section-header, .nav-item-link) {
  font-family: var(--heading-font-family);
  font-size: var(--heading-font-size-s);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  color: var(--digicert-white);
}

/* stylelint-enable no-descending-specificity */

/* ==========================================================================
   Interactive States (hover, active, tap)
   Grouped after ALL base declarations to satisfy CSS specificity ordering.
   ========================================================================== */

.header .nav-section-header a:hover {
  color: var(--header-primary);
}

.header .nav-section-header a:hover::after {
  background-color: var(--header-primary);
}

.header .nav-link a:active,
.header .nav-item-link a:where(:not(.button)):active,
.header .nav-icon-link:active a {
  color: var(--header-primary);
}

.header .nav-card:active .nav-card-title,
.header .nav-card:active .nav-card-description {
  color: var(--header-primary);
}

.header .nav-card.nav-hover-active .nav-card-title,
.header .nav-card.nav-hover-active .nav-card-description {
  color: var(--header-primary);
}

.header .nav-item-link.nav-hover-active a:where(:not(.button)) {
  color: var(--header-primary);
}

/* ==========================================================================
   Tools Section (Mobile)
   ========================================================================== */

.header .nav-tools {
  --nav-tool-gap: 10px; /* Figma: 10px gap between mobile tool icons */

  grid-area: tools;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
}

/* Tools inner wrapper - flex row on mobile to align icons horizontally */
.header .nav-tools .default-content-wrapper {
  display: flex;
  align-items: center;
  gap: var(--nav-tool-gap);
}

/* Tools list reset — flex row to align icons horizontally */
.header .nav-tools > .default-content-wrapper > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--nav-tool-gap);
}

.header .nav-tools > .default-content-wrapper > ul > li,
.header .nav-tools p {
  display: none;
}

/* Show search and cart icons on mobile — specificity must beat the li hide rule */
.header .nav-tools > .default-content-wrapper .nav-tool-search-wrapper,
.header .nav-tools > .default-content-wrapper .nav-tool-cart-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
}

/* Reset button styling for icon-only links on mobile, hide authored text */
.header .nav-tool-icon {
  background: transparent;
  padding: 0;
  min-height: auto;
  border-radius: 0;
  font-size: 0;
}

/* Normalize minicart trigger to match nav-tool-icon on mobile */
.header .nav-tools .minicart-trigger {
  width: var(--space-xl);
  height: var(--space-xl);
  border-radius: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header .nav-tools .minicart-trigger,
.header .nav-tools .minicart-trigger:hover,
.header .nav-tools .minicart-trigger:focus-visible {
  background: transparent;
}

.header .nav-tools .minicart-trigger img {
  width: var(--space-xl);
  height: var(--space-xl);
}

.header .nav-tools .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--space-xl);
  height: var(--space-xl);
}

.header .nav-tools .icon img {
  width: var(--space-xl);
  height: var(--space-xl);
}

.header .nav-tools .minicart-trigger:hover img {
  filter: none;
}

/* ==========================================================================
   Mobile Nav Footer (Language + Account)
   Pinned to bottom of mobile dropdown via flex space-between
   ========================================================================== */

.header .nav-mobile-footer {
  --nav-footer-gap: 20px; /* Figma: 20px gap between footer items */

  display: flex;
  flex-direction: column;
  gap: var(--nav-footer-gap);
  padding: var(--space-xl) var(--container-padding) var(--space-l);
}

.header .nav-mobile-footer-item {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: var(--space-s);
  width: 100%;
  font-family: var(--heading-font-family);
  font-size: var(--body-font-size-m);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  color: var(--header-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.header .nav-mobile-footer-item:focus-visible {
  outline: var(--focus-outline-width) solid var(--focus-outline-color);
  outline-offset: var(--focus-outline-offset);
  border-radius: var(--border-radius-s);
}

.header .nav-mobile-footer-item:active {
  color: var(--header-primary);
}

.header .nav-mobile-footer-icon {
  width: var(--space-xl);
  height: var(--space-xl);
  flex-shrink: 0;
}

.header .nav-mobile-footer-label {
  flex: 1;
}

.header .nav-mobile-footer-chevron {
  width: var(--space-l);
  height: var(--space-l);
  flex-shrink: 0;
}

.header .nav-mobile-footer-chevron svg {
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   Language Menu — globe-triggered language/region selector.
   Reuses .nav-panel for mobile slide-in, back button, scroll behavior.
   Typography mirrors .nav-section-header / .nav-item-link so this panel
   aligns with the other nav sub-menus; desktop override below anchors it
   as a dropdown under the tools-cluster globe (overrides .nav-panel grid).
   ========================================================================== */

/* Authored title (heading or paragraph) — mirrors .nav-section-header */
.header .nav-language-panel-title {
  font-family: var(--heading-font-family);
  font-size: var(--nav-panel-header-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  color: var(--text-color);
  margin: 0 0 var(--space-s);
  padding: 0;
}

/* stylelint-disable-next-line no-descending-specificity */
.header .nav-language-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* stylelint-disable-next-line no-descending-specificity */
.header .nav-language-panel a {
  display: block;
  padding: var(--space-xs) 0;
  font-family: var(--heading-font-family);
  font-size: var(--nav-panel-title-size);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  color: var(--text-color);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.header .nav-language-panel a:hover {
  color: var(--header-primary);
}

.header .nav-language-panel a:focus-visible {
  outline: var(--focus-outline-width) solid var(--focus-outline-color);
  outline-offset: var(--focus-outline-offset);
  border-radius: var(--border-radius-s);
}

/* ==========================================================================
   Panel Open State (Mobile)
   Collapse header when submenu panel covers full screen
   ========================================================================== */

/* ==========================================================================
   Desktop Styles (>= 900px)
   ========================================================================== */

@media (width >= 900px) {
  /* Desktop: fluid sizes with clamp */
  .header {
    --nav-font-size: clamp(0.875rem, 0.6rem + 0.4vw, 1.125rem);
    --nav-panel-header-size: clamp(1rem, 0.35rem + 1vw, 1.25rem); /* 20px at 1440+ per Figma column-header */
    --nav-panel-title-size: clamp(0.8125rem, 0.225rem + 1vw, 1.125rem); /* 18px at 1440+ per comps */
  }

  /* Desktop: switch to flexbox layout */
  .header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0 var(--space-l, 24px); /* Restore horizontal gap for hover island */
    position: relative;
    max-width: var(--header-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    height: var(--header-height);
    transition: height var(--duration-normal, 300ms) var(--ease-out);
  }

  /* Collapsed header on scroll - desktop only */
  .header.scrolled {
    height: var(--nav-collapsed-height);
    box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
  }

  .header.scrolled nav {
    height: var(--nav-collapsed-height);
  }

  .header.scrolled .nav-brand img {
    width: calc(var(--nav-logo-width) * 0.85);
  }

  /* Brand goes back to normal (not end-aligned) */
  .header .nav-brand {
    justify-self: auto;
  }

  .header nav[aria-expanded='true'] {
    min-height: 0;
    overflow: visible;
  }

  /* Hide hamburger on desktop */
  .header .nav-hamburger {
    display: none;
  }

  /* Nav sections as horizontal bar */
  .header .nav-sections {
    position: static;
    inset: auto;
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-top: none;
    overflow: visible;
    white-space: nowrap;

    /* Reset mobile animation states */
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: none;
  }

  /* Hide mobile-only footer on desktop */
  .header .nav-mobile-footer {
    display: none;
  }

  /* Nav drop items need relative position so panel stays within their bounds */
  .header .nav-drop {
    position: relative;
  }

  /* Hover bridge - invisible element that prevents dropdown from closing
     when mouse moves through the gap between nav item and panel */
  .header .nav-drop[aria-expanded='true']::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -50%;
    width: 200%;
    height: calc(var(--header-height) - 100% + var(--space-xl));
    pointer-events: auto;
  }

  .header .nav-sections .default-content-wrapper {
    padding: 0;
    margin: 0 var(--space-l);
    display: flex;
    justify-content: center;
  }

  .header .nav-sections > .default-content-wrapper > ul {
    flex-direction: row;
    align-items: center;
    gap: 0;
    width: auto; /* Don't stretch - content width only */
  }

  .header .nav-sections > .default-content-wrapper > ul > li {
    border-bottom: none;
    padding: var(--nav-item-padding-y) var(--nav-item-padding-x);
    border-radius: var(--border-radius-pill);
    overflow: visible;
    transition: color 0.15s ease-out, background-color 0.15s ease-out;
  }

  .header .nav-sections > .default-content-wrapper > ul > li:hover {
    color: var(--digicert-blue, #0174c3);
    background-color: color-mix(in srgb, var(--digicert-blue, #0174c3) 12%, transparent);
  }

  /* Top nav items */
  .header .nav-item-toggle {
    padding: 0;
    font-family: var(--body-font-family);
    font-size: var(--nav-font-size);
    font-weight: var(--font-weight-regular, 400);
    line-height: var(--line-height-normal);
    color: inherit; /* Inherit from li so hover color works */
  }

  /* Hide chevron on desktop */
  .header .nav-item-toggle::after {
    display: none;
  }

  .header .nav-link {
    font-family: var(--body-font-family);
    font-size: var(--nav-font-size);
    font-weight: var(--font-weight-regular, 400);
    line-height: var(--line-height-normal);
    color: inherit; /* Inherit from li so hover color works */
  }

  .header .nav-link a {
    color: inherit;
    text-decoration: none;
  }

  /* ==========================================================================
     Desktop Dropdown Panel
     ========================================================================== */

  /* Shared panel backdrop — the shell (bg, border, shadow) with its own lifecycle.
     Panels live inside via grid stacking; inactive panels are absolute, so the
     backdrop sizes to the active panel and resizes as the pointer moves between
     nav items. Stays open while browsing; only closes when mouse leaves the nav
     zone. */
  .header .nav-panel-backdrop {
    /* Single owner of the panel inset. Bands that bleed to the panel edges
       (promo, bg-neutral columns) offset exactly these tokens — nothing else
       adds padding between the backdrop and the content. --nav-row-gap shares
       the pad-y value so a row-gap bleed also reaches the panel edge when the
       adjacent band is absent. */
    --nav-panel-pad-x: var(--container-padding);
    --nav-panel-pad-y: var(--space-xl);
    --nav-row-gap: var(--space-xl);

    display: grid;
    position: fixed;
    top: calc(var(--header-height) + 1px);
    left: 0;
    right: 0;
    max-width: var(--header-panel-max-width);
    padding: var(--nav-panel-pad-y) var(--nav-panel-pad-x);
    margin: 0 auto;

    /* No border and no hairline ring — a filled band (e.g. blue banner) must
       meet the page dead flush. Separation comes from shadow alone: a tight
       contact shadow defines the edge on white pages, the ambient
       --header-shadow carries the depth; both vanish against dark pages. */
    background: var(--header-panel-bg);
    border-radius: 0 0 var(--border-radius-xl, 24px) var(--border-radius-xl, 24px);
    box-shadow:
      0 2px 6px rgb(160 171 179 / 30%),
      var(--header-shadow);

    /* Short viewports: cap to the space below the header and scroll inside.
       On viewports where the panel fits, no scrollbar renders. */
    max-height: calc(100dvh - var(--header-height) - var(--space-m));
    overflow: hidden auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity var(--duration-normal) var(--ease-out),
      visibility 0ms var(--duration-normal);
    z-index: 10000; /* see z-index map at top — above .minicart-drawer (1000) */
  }

  .header.scrolled .nav-panel-backdrop {
    top: calc(var(--nav-collapsed-height) + 1px);
    max-height: calc(100dvh - var(--nav-collapsed-height) - var(--space-m));
  }

  /* Backdrop visible when any dropdown is open */
  .header nav.nav-dropdown-open .nav-panel-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      opacity var(--duration-normal) var(--ease-out),
      visibility 0ms 0ms;
  }

  /* Individual panels — grid-stacked inside backdrop, content only.
     Inactive panels are absolute (don't affect height).
     Active panel is relative (drives backdrop height naturally). */
  .header .nav-panel {
    grid-area: 1 / 1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: none;
    max-width: none;
    margin: 0;
    padding: 0; /* backdrop provides padding */
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity var(--duration-fast) var(--ease-out),
      visibility 0ms var(--duration-fast);

    /* Clip inactive panels to the backdrop — absolute children still create
       scroll overflow, so a taller inactive panel would otherwise add a
       phantom scrollbar and dead space below the active panel's promo */
    max-height: 100%;
    overflow: hidden;
  }

  /* Active panel — relative position drives backdrop height; natural height
     and visible overflow restored (the promo bleed extends past the panel
     box into the backdrop padding) */
  .header .nav-panel.active {
    position: relative;
    max-height: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      opacity var(--duration-fast) var(--ease-out),
      visibility 0ms 0ms;
  }

  /* Hide back button on desktop */
  .header .nav-back {
    display: none;
  }

  /* Language menu: override .nav-panel grid-stacking to anchor as a dropdown
     flush under the tools-cluster globe. Visual/entrance mirror the
     search drawer — no offset, --panel-shadow, border-top divider, and
     the same translateY slide-down. */
  .header .nav-panel.nav-language-panel {
    grid-area: auto;
    position: absolute;
    inset: auto;
    top: 100%;
    right: var(--container-padding, 32px);
    width: 280px;
    padding: var(--space-m) var(--space-l);
    background: var(--background-color, #fff);
    border-top: 1px solid var(--border-color, #d2dce3);
    box-shadow: var(--panel-shadow);
    clip-path: var(--panel-clip-below);
    transform: translateY(calc(-1 * var(--translate-sm)));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity var(--duration-normal) var(--ease-out),
      transform var(--duration-normal) var(--ease-out),
      visibility 0ms var(--duration-normal);
  }

  .header .nav-panel.nav-language-panel.active {
    position: absolute;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition:
      opacity var(--duration-normal) var(--ease-out),
      transform var(--duration-normal) var(--ease-out),
      visibility 0ms 0ms;
  }

  /* ==========================================================================
     Desktop Panel Content Grid
     ========================================================================== */

  /* Grid: one track per column (count set by JS); umbrella/promo bands span
     all tracks above/below the columns. No padding of its own — the backdrop
     is the single owner of the panel inset. */
  .header .nav-panel-content {
    --nav-column-max-width: 22rem;

    display: grid;
    grid-template-columns: repeat(var(--nav-column-count, 1), minmax(0, var(--nav-column-max-width)));
    padding: 0;
    gap: var(--nav-row-gap) var(--space-l);
  }

  /* Banded panels fill the panel width so the bands truly run edge to edge;
     bandless panels keep the capped column width */
  .header .nav-panel-content.has-bands {
    --nav-column-max-width: 1fr;
  }

  /* A narrow column appends a trailing narrow track after the main columns */
  .header .nav-panel-content.has-narrow {
    grid-template-columns:
      repeat(var(--nav-column-count, 1), minmax(0, var(--nav-column-max-width)))
      minmax(0, 15rem);
  }

  /* Comp rhythm: inter-card gaps tighten to 0.75rem as the card fields
     grow — the 12px pitch from the Figma Nav-Platform comp */
  .header .nav-column {
    gap: var(--nav-card-rhythm);
  }

  /* If any column leads with a section header, headerless columns reserve the
     header's space so card rows align across the panel. The spacer mirrors the
     header's type metrics, so it tracks the fluid tokens. Desktop only —
     mobile columns stack, so there is nothing to align. Narrow/bg-neutral
     columns sit in their own padded gray geometry, decoupled from the main
     rows — they neither trigger the reservation nor receive it. */
  .header .nav-panel-content:has(
      .nav-column:not(.nav-column-narrow, .nav-column-bg-neutral) > .nav-section-header:first-child
    )
  .nav-column:not(.nav-column-narrow, .nav-column-bg-neutral, :has(> .nav-section-header:first-child))::before {
    content: '\00a0';
    font-family: var(--heading-font-family);
    font-size: var(--nav-panel-header-size);
    line-height: var(--line-height-tight); /* mirrors .nav-section-header */
    padding-bottom: var(--space-s);
  }

  /* Narrow column — mobile gray band styling off */
  .header .nav-column.nav-column-narrow {
    background: none;
    margin: 0;
    padding: 0;
  }

  /* `line` marker — the mobile top divider becomes a left divider between
     side-by-side columns */
  .header .nav-column.nav-column-divided {
    border-top: 0;
    padding-top: 0;
    border-left: 1px solid var(--border-color);
    padding-left: var(--space-l);
  }

  /* bg-neutral column — the gray fill bleeds over the panel inset to the
     panel's right edge, and across the row gaps to the umbrella divider
     above and the promo edge below (same mechanism as the promo bleed).
     The left column gutter stays. Interior padding wins over the divided
     padding-left; a leading divider then hugs the gray edge. */
  .header .nav-column.nav-column-bg-neutral {
    background: var(--digicert-neutral-50);
    margin: calc(-1 * var(--nav-row-gap)) calc(-1 * var(--nav-panel-pad-x)) calc(-1 * var(--nav-row-gap)) 0;
    padding: var(--space-l);
  }

  /* Umbrella band — full width above the columns; bleeds over the panel
     inset so its divider runs edge to edge (same mechanism as the promo) */
  .header .nav-umbrella {
    grid-column: 1 / -1;
    flex-flow: row wrap;
    align-items: center;
    column-gap: var(--space-xl);
    margin: calc(-1 * var(--nav-panel-pad-y)) calc(-1 * var(--nav-panel-pad-x)) 0;
    padding-inline: var(--nav-panel-pad-x);

    /* The band owns the panel's top inset (bleeding over pad-y, same
       mechanism as the promo's bottom bleed) and frames the card's
       uniform space-m hover field with equal space-m air above and
       below-to-divider */
    padding-top: var(--space-m);
    padding-bottom: var(--space-m);
  }

  /* Section headers flow inline within a band row — no stacked-section rhythm */
  .header .nav-umbrella .nav-section-header,
  .header .nav-promo .nav-section-header {
    margin-top: 0;
    padding-bottom: 0;
  }

  /* Umbrella quick links — standalone links cluster at the far right of the
     band and read as actions, mirroring the promo CTA treatment */
  .header .nav-umbrella :not(.nav-item-link) + .nav-item-link {
    margin-inline-start: auto;
  }

  /* Promo band — full width below the columns, bleeding over the panel inset
     so the strip reaches the panel edges and the rounded bottom (backdrop
     overflow: hidden clips it to the radius) */
  .header .nav-promo {
    grid-column: 1 / -1;
    flex-flow: row wrap;
    align-items: center;
    gap: var(--space-s) var(--space-2xl);
    margin: 0 calc(-1 * var(--nav-panel-pad-x)) calc(-1 * var(--nav-panel-pad-y));
    padding: var(--space-xl) var(--nav-panel-pad-x) var(--nav-panel-pad-y);
    border-top: 1px solid var(--border-color);
  }

  /* One promo layout, strip and banner alike: the heading takes its own row;
     the description fills the next row with the trailing link pulled to the
     far right, vertically centered. The banner is skin only (fill, colors,
     no divider) — no per-variant layout fork. */
  .header .nav-promo .nav-section-header {
    flex-basis: 100%;
  }

  /* Band content — loose text or a title+description card, umbrella and
     promo alike — flexes beside the trailing links: long copy wraps within
     its share of the row instead of pushing the links down */
  .header .nav-umbrella .nav-card,
  .header .nav-promo .nav-card,
  /* stylelint-disable-next-line no-descending-specificity -- band lis share only the li element with .nav-sections rules */
  .header .nav-umbrella > li:not(.nav-section-header, .nav-item-link),
  /* stylelint-disable-next-line no-descending-specificity -- band lis share only the li element with .nav-sections rules */
  .header .nav-promo > li:not(.nav-section-header, .nav-item-link) {
    flex: 1 1 0;
    min-width: 24ch; /* readable floor; links wrap below when space runs out */
  }

  /* Band links hold their line — the flexing content wraps first
     (:where keeps specificity level with the plain link rules) */
  .header :where(.nav-umbrella, .nav-promo) .nav-item-link a {
    white-space: nowrap;
  }

  /* Trailing CTA (plain or icon link) sits at the far right of its row */
  .header .nav-promo :is(.nav-item-link, .nav-icon-link):last-child {
    margin-inline-start: auto;
  }

  /* Banner promo — filled field provides the separation */
  .header .nav-promo.nav-promo-banner {
    border-top: 0;
  }

  /* Standalone links: same condensed regular as mobile, desktop title size */
  .header .nav-item-link a:where(:not(.button)) {
    font-size: var(--nav-panel-title-size);
  }

  /* Desktop icon size */
  .header .nav-item-icon {
    --nav-icon-size: var(--space-2xl);
  }

  /* Umbrella card icon runs a step larger per the comps */
  .header .nav-umbrella .nav-item-icon {
    --nav-icon-size: var(--space-3xl);
  }

  /* Card field — comp rhythm on desktop: 0.75rem field, 1.25rem gutter */
  .header .nav-card.has-icon {
    gap: var(--nav-icon-gutter);
    padding: var(--nav-card-rhythm);
  }


  /* ==========================================================================
     Desktop Hover States
     ========================================================================== */

  /* Card hover highlighting - background on entire card */
  .header .nav-card.nav-hover-active {
    background: rgb(1 116 195 / 5%);
    border-radius: var(--border-radius-m); /* one 8px radius for every hover field */
    margin-left: calc(-1 * var(--space-s));
    margin-right: calc(-1 * var(--space-s));
    padding-left: var(--space-s);
    padding-right: var(--space-s);
  }

  /* Icon cards already have padding - just add bg on hover, no reflow */
  .header .nav-card.has-icon.nav-hover-active {
    background: rgb(1 116 195 / 8%);
    margin: 0;
    padding: var(--nav-card-rhythm);
  }

  /* Band cards (umbrella and promo alike) — uniform space-m field per the
     comp's umbrella card. Placed after the hover rule (equal specificity)
     so it holds in both states: no reflow on hover. */
  .header :is(.nav-umbrella, .nav-promo) .nav-card.has-icon {
    padding: var(--space-m);
  }

  /* Band card descriptions run a step above the 12px fine print — desktop
     only (comp: 14px under the umbrella's large title; the promo mirrors
     the umbrella pending its own comp). Mobile bands keep the common size. */
  .header :is(.nav-umbrella, .nav-promo) .nav-card-description {
    font-size: var(--body-font-size-xs);
  }

  /* Iconless band cards get the same field depth; the inline bleed makes
     the generic hover inset static (same values), so the text stays
     aligned with the column content and hover only paints the background */
  .header :is(.nav-umbrella, .nav-promo) .nav-card:not(.has-icon) {
    margin-inline: calc(-1 * var(--space-s));
    padding: var(--space-m) var(--space-s);
    border-radius: var(--border-radius-m);
  }

  /* Promo cards keep a slim vertical field */
  .header .nav-promo .nav-card:not(.has-icon) {
    padding-block: var(--space-s);
  }

  .header .nav-card.nav-hover-active .nav-card-title {
    color: var(--header-primary);
  }

  /* Standalone link hover */
  .header .nav-item-link.nav-hover-active {
    background: rgb(1 116 195 / 5%);
    border-radius: var(--border-radius-m);
    margin-left: calc(-1 * var(--space-s));
    margin-right: calc(-1 * var(--space-s));
    padding-left: var(--space-s);
    padding-right: var(--space-s);
  }

  .header .nav-item-link.nav-hover-active a:where(:not(.button)) {
    color: var(--header-primary);
  }

  /* ==========================================================================
     Desktop Tools Section
     ========================================================================== */

  .header .nav-tools {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0; /* Icon containers provide spacing via 44px size */
  }

  /* Make the wrapper inside tools also flex row */
  .header .nav-tools .default-content-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0; /* Icon containers provide spacing via 44px size */
  }

  /* Reset mobile gap on tools list for desktop */
  .header .nav-tools > .default-content-wrapper > ul {
    gap: 0;
  }

  /* Show all tools on desktop (different container than nav-sections li) */
  /* stylelint-disable-next-line no-descending-specificity */
  .header .nav-tools > .default-content-wrapper > ul > li,
  .header .nav-tools p {
    display: flex;
    align-items: center;
    margin: 0;
  }

  /* Reset button-container spacing in nav tools */
  .header .nav-tools .button-container {
    margin: 0;
    padding: 0;
  }

  /* Icon links - fluid circular container */
  .header .nav-tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--nav-tool-icon-size);
    height: var(--nav-tool-icon-size);
    border-radius: 50%;
    overflow: hidden; /* Clip authored text — icons use <img> */
    transition: background-color var(--duration-fast) var(--ease-out);
  }

  .header .nav-tool-icon .icon img {
    width: var(--nav-tool-icon-img);
    height: var(--nav-tool-icon-img);
  }

  .header .nav-tool-icon:hover {
    background-color: color-mix(in srgb, var(--digicert-blue, #0174c3) 12%, transparent);
  }

  /* Cart wrapper — collapse so button handles all sizing/shape.
     Authoring may produce <p> or <li>, so target by class. */
  .header .nav-tools .nav-tool-cart-wrapper {
    display: contents;
  }

  /* Restore minicart trigger to circular container on desktop */
  .header .nav-tools .minicart-trigger {
    width: var(--nav-tool-icon-size);
    height: var(--nav-tool-icon-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
  }

  .header .nav-tools .minicart-trigger img {
    width: var(--nav-tool-icon-img);
    height: var(--nav-tool-icon-img);
  }

  /* Colorize icon to blue on hover (filter converts gray SVG to DigiCert blue) */
  .header .nav-tool-icon:hover .icon img {
    filter: brightness(0) saturate(100%) invert(30%) sepia(98%) saturate(1500%) hue-rotate(190deg) brightness(95%) contrast(101%);
  }

  .header .nav-tools .minicart-trigger:hover,
  .header .nav-tools .minicart-trigger:focus-visible {
    background-color: color-mix(in srgb, var(--digicert-blue, #0174c3) 12%, transparent);
  }

  .header .nav-tools .minicart-trigger:hover img {
    filter: brightness(0) saturate(100%) invert(30%) sepia(98%) saturate(1500%) hue-rotate(190deg) brightness(95%) contrast(101%);
  }

  /* Style Contact Us button - clamps with nav items */
  .header .nav-tool-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto;
    padding: var(--nav-item-padding-y) var(--nav-item-padding-x);
    margin-right: var(--space-xs);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-fg);
    font-family: var(--body-font-family);
    font-size: var(--nav-font-size);
    font-weight: var(--font-weight-regular);
    line-height: 1.25;
    text-align: center;
    border-radius: var(--border-radius-pill);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--duration-fast) var(--ease-out);
  }

  .header .nav-tool-button:hover {
    background: var(--btn-primary-bg-hover);
  }
}
