/*
 * COMMAND 3100_064Y — Responsive header and text safety
 * Load LAST after theme-067-structure-fix.css. Geometry/typography only.
 */

/* Content-driven header: compact by default, free to grow at zoom/wrap. */
body.cw-r2 #main-header {
  min-height: 96px;
  height: auto;
}

body.cw-r2 .cw-g-header-inner,
body.cw-r2 .cw-header-inner {
  min-height: 92px !important;
  height: auto !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  align-items: center;
  box-sizing: border-box;
}

body.cw-r2 .cw-g-mono-wrap {
  width: 72px !important;
  height: 72px !important;
  flex: 0 0 72px;
}

body.cw-r2.cw-listing-page .cw-mi-mark,
body.cw-r2.cw-product-detail .cw-mi-mark {
  width: 64px !important;
  height: 64px !important;
  flex: 0 0 64px;
}

body.cw-r2 .logo,
body.cw-r2 .cw-mi-brand,
body.cw-r2 .cw-g-brand,
body.cw-r2 .logo-text-wrap,
body.cw-r2 .cw-g-stack,
body.cw-r2 .cw-header-actions,
body.cw-r2 .header-actions-group {
  min-width: 0;
}

body.cw-r2 .logo-text-wrap,
body.cw-r2 .cw-g-stack {
  line-height: 1.15;
  overflow-wrap: normal;
}

body.cw-r2 .cw-g-master {
  font-size: clamp(0.95rem, 0.25vw + 0.88rem, 1.05rem) !important;
  line-height: 1.1;
}
body.cw-r2 .cw-g-lp {
  font-size: clamp(0.6rem, 0.1vw + 0.56rem, 0.66rem) !important;
  line-height: 1.25;
}
body.cw-r2 .cw-g-combo {
  font-size: clamp(0.72rem, 0.15vw + 0.66rem, 0.82rem) !important;
  line-height: 1.2;
}
body.cw-r2 .cw-mi-wordmark {
  font-size: clamp(1rem, 0.25vw + 0.92rem, 1.15rem);
  line-height: 1.1;
}
body.cw-r2 .cw-mi-tag {
  font-size: clamp(0.62rem, 0.1vw + 0.58rem, 0.68rem);
  line-height: 1.2;
}

body.cw-r2 .primary-nav.desktop-nav {
  min-width: 0;
  flex-wrap: nowrap;
}
body.cw-r2 .primary-nav.desktop-nav a {
  min-width: 0;
  font-size: clamp(0.875rem, 0.18vw + 0.82rem, 0.98rem) !important;
  line-height: 1.35;
  white-space: nowrap;
}
body.cw-r2 .cw-header-cta {
  min-height: 44px;
  padding-inline: clamp(0.75rem, 1vw, 1.1rem) !important;
  font-size: clamp(0.875rem, 0.14vw + 0.84rem, 0.95rem) !important;
  line-height: 1.3;
  white-space: nowrap;
}

/* Switch before navigation can squeeze the brand or CTA. */
@media (max-width: 1199px) {
  body.cw-r2 .header-row-nav,
  body.cw-r2 .primary-nav.desktop-nav {
    display: none !important;
  }
  body.cw-r2 .mobile-nav-toggle {
    display: flex !important;
    flex: 0 0 44px;
  }
  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: 80px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }
  body.cw-r2 #main-header { min-height: 84px; }
  body.cw-r2 .cw-g-mono-wrap {
    width: 60px !important;
    height: 60px !important;
    flex-basis: 60px;
  }
  body.cw-r2.cw-listing-page .cw-mi-mark,
  body.cw-r2.cw-product-detail .cw-mi-mark {
    width: 60px !important;
    height: 60px !important;
    flex-basis: 60px;
  }
  body.cw-r2.cw-product-detail .cw-header-actions > a {
    display: none !important;
  }
  body.cw-r2 .cw-g-lp {
    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: 68px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    gap: 0.75rem !important;
  }
  body.cw-r2 #main-header { min-height: 72px; }
  body.cw-r2 .cw-g-mono-wrap,
  body.cw-r2.cw-listing-page .cw-mi-mark,
  body.cw-r2.cw-product-detail .cw-mi-mark {
    width: 52px !important;
    height: 52px !important;
    flex-basis: 52px;
  }
  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-mi-tag {
    display: none !important;
  }
  body.cw-r2 .cw-g-master { font-size: 0.9rem !important; }
  body.cw-r2 .cw-g-combo {
    font-size: 0.75rem !important;
    letter-spacing: 0.08em !important;
    white-space: normal !important;
    overflow-wrap: normal;
  }
  body.cw-r2 .cw-mi-wordmark { font-size: 1rem; }
}

@media (max-width: 380px) {
  body.cw-r2 .cw-g-master { font-size: 0.84rem !important; }
  body.cw-r2 .cw-g-combo { font-size: 0.75rem !important; }
  body.cw-r2 .cw-mi-wordmark { font-size: 0.94rem; }
}

/* Readable content wrapping without clipping or scaling. */
body.cw-r2 .cw-im-hero-copy,
body.cw-r2 .cw-im-hero-copy > *,
body.cw-r2 .cw-r2-section-head,
body.cw-r2 .cw-shop-cat-copy,
body.cw-r2 .cw-card-body,
body.cw-r2 .footer-grid > * {
  min-width: 0;
  box-sizing: border-box;
}

body.cw-r2 .cw-im-hero h1 {
  font-size: clamp(1.7rem, 4.6vw, 3.4rem) !important;
  line-height: 1.2 !important;
  max-width: 100%;
  overflow-wrap: break-word;
}
body.cw-r2 .cw-im-hero .cw-hero-subtitle {
  font-size: clamp(1rem, 0.45vw + 0.88rem, 1.12rem);
  line-height: 1.65;
  max-width: min(100%, 40rem);
  overflow-wrap: break-word;
}
body.cw-r2 .cw-im-hero .cw-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
body.cw-r2 .cw-im-hero .cw-hero-actions .btn {
  min-width: min(10.5rem, 100%);
  white-space: normal;
  line-height: 1.35;
}

body.cw-r2 .cw-shop-cat-copy,
body.cw-r2 .cw-card-title,
body.cw-r2 .cw-card-title-clamp,
body.cw-r2 .cw-card-price,
body.cw-r2 .cw-card-cta,
body.cw-r2 .card-detail-btn,
body.cw-r2 .footer-grid,
body.cw-r2 .footer-grid a,
body.cw-r2 .footer-grid p {
  overflow-wrap: anywhere;
}

body.cw-r2 .cw-card-actions {
  position: static;
  margin-top: auto;
}
body.cw-r2 .cw-card-cta,
body.cw-r2 .card-detail-btn {
  min-height: 44px;
  height: auto;
  white-space: normal;
  line-height: 1.35;
  text-align: center;
}
body.cw-r2 .footer-grid > * {
  height: auto;
}

body.cw-r2 .cw-discovery-input,
body.cw-r2 .cw-discovery-select,
body.cw-r2 button,
body.cw-r2 input,
body.cw-r2 select {
  max-width: 100%;
}

@media (max-width: 767px) {
  body.cw-r2 .cw-im-hero h1 {
    font-size: clamp(1.65rem, 7vw, 2.2rem) !important;
    line-height: 1.25 !important;
  }
  body.cw-r2 .cw-im-hero-copy {
    max-width: 100%;
  }
}
