/* Mobile homepage and product listings. Keep Shoptet's search, menu and dock controllers. */
@media (max-width: 767px) {
  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) {
    --gpc-catalog-shortcuts-height: 54px;
    --gpc-catalog-promo-height: 30px;
  }

  /* Match the native mobile header's 50px positioning for all open panels. */
  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools {
    align-items: center;
    gap: 3px;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .site-name img {
    max-width: clamp(84px, calc(100vw - 295px), 106px);
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools > .click-cart {
    margin-inline-start: 0;
    padding-inline-end: 0;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools [data-testid="headerCart"] {
    min-width: 44px;
    min-height: 44px;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools [data-testid="headerCartPrice"] {
    max-width: 60px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools > [data-testid="linkSearchIcon"] {
    display: flex;
    width: 44px;
    height: 44px;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools > [data-target="login"] {
    width: 44px;
    height: 44px;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index):has(.top-navigation-bar .site-name):has(.responsive-tools > [data-testid="linkSearchIcon"]) > .overall-wrapper {
    padding-top: 50px;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index):has(.top-navigation-bar .site-name):has(.responsive-tools > [data-testid="linkSearchIcon"]):not(.search-window-visible) #header .header-top > .search {
    display: none;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools [data-testid="hamburgerMenu"] {
    position: relative;
    right: auto;
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 74px;
    height: 44px;
    gap: 6px;
    margin: 0;
    padding: 0 8px;
    border: 1px solid #37136b;
    border-radius: 9px;
    background: #37136b;
    color: #fff;
    font: 800 13px/1 Nunito, sans-serif;
    text-decoration: none;
    text-transform: none;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools [data-testid="hamburgerMenu"]::before {
    content: "";
    position: static;
    flex: 0 0 14px;
    width: 14px;
    height: 12px;
    margin: 0;
    padding: 0;
    transform: none;
    border: 0;
    color: inherit;
    background:
      linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
      linear-gradient(currentColor, currentColor) 0 5px / 100% 2px no-repeat,
      linear-gradient(currentColor, currentColor) 0 10px / 100% 2px no-repeat;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools [data-testid="hamburgerMenu"]::after {
    content: "Menu";
    position: static;
    margin: 0;
    padding: 0;
    transform: none;
    color: inherit;
    font: inherit;
    text-transform: none;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools > a:focus-visible {
    outline: 2px solid #6a20cc;
    outline-offset: -2px;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) #header > .gpc-menu-a {
    height: var(--gpc-catalog-shortcuts-height);
    padding: 5px 10px;
    background: #f8f4ff;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .gpc-menu-a-space {
    height: var(--gpc-catalog-shortcuts-height);
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .gpc-menu-a summary {
    height: 44px;
    gap: 6px;
    padding-inline: 7px;
    font-size: 12px;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .gpc-menu-a summary br {
    display: none;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .gpc-menu-a summary::before {
    flex-basis: 23px;
    height: 23px;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) #header .gpc-menu-a > .gpc-menu-a-pc {
    --gpc-menu-a-fill: linear-gradient(105deg, #3b1475, #572594);
    --gpc-menu-a-edge: #572594;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) #header .gpc-menu-a > .gpc-menu-a-ai {
    --gpc-menu-a-fill: #fff;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) #gpc-bf-mobile-nav {
    min-height: var(--gpc-catalog-promo-height);
    margin-bottom: 0;
    padding: 0 16px;
  }

  /* The fixed campaign script reserves its original 12px under the bar. */
  html body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) #gpc-bf-mobile-nav[data-gpc-bf-fixed]::after {
    content: none !important;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) #gpc-bf-mobile-spacer[data-gpc-bf-active] {
    height: var(--gpc-catalog-promo-height) !important;
  }

  /* Keep the original visual gap before the homepage's campaign banner. */
  body.type-index #gpc-bf-mobile-spacer[data-gpc-bf-active] {
    height: calc(var(--gpc-catalog-promo-height) + 12px) !important;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index:not(.gpc-catalog-open)) .gpc-mobile-bottom-nav[data-gpc-version="5"] .gpc-mobile-bottom-nav__links {
    min-height: 47px !important;
    width: min(100%, 316px);
    margin-inline: auto !important;
    padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)) !important;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index:not(.gpc-catalog-open)) .gpc-mobile-bottom-nav[data-gpc-version="5"] .gpc-mobile-bottom-nav__item {
    min-height: 47px !important;
    gap: 2px !important;
    padding: 0 2px !important;
    border-radius: 0 !important;
    color: #514763 !important;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index:not(.gpc-catalog-open)) .gpc-mobile-bottom-nav[data-gpc-version="5"] .gpc-mobile-bottom-nav__item svg {
    width: 18px !important;
    height: 18px !important;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index:not(.gpc-catalog-open)) .gpc-mobile-bottom-nav[data-gpc-version="5"] .gpc-mobile-bottom-nav__item[aria-current="page"] {
    color: #551caa !important;
    background: transparent !important;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index:not(.gpc-catalog-open)) .gpc-mobile-bottom-nav[data-gpc-version="5"] .gpc-mobile-bottom-nav__item[aria-current="page"]::before {
    top: -1px !important;
    width: 23px !important;
    height: 2px !important;
    background: #551caa !important;
  }
}

@media (max-width: 379px) {
  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .site-name img {
    max-width: clamp(84px, 27vw, 106px);
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools [data-testid="headerCartPrice"] {
    display: none !important;
  }
}

@media (max-width: 359px) {
  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools {
    gap: 1px;
  }

  body:is(.type-category, .type-search, .type-manufacturer-detail, .type-index) .top-navigation-bar .responsive-tools [data-testid="hamburgerMenu"] {
    min-width: 66px;
    padding-inline: 6px;
  }
}
