/* Problem 4: nagłówek musi zmieścić się również na telefonach 320 px. */
@media (max-width: 359px) {
  .site-header .ast-container,
  .ast-primary-header-bar .site-primary-header-wrap {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .ast-primary-header-bar .ast-builder-grid-row {
    grid-template-columns: minmax(0, 1fr) 48px !important;
    column-gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .site-header-primary-section-left,
  .site-header-primary-section-right,
  .ast-builder-layout-element,
  .ast-site-identity {
    min-width: 0 !important;
  }

  .site-header .custom-logo-link {
    display: block;
    width: min(220px, calc(100vw - 92px)) !important;
    max-width: 100% !important;
  }

  .site-header .custom-logo {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .securebhp-home-checklist__inner {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .securebhp-home-checklist__inner > *,
  .securebhp-home-checklist__form {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .securebhp-home-checklist__form input,
  .securebhp-home-checklist__form select,
  .securebhp-home-checklist__form textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

/* Problem 5: najważniejsze pola dotykowe mają co najmniej 44 px. */
@media (max-width: 921px) {
  .menu-toggle.main-header-menu-toggle,
  .ast-mobile-menu-trigger-minimal {
    min-width: 48px !important;
    min-height: 48px !important;
  }

  .elementor-button,
  .wp-element-button,
  button:not(.cky-accordion-btn),
  input[type="submit"] {
    min-height: 44px;
  }

  .elementor-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
  }
}

/*
 * Mobilny nagłówek i rozwijane menu Astry.
 * Reguły są globalne, dzięki czemu wygląd jest spójny na wszystkich
 * podstronach securebhp.pl, również na landing page'ach z własnym CSS.
 */
@media (max-width: 921px) {
  #ast-mobile-header {
    position: relative;
    z-index: 99990;
    width: 100%;
    background: #071728;
  }

  #ast-mobile-header .ast-main-header-wrap,
  #ast-mobile-header .ast-primary-header-bar {
    left: auto !important;
    width: 100% !important;
    min-height: 78px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #071728 !important;
  }

  #ast-mobile-header .ast-builder-grid-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 52px !important;
    column-gap: 12px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 78px !important;
    margin: 0 !important;
    padding: 10px 16px !important;
    box-sizing: border-box !important;
  }

  #ast-mobile-header .site-header-primary-section-left,
  #ast-mobile-header .site-header-primary-section-right,
  #ast-mobile-header .ast-builder-layout-element,
  #ast-mobile-header .ast-site-identity,
  #ast-mobile-header .site-branding,
  #ast-mobile-header .ast-button-wrap {
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    align-items: center !important;
  }

  #ast-mobile-header .site-header-primary-section-right,
  #ast-mobile-header .ast-button-wrap {
    justify-content: flex-end !important;
  }

  #ast-mobile-header .custom-logo-link {
    display: flex !important;
    align-items: center;
    width: min(190px, calc(100vw - 104px)) !important;
    max-width: 100% !important;
    height: auto !important;
  }

  #ast-mobile-header .custom-logo {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    max-height: 58px !important;
    height: auto !important;
    object-fit: contain;
    object-position: left center;
  }

  #ast-mobile-header .menu-label {
    display: none !important;
  }

  #ast-mobile-header .main-header-menu-toggle {
    display: grid !important;
    place-items: center !important;
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ff7600 !important;
    line-height: 1 !important;
  }

  #ast-mobile-header .main-header-menu-toggle:hover,
  #ast-mobile-header .main-header-menu-toggle:focus-visible,
  #ast-mobile-header .main-header-menu-toggle.toggled {
    border-color: #ff7600 !important;
    background: rgba(255, 118, 0, 0.13) !important;
    color: #ff8a33 !important;
  }

  #ast-mobile-header .main-header-menu-toggle .mobile-menu-toggle-icon,
  #ast-mobile-header .main-header-menu-toggle .ahfb-svg-iconset {
    display: flex !important;
    width: 22px !important;
    height: 22px !important;
    align-items: center;
    justify-content: center;
  }

  #ast-mobile-header .ast-mobile-header-content {
    position: fixed !important;
    z-index: 99989 !important;
    top: 78px !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: calc(100dvh - 78px) !important;
    margin: 0 !important;
    padding: 8px 0 24px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    border-top: 3px solid #ff7600 !important;
    background: #fff !important;
    box-shadow: 0 18px 35px rgba(7, 23, 40, 0.24) !important;
  }

  body.admin-bar #ast-mobile-header .ast-mobile-header-content {
    top: 124px !important;
    max-height: calc(100dvh - 124px) !important;
  }

  #ast-mobile-header .ast-builder-menu-mobile,
  #ast-mobile-header .ast-main-header-bar-alignment,
  #ast-mobile-header .main-header-bar-navigation,
  #ast-mobile-header #ast-mobile-site-navigation,
  #ast-mobile-header .main-navigation,
  #ast-mobile-header #ast-hf-mobile-menu {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu {
    display: block !important;
    position: static !important;
    list-style: none !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu > li {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #e2e8ee !important;
    background: #fff !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu > li > a.menu-link {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 54px !important;
    padding: 13px 70px 13px 20px !important;
    box-sizing: border-box !important;
    background: #fff !important;
    color: #102a42 !important;
    font-size: 16px !important;
    font-weight: 750 !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    text-decoration: none !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu > li.current-menu-item > a.menu-link,
  #ast-mobile-header #ast-hf-mobile-menu > li.current-menu-ancestor > a.menu-link,
  #ast-mobile-header #ast-hf-mobile-menu > li > a.menu-link:hover,
  #ast-mobile-header #ast-hf-mobile-menu > li > a.menu-link:focus-visible {
    background: #f6f8fa !important;
    color: #b44f00 !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu > li > a .dropdown-menu-toggle {
    display: none !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu > li > button.ast-menu-toggle {
    display: grid !important;
    position: absolute !important;
    z-index: 2;
    top: 5px !important;
    right: 10px !important;
    left: auto !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    place-items: center !important;
    border: 1px solid #dbe3ea !important;
    border-radius: 8px !important;
    background: #f3f6f8 !important;
    color: #1d344b !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu > li.ast-submenu-expanded > button.ast-menu-toggle {
    border-color: #ff7600 !important;
    background: #ff7600 !important;
    color: #fff !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu > li > button.ast-menu-toggle .ast-icon {
    display: flex !important;
    width: 20px !important;
    height: 20px !important;
    align-items: center;
    justify-content: center;
  }

  #ast-mobile-header #ast-hf-mobile-menu > li > button.ast-menu-toggle svg {
    width: 15px !important;
    height: 10px !important;
    fill: currentColor !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu .sub-menu {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 7px 12px 11px 18px !important;
    border: 0 !important;
    background: #f3f6f8 !important;
    box-shadow: inset 4px 0 0 #ff7600 !important;
    list-style: none !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu .sub-menu > li {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu .sub-menu a.menu-link {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 47px !important;
    padding: 10px 12px !important;
    border-bottom: 1px solid #dce4eb !important;
    background: transparent !important;
    color: #31485e !important;
    font-size: 14px !important;
    font-weight: 650 !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    text-decoration: none !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu .sub-menu > li:last-child > a.menu-link {
    border-bottom: 0 !important;
  }

  #ast-mobile-header #ast-hf-mobile-menu .sub-menu a.menu-link::before {
    width: 7px;
    height: 7px;
    margin: 0 12px 0 2px;
    flex: 0 0 7px;
    border-top: 2px solid #ff7600;
    border-right: 2px solid #ff7600;
    content: "";
    transform: rotate(45deg);
  }

  #ast-mobile-header #ast-hf-mobile-menu .sub-menu a.menu-link > .ast-icon {
    display: none !important;
  }

  body.ast-main-header-nav-open {
    overflow: hidden !important;
  }

  body.ast-main-header-nav-open .sbhp-gw-mobile-bar,
  body.ast-main-header-nav-open .securebhp-mobile-call,
  body.ast-main-header-nav-open .securebhp-cookie-settings {
    display: none !important;
  }
}
