/* GrahamSG Header Hotfix 3: compact Pacific promo and single-row mobile masthead.
   Keep native Magento menu, search/autocomplete, account and minicart DOM intact.
   Loaded after Hotfix 1 and Hotfix 2 CSS via a new cache-safe filename. */
@media screen and (max-width: 767px) {
  /* The deleted explanatory sentence no longer creates a third promo row.
     Keep the arrow immediately after the Build a Cap action. */
  .page-header .g-header-promo__link {
    min-height: 42px;
    padding: 5px 10px;
    gap: 1px 7px;
    line-height: 1.18;
  }
  .page-header .g-header-promo__arrow {
    display: inline-block !important;
    font-size: 15px;
    line-height: 1;
    vertical-align: middle;
  }

  /* Row 1: menu | actual Graham logo | Account | native Cart.
     Row 2: native full-width search. Row 3: Richardson/Pacific shortcuts. */
  .page-header .header.content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    column-gap: 7px;
    row-gap: 6px;
    padding: 5px 10px 9px !important;
  }
  .page-header .header.content > .nav-toggle {
    order: 0;
    flex: 0 0 38px;
    width: 38px;
    height: 56px;
    min-height: 44px;
    margin: 0 !important;
    align-self: center;
  }
  .page-header .header.content > .logo {
    order: 1;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    flex: 0 0 110px;
    width: 110px !important;
    max-width: 110px;
    margin: 0 !important;
    z-index: auto;
  }
  .page-header .header.content > .logo img {
    width: 100% !important;
    height: auto !important;
    max-height: 60px;
    object-fit: contain;
  }
  .page-header .g-header-account {
    order: 2;
    display: flex !important;
    flex: 0 0 44px;
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0 !important;
    margin: 0 0 0 auto !important;
    align-items: center;
    justify-content: center;
  }
  .page-header .g-header-account svg {
    width: 22px;
    height: 22px;
  }
  .page-header .g-header-account span {
    display: block !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    clip: rect(0,0,0,0) !important;
    clip-path: inset(50%) !important;
  }
  .page-header .header.content > .minicart-wrapper {
    order: 3;
    flex: 0 0 44px;
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    margin: 0 !important;
    align-self: center;
  }
  .page-header .header.content > .minicart-wrapper > .action.showcart {
    display: flex !important;
    width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
  }
  /* Hide the visible Cart label, but keep an accessible name for screen readers.
     Leave the Magento cart-count span untouched. */
  .page-header .header.content > .minicart-wrapper > .action.showcart > .text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }
  .page-header .header.content > .block-search {
    order: 4;
    flex: 1 1 100%;
    width: 100% !important;
    min-width: 0;
    margin: 1px 0 0 !important;
  }
  .page-header .g-header-mobile-choices { order: 5; }
}
@media screen and (max-width: 350px) {
  .page-header .header.content > .logo {
    flex-basis: 96px;
    width: 96px !important;
    max-width: 96px;
  }
  .page-header .header.content { column-gap: 5px; }
}

/* GRAHAMSG — approved final mobile masthead refinement.
   Loaded last in Hotfix 3; preserves Magento-native menu, search, account, and minicart. */
@media screen and (max-width: 767px) {
  .page-header .header.content {
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px 7px !important;
    padding: 6px 10px 9px !important;
    min-height: 0 !important;
  }
  .page-header .header.content > .nav-toggle {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    order: 0;
    flex: 0 0 40px;
    width: 40px !important;
    min-width: 40px;
    height: 54px;
    min-height: 44px;
    margin: 0 !important;
    transform: none !important;
    align-self: center;
  }
  .page-header .header.content > .logo {
    position: static !important;
    order: 1;
    flex: 0 1 116px;
    width: 116px !important;
    max-width: 116px;
    min-width: 0;
    margin: 0 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    float: none !important;
    align-self: center;
  }
  .page-header .header.content > .logo img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-height: 62px;
    object-fit: contain;
  }
  .page-header .header.content > .g-header-account {
    order: 2;
    display: flex !important;
    flex: 0 0 44px;
    width: 44px !important;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    align-items: center;
    justify-content: center;
  }
  .page-header .g-header-account span {
    display: block !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    clip: rect(0,0,0,0) !important;
    clip-path: inset(50%) !important;
  }
  .page-header .header.content > .minicart-wrapper {
    order: 3;
    display: flex !important;
    flex: 0 0 44px;
    width: 44px !important;
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    float: none !important;
  }
  .page-header .minicart-wrapper > .action.showcart {
    display: flex !important;
    width: 44px;
    min-height: 44px;
    padding: 0 !important;
    align-items: center;
    justify-content: center;
  }
  .page-header .header.content > .block-search {
    order: 4;
    flex: 1 1 100%;
    width: 100% !important;
    min-width: 0;
    max-width: none !important;
    margin: 1px 0 0 !important;
    float: none !important;
    clear: both;
  }
  .page-header .header.content > .g-header-mobile-choices {
    order: 5;
    flex: 1 1 100%;
    width: 100%;
    margin: 4px 0 0 !important;
  }
  .page-header .g-header-choice--richardson,
  .page-header .g-header-choice--richardson:visited {
    background: #171717 !important;
    color: #fff !important;
    border-color: #171717 !important;
  }
  .page-header .g-header-choice--richardson * { color: #fff !important; }
}
@media screen and (max-width: 350px) {
  .page-header .header.content { column-gap: 5px !important; }
  .page-header .header.content > .logo {
    flex-basis: 104px;
    width: 104px !important;
    max-width: 104px;
  }
}

@media screen and (max-width: 767px) {
  .page-header .g-header-choice--richardson:hover,
  .page-header .g-header-choice--richardson:focus-visible {
    background: #171717 !important;
    border-color: #171717 !important;
    color: #fff !important;
  }
  .page-header .g-header-choice--richardson:focus-visible {
    outline: 2px solid #E2150F;
    outline-offset: 2px;
  }
}
