/* Mobile search: app-like fullscreen scene with independent header,
   scrollable result area and footer. */
.bps-mobile-search {
  display: none;
}

body.bps-mobile-search-open {
  overflow: hidden;
  overscroll-behavior: none;
}

@media (max-width: 991.98px) {
  .bps-live-search {
    display: none !important;
  }

  .bps-mobile-search {
    position: fixed;
    top: var(--bps-mobile-viewport-top, 0px);
    right: auto;
    bottom: auto;
    left: var(--bps-mobile-viewport-left, 0px);
    z-index: 10080;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100%;
    width: var(--bps-mobile-viewport-width, 100%);
    height: 100vh;
    height: 100dvh;
    height: var(--bps-mobile-viewport-height, 100dvh);
    overflow: hidden;
    box-sizing: border-box;
    background: var(--batya-card, #fff);
    color: var(--batya-text, #171717);
  }

  .bps-mobile-search[hidden] {
    display: none !important;
  }

  .bps-mobile-search__header {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding:
      calc(env(safe-area-inset-top, 0px) + 8px)
      calc(env(safe-area-inset-right, 0px) + 10px)
      8px
      calc(env(safe-area-inset-left, 0px) + 10px);
    border-bottom: 1px solid var(--batya-border, #e7e1db);
    background: var(--batya-card, #fff);
  }

  .bps-mobile-search__back,
  .bps-mobile-search__clear {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--batya-text, #171717);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .bps-mobile-search__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
  }

  .bps-mobile-search__back:active,
  .bps-mobile-search__clear:active {
    background: var(--batya-brand-soft, #fff3e8);
  }

  .bps-mobile-search__back:focus-visible,
  .bps-mobile-search__clear:focus-visible,
  .bps-mobile-search__recent-clear:focus-visible,
  .bps-mobile-search__recent-item:focus-visible,
  .bps-mobile-search__quick-item:focus-visible,
  .bps-mobile-search__all:focus-visible {
    outline: 2px solid var(--batya-text, #171717);
    outline-offset: 2px;
  }

  .bps-mobile-search__back svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .bps-mobile-search__field {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    height: 44px;
    border: 1px solid var(--batya-border, #e7e1db);
    border-radius: 14px;
    background: var(--batya-bg, #faf7f3);
    transition:
      border-color .16s ease,
      box-shadow .16s ease,
      background-color .16s ease;
  }

  .bps-mobile-search__field:focus-within {
    border-color: #b9aa9c;
    box-shadow: 0 0 0 2px rgba(87, 74, 62, .14);
  }

  .bps-mobile-search__icon {
    position: absolute;
    left: 13px;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    color: var(--batya-text-soft, #777);
    pointer-events: none;
  }

  .bps-mobile-search__icon svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .bps-mobile-search__input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 42px 0 40px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--batya-text, #171717);
    font: inherit;
    font-size: 16px;
    line-height: 1.2;
    -webkit-appearance: none;
    appearance: none;
  }

  .bps-mobile-search__input::placeholder {
    color: var(--batya-text-soft, #777);
    opacity: 1;
  }

  .bps-mobile-search__input::-webkit-search-cancel-button {
    display: none;
    -webkit-appearance: none;
  }

  .bps-mobile-search__clear {
    position: absolute;
    right: 5px;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0 0 2px;
    border-radius: 50%;
    transform: translateY(-50%);
    color: var(--batya-text-soft, #777);
    font-size: 25px;
    font-weight: 300;
    line-height: 1;
  }

  .bps-mobile-search__clear[hidden] {
    display: none !important;
  }

  .bps-mobile-search__content {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding:
      6px
      calc(env(safe-area-inset-right, 0px) + 12px)
      4px
      calc(env(safe-area-inset-left, 0px) + 12px);
    background: var(--batya-card, #fff);
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .bps-mobile-search__hint,
  .bps-mobile-search__status {
    max-width: 360px;
    margin: 8px auto 0;
    color: var(--batya-text-soft, #777);
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
  }

  .bps-mobile-search__status[data-state="error"] {
    color: #8b3a32;
  }

  .bps-mobile-search__status[data-state="corrected"] {
    max-width: none;
    margin: 0 -12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--batya-border, #ece7e1);
    background: var(--batya-bg, #faf7f3);
    color: var(--batya-text-soft, #666);
    font-size: 12.5px;
    text-align: left;
  }

  .bps-mobile-search__recent {
    margin: 2px -12px 0;
  }

  .bps-mobile-search__recent[hidden] {
    display: none !important;
  }

  .bps-mobile-search__recent-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 0 14px;
  }

  .bps-mobile-search__recent-title {
    margin: 0;
    color: var(--batya-text, #171717);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
  }

  .bps-mobile-search__recent-clear {
    appearance: none;
    padding: 7px 0 7px 12px;
    border: 0;
    background: transparent;
    color: var(--batya-text-soft, #777);
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .bps-mobile-search__recent-clear:active {
    color: var(--batya-text, #171717);
  }

  .bps-mobile-search__recent-list {
    display: grid;
    border-top: 1px solid var(--batya-border, #ece7e1);
  }

  .bps-mobile-search__recent-item {
    appearance: none;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 8px 14px;
    border: 0;
    border-bottom: 1px solid var(--batya-border, #ece7e1);
    background: transparent;
    color: var(--batya-text, #171717);
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .bps-mobile-search__recent-item:active {
    background: var(--batya-brand-soft, #fff3e8);
  }

  .bps-mobile-search__recent-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--batya-text-soft, #777);
  }

  .bps-mobile-search__recent-icon svg {
    display: block;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .bps-mobile-search__recent-text {
    overflow: hidden;
    font-size: 14.5px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bps-mobile-search__quick {
    margin: 8px 0 4px;
  }

  .bps-mobile-search__quick[hidden] {
    display: none !important;
  }

  .bps-mobile-search__quick-title {
    margin: 0 0 8px;
    color: var(--batya-text, #171717);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
  }

  .bps-mobile-search__quick-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .bps-mobile-search__quick-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 0;
    min-height: 50px;
    padding: 9px 11px;
    border: 1px solid var(--batya-border, #e7e1db);
    border-radius: 12px;
    background: var(--batya-bg, #faf7f3);
    color: var(--batya-text, #171717);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .bps-mobile-search__quick-item:active {
    background: var(--batya-brand-soft, #fff3e8);
  }

  .bps-mobile-search__quick-text {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 550;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .bps-mobile-search__quick-arrow {
    color: var(--batya-text-soft, #777);
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
  }

  .bps-mobile-search__results {
    display: grid;
    margin: -6px -12px 0;
  }

  .bps-mobile-search__results[hidden],
  .bps-mobile-search__status[hidden],
  .bps-mobile-search__hint[hidden] {
    display: none !important;
  }

  .bps-mobile-search__result {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 8px 12px;
    border-bottom: 1px solid var(--batya-border, #ece7e1);
    color: var(--batya-text, #171717);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .bps-mobile-search__result.is-active,
  .bps-mobile-search__result[aria-selected="true"] {
    background: var(--batya-brand-soft, #fff3e8);
  }

  .bps-mobile-search__result-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 9px;
    background: #fff;
  }

  .bps-mobile-search__result-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .bps-mobile-search__result-body {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  .bps-mobile-search__result-title {
    display: -webkit-box;
    overflow: hidden;
    color: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.23;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .bps-mobile-search__result-lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 8px;
    align-items: end;
    min-width: 0;
  }

  .bps-mobile-search__result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    min-width: 0;
    max-width: 100%;
    color: var(--batya-text-soft, #777);
    font-size: 11.25px;
    line-height: 1.25;
  }

  .bps-mobile-search__result-sku {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bps-mobile-search__result-stock {
    white-space: nowrap;
  }

  .bps-mobile-search__result-stock--instock {
    color: #437144;
  }

  .bps-mobile-search__result-stock--outofstock {
    color: var(--batya-text-soft, #777);
  }

  .bps-mobile-search__result-price {
    min-width: max-content;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    color: var(--batya-text, #171717);
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.12;
    white-space: nowrap;
  }

  .bps-mobile-search__result-price .price {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
  }

  .bps-mobile-search__result-price ins {
    order: 2;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-decoration: none;
  }

  .bps-mobile-search__result-price del {
    order: 1;
    color: var(--batya-text-soft, #888);
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.05;
    opacity: .62;
    text-decoration-thickness: 1px;
  }

  .bps-mobile-search__footer {
    position: relative;
    z-index: 1;
    padding:
      0
      calc(env(safe-area-inset-right, 0px) + 14px)
      calc(env(safe-area-inset-bottom, 0px) + 2px)
      calc(env(safe-area-inset-left, 0px) + 14px);
    border-top: 1px solid var(--batya-border, #e7e1db);
    background: var(--batya-card, #fff);
  }

  .bps-mobile-search__footer[hidden] {
    display: none !important;
  }

  .bps-mobile-search__all {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 0;
    color: var(--batya-text, #171717);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .bps-mobile-search__all:active {
    color: var(--batya-text, #171717);
    opacity: .72;
  }

  .bps-mobile-search__all-arrow {
    flex: 0 0 auto;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
  }

} 

@media (max-width: 380px) {
  .bps-mobile-search__result {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .bps-mobile-search__result-image {
    width: 52px;
    height: 52px;
  }

  .bps-mobile-search__result-lower {
    gap: 6px;
  }

  .bps-mobile-search__result-meta {
    gap: 2px 6px;
  }

  .bps-mobile-search__result-price {
    font-size: 15px;
  }
}

@media (min-width: 992px) {
  .bps-mobile-search {
    display: none !important;
  }
}
