/*
 * COMMAND 069_HEADER_REFINEMENT
 * Header / brand / nav / CTA only. Load LAST after theme-068.
 * Does not restyle hero, cards, footer theme, or pricing.
 */

/* --- Header height lock: 96 / 84 / 72 --- */
body.cw-r2 #main-header {
  min-height: 96px;
  height: auto;
  box-sizing: border-box;
}
body.cw-r2 #main-header .header-row,
body.cw-r2 #main-header .header-row-utility {
  margin: 0;
  padding: 0;
  border: 0;
  min-height: 0;
}

body.cw-r2 .cw-g-header-inner,
body.cw-r2 .cw-header-inner {
  display: grid;
  grid-template-columns: minmax(12rem, 1.15fr) minmax(0, 1.7fr) minmax(10rem, 0.95fr);
  align-items: center;
  column-gap: clamp(1rem, 2vw, 2.25rem);
  row-gap: 0;
  min-height: 96px !important;
  height: auto !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-sizing: border-box;
}

body.cw-r2 .cw-069-brand,
body.cw-r2 .logo.cw-g-brand,
body.cw-r2 .logo.cw-mi-brand {
  justify-self: start;
  align-self: center;
  gap: 0.85rem;
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
}

body.cw-r2 .header-row-nav.cw-im-nav-inline {
  justify-self: center;
  align-self: center;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

body.cw-r2 .cw-header-actions {
  justify-self: end;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

/* Soften boxed chrome from 064 without changing page theme */
body.cw-r2 .cw-g-header .cw-064-bolt {
  display: none;
}

body.cw-r2 .cw-im-header .primary-nav.desktop-nav,
body.cw-r2 .primary-nav.desktop-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.35rem, 0.9vw, 1.1rem);
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.cw-r2 .primary-nav.desktop-nav a {
  padding: 0.45rem 0.35rem !important;
  background: transparent !important;
  border: 0 !important;
  white-space: nowrap;
}

/* --- Logo: native 1:1 mark, contain, no crop stretch --- */
body.cw-r2 .cw-g-mono-wrap,
body.cw-r2 .cw-mi-mark,
body.cw-r2 .cw-069-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px !important;
  height: 64px !important;
  flex: 0 0 64px;
  aspect-ratio: 1 / 1;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body.cw-r2 .cw-g-mono-wrap img,
body.cw-r2 .cw-mi-mark img,
body.cw-r2 .cw-069-mark img,
body.cw-r2 .cw-g-mono-img,
body.cw-r2 .cw-mi-mark-img {
  width: 100%;
  height: 100%;
  max-width: 64px;
  max-height: 64px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  display: block;
}

body.cw-r2 .cw-g-stack,
body.cw-r2 .cw-069-copy,
body.cw-r2 .logo-text-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.12rem;
  min-width: 0;
  line-height: 1.15;
}

body.cw-r2 .cw-g-master {
  font-size: clamp(0.98rem, 0.22vw + 0.9rem, 1.12rem) !important;
  letter-spacing: 0.14em;
  line-height: 1.15;
  white-space: nowrap;
}

body.cw-r2 .cw-g-lp {
  display: block !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.16em;
  line-height: 1.2;
  white-space: nowrap;
}

/* Secondary store tagline — not packed under the mark */
body.cw-r2 .cw-069-tagline,
body.cw-r2 .cw-g-combo {
  display: block;
  margin-top: 0.28rem;
  padding-top: 0.22rem;
  border-top: 1px solid rgba(176, 141, 87, 0.28);
  font-size: 0.68rem !important;
  letter-spacing: 0.12em;
  line-height: 1.25;
  white-space: nowrap;
  color: #B08D57;
}

body.cw-r2 .cw-mi-wordmark {
  display: none !important;
}

body.cw-r2 .cw-header-cta {
  min-height: 44px;
  border-radius: 2px;
  padding-inline: 1.15rem !important;
  box-shadow: none;
}

body.cw-r2 .mobile-nav-toggle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1200px) {
  body.cw-r2 .mobile-nav-toggle {
    display: none !important;
  }
}

@media (max-width: 1199px) {
  body.cw-r2 .header-row-nav,
  body.cw-r2 .primary-nav.desktop-nav {
    display: none !important;
  }
  body.cw-r2 .cw-g-header-inner,
  body.cw-r2 .cw-header-inner,
  body.cw-r2.cw-listing-page .cw-header-inner,
  body.cw-r2.cw-product-detail .cw-header-inner {
    grid-template-columns: minmax(0, 1fr) auto !important;
    min-height: 84px !important;
    column-gap: 0.85rem;
  }
  body.cw-r2 #main-header { min-height: 84px; }
  body.cw-r2 .mobile-nav-toggle {
    display: flex !important;
  }
  body.cw-r2 .cw-g-mono-wrap,
  body.cw-r2 .cw-mi-mark,
  body.cw-r2 .cw-069-mark {
    width: 52px !important;
    height: 52px !important;
    flex-basis: 52px;
  }
  body.cw-r2 .cw-g-mono-wrap img,
  body.cw-r2 .cw-mi-mark img,
  body.cw-r2 .cw-069-mark img {
    max-width: 52px;
    max-height: 52px;
  }
  body.cw-r2.cw-product-detail .cw-header-actions > a {
    display: none !important;
  }
  body.cw-r2 .cw-069-tagline,
  body.cw-r2 .cw-g-combo,
  body.cw-r2 .cw-mi-tag {
    display: none !important;
  }
}

@media (max-width: 767px) {
  body.cw-r2 .cw-g-header-inner,
  body.cw-r2 .cw-header-inner,
  body.cw-r2.cw-listing-page .cw-header-inner,
  body.cw-r2.cw-product-detail .cw-header-inner {
    min-height: 72px !important;
    column-gap: 0.65rem;
  }
  body.cw-r2 #main-header { min-height: 72px; }
  body.cw-r2 .cw-g-mono-wrap,
  body.cw-r2 .cw-mi-mark,
  body.cw-r2 .cw-069-mark {
    width: 44px !important;
    height: 44px !important;
    flex-basis: 44px;
  }
  body.cw-r2 .cw-g-mono-wrap img,
  body.cw-r2 .cw-mi-mark img,
  body.cw-r2 .cw-069-mark img {
    max-width: 44px;
    max-height: 44px;
  }
  body.cw-r2 .cw-header-cta,
  body.cw-r2 .cw-header-actions > a {
    display: none !important;
  }
  body.cw-r2 .cw-g-lp,
  body.cw-r2 .cw-069-tagline,
  body.cw-r2 .cw-g-combo,
  body.cw-r2 .cw-mi-tag {
    display: none !important;
  }
  body.cw-r2 .cw-g-master {
    font-size: 0.88rem !important;
    letter-spacing: 0.1em;
    white-space: normal;
    overflow-wrap: break-word;
  }
}

@media (max-width: 430px) {
  body.cw-r2 .cw-g-master {
    font-size: 0.82rem !important;
  }
}
