/* ZieloneDrzewko.pl 2.63 - mobilny header / trustbar / wyszukiwarka / kategorie */

/* Desktop pozostaje bez zmian. Poniższe reguły aktywują się tylko na urządzeniach mobilnych/tabletach. */
@media (max-width: 900px) {
  .shop-header.shop-header--market {
    background: #fff;
    position: relative;
    z-index: 40;
  }

  /* Zielony pasek korzyści: jedna lekka, przewijana linia zamiast wysokiego bloku. */
  .shop-header .header-trustbar {
    min-height: 36px;
    overflow: hidden;
  }

  .shop-header .header-trustbar-inner {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .shop-header .header-trust-items {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0 10px;
  }

  .shop-header .header-trust-items::-webkit-scrollbar {
    display: none;
  }

  .shop-header .header-trust-item {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 36px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    scroll-snap-align: start;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1;
  }

  .shop-header .header-trust-item svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
  }

  /* Główny header: logo + akcje w pierwszym rzędzie, wyszukiwarka w drugim. */
  .shop-header .header-mainbar {
    padding: 0;
    border-bottom: 1px solid #edf1eb;
  }

  .shop-header .header-inner {
    width: min(100% - 24px, 900px);
    margin: 0 auto;
    padding: 10px 0 11px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "logo actions"
      "search search";
    align-items: center;
    gap: 9px 14px;
  }

  .shop-header .header-logo {
    grid-area: logo;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: fit-content;
    min-width: 0;
  }

  .shop-header .header-logo img {
    width: auto !important;
    height: 64px !important;
    max-width: 106px !important;
    object-fit: contain;
  }

  .shop-header .header-actions {
    grid-area: actions;
    justify-self: end;
    display: grid;
    grid-template-columns: repeat(3, minmax(46px, 62px));
    align-items: center;
    gap: 4px;
    min-width: 0;
  }

  .shop-header .header-action {
    min-width: 0;
    min-height: 54px;
    padding: 5px 4px;
    border: 0;
    border-radius: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    text-decoration: none;
    transition: background-color .16s ease, transform .16s ease;
  }

  .shop-header .header-action:active {
    transform: scale(.97);
    background: #f4f7f1;
  }

  .shop-header .header-action .action-icon {
    width: 23px;
    height: 23px;
    min-width: 23px;
    display: grid;
    place-items: center;
    position: relative;
  }

  .shop-header .header-action .action-icon img {
    width: 22px !important;
    height: 22px !important;
    object-fit: contain;
  }

  .shop-header .header-action-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 60px;
    line-height: 1.05;
    text-align: center;
  }

  .shop-header .header-action-copy strong {
    font: inherit;
    font-size: 10.5px;
    font-weight: 700;
    color: #17382b;
  }

  .shop-header .header-action-copy small {
    margin-top: 1px;
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: inherit;
    font-size: 8.5px;
    color: #7a867f;
  }

  .shop-header .cart-count-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    top: -5px;
    right: -7px;
    font-size: 9px;
    line-height: 16px;
  }

  .shop-header .header-search-area {
    grid-area: search;
    width: 100%;
    min-width: 0;
    position: relative;
  }

  .shop-header .header-search {
    width: 100%;
    height: 44px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    border-radius: 13px;
    overflow: hidden;
  }

  .shop-header .header-search input {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    border-radius: 13px 0 0 13px;
    font: inherit;
    font-size: 13px;
  }

  .shop-header .header-search button {
    width: 48px;
    min-width: 48px;
    height: 44px;
    border-radius: 0 13px 13px 0;
    display: grid;
    place-items: center;
  }

  .shop-header .header-search button svg {
    width: 20px;
    height: 20px;
  }

  .shop-header .search-suggest-panel {
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: min(60vh, 430px);
    overflow-y: auto;
    border-radius: 14px;
  }

  /* Kategorie: przewijane poziomo, duży obszar dotyku, bez łamania nazw. */
  .shop-header .category-menu {
    border-top: 0;
    border-bottom: 1px solid #e8ede6;
    background: #fff;
    overflow: hidden;
  }

  .shop-header .menu-inner {
    width: 100%;
    max-width: none;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 7px;
    padding: 8px 12px 9px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }

  .shop-header .menu-inner::-webkit-scrollbar {
    display: none;
  }

  .shop-header .menu-inner > a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #e5ebe2;
    border-radius: 999px;
    background: #f9fbf7;
    color: #17382b;
    white-space: nowrap;
    scroll-snap-align: start;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  }

  .shop-header .menu-inner > a:hover,
  .shop-header .menu-inner > a:focus-visible {
    background: #f1f6eb;
    border-color: #ccd9c6;
  }

  .shop-header .menu-inner > a.is-active,
  .shop-header .menu-inner > a[aria-current="page"] {
    background: #edf5df;
    border-color: #b9cb96;
    color: #244a35;
  }

  .shop-header .menu-inner > a[data-sale-nav="1"] {
    background: #fff8f7;
    border-color: #efd7d3;
  }

  .shop-header .menu-sale-icon {
    width: 23px;
    height: 23px;
    min-width: 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
  }
}

@media (max-width: 560px) {
  .shop-header .header-inner {
    width: calc(100% - 18px);
    gap: 7px 8px;
    padding: 8px 0 9px;
  }

  .shop-header .header-logo img {
    height: 54px !important;
    max-width: 88px !important;
  }

  .shop-header .header-actions {
    grid-template-columns: repeat(3, minmax(42px, 54px));
    gap: 1px;
  }

  .shop-header .header-action {
    min-height: 48px;
    padding: 3px 2px;
  }

  .shop-header .header-action .action-icon {
    width: 21px;
    height: 21px;
    min-width: 21px;
  }

  .shop-header .header-action .action-icon img {
    width: 20px !important;
    height: 20px !important;
  }

  .shop-header .header-action-copy strong {
    font-size: 9.5px;
  }

  .shop-header .header-action-copy small {
    font-size: 7.5px;
    max-width: 50px;
  }

  .shop-header .header-search,
  .shop-header .header-search input,
  .shop-header .header-search button {
    height: 42px;
  }

  .shop-header .header-search {
    grid-template-columns: minmax(0, 1fr) 46px;
    border-radius: 12px;
  }

  .shop-header .header-search input {
    padding: 0 12px;
    font-size: 12px;
  }

  .shop-header .header-search button {
    width: 46px;
    min-width: 46px;
  }

  .shop-header .header-trust-item {
    min-height: 34px;
    padding: 0 13px;
    font-size: 10px;
  }

  .shop-header .menu-inner {
    padding: 7px 9px 8px;
    gap: 6px;
  }

  .shop-header .menu-inner > a {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .shop-header .header-logo img {
    height: 48px !important;
    max-width: 78px !important;
  }

  .shop-header .header-actions {
    grid-template-columns: repeat(3, 43px);
  }

  .shop-header .header-action-copy small {
    display: none;
  }

  .shop-header .header-action {
    min-height: 44px;
  }

  .shop-header .header-action-copy strong {
    font-size: 9px;
  }
}
