/* Reserve the basket area while Bitrix renders its client-side rows. */
@media (max-width: 767px) {
  #basket-root { min-height: 850px; }
  #basket-root .basket-items-list .basket-item-block-image { min-height: 160px; }
}
/* On phones show the products before the coupon and total. */
@media (max-width: 767px) {
  #basket-root { display: flex; flex-direction: column; }
  #basket-root > .row:nth-child(2) { order: 0; }
  #basket-root > .row:nth-child(3) { order: 1; }
  #basket-root > .row:first-child { order: 2; }
}
/* Give the mobile basket and search controls finger-sized active areas. */
@media (max-width: 767px) {
  #mobileheader .wrap_icon > a.basket-link,
  #mobileheader .wrap_icon > button.inline-search-show {
    display: flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px;
  }
}
@media (max-width: 767px) {
  .catalog_detail .bottom_slider .flexslider.loading_state > ul.tabs_slider.EXPANDABLES_slides {
    overflow: hidden;
  }
}
/* IMOU stage-only candidate: reuse the existing Bitrix total and checkout button. */
@media screen and (max-width: 599px) {
  #basket-root { box-sizing: border-box; padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  #basket-root .basket-checkout-container.visible .basket-checkout-section { position: fixed !important; left: 0; right: 0; bottom: 0; z-index: 1000; box-sizing: border-box; width: 100%; min-width: 0; margin: 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #e5e5e5; background: #fff; box-shadow: 0 -3px 12px rgba(0, 0, 0, .08); }
  #basket-root .basket-checkout-container.visible .basket-checkout-section-inner { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); grid-template-rows: auto auto; align-items: center; column-gap: 8px; flex-wrap: nowrap !important; }
  #basket-root .basket-checkout-container.visible .basket-checkout-block-total { grid-column: 1; grid-row: 1; min-width: 0; padding: 0; text-align: left; }
  #basket-root .basket-checkout-container.visible .basket-checkout-block-total-title { font-size: 12px; line-height: 15px; }
  #basket-root .basket-checkout-container.visible .basket-checkout-block-total-description { font-size: 12px; line-height: 14px; }
  #basket-root .basket-checkout-container.visible .basket-checkout-block-total-price { grid-column: 1; grid-row: 2; min-width: 0; padding: 0; text-align: left; }
  #basket-root .basket-checkout-container.visible .basket-checkout-block-total-price-inner { display: block; padding: 0; text-align: left; }
  #basket-root .basket-checkout-container.visible .basket-coupon-block-total-price-current { margin: 0; font-size: clamp(16px, 5vw, 22px); line-height: 26px; text-align: left; }
  #basket-root .basket-checkout-container.visible .basket-checkout-block-btn { grid-column: 2; grid-row: 1 / span 2; min-width: 0; max-width: none; width: auto; padding: 0; text-align: right; }
  #basket-root .basket-checkout-container.visible .basket-btn-checkout { box-sizing: border-box; width: 100%; min-height: 48px; margin: 0; padding: 9px 8px; font-size: 14px; line-height: 1.25; white-space: normal; }
}
@supports selector(:has(*)) { @media screen and (max-width: 599px) { #basket-root:has(.basket-coupon-section input:focus) .basket-checkout-section { visibility: hidden; pointer-events: none; } } }

@media (max-width: 991px) {
  #mobileheader .logo {
    max-width: clamp(108px, 24vw, 132px);
  }

  #mobileheader .right-icons {
    margin-left: 0;
    padding-right: 8px;
  }

  #mobileheader .right-icons .wrap_icon {
    padding-right: 0;
    padding-left: 0;
  }

  #mobileheader .wrap_icon > a.basket-link,
  #mobileheader .wrap_icon > a.personal-link,
  #mobileheader .wrap_icon > button.inline-search-show,
  #mobileheader .wrap_phones > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    line-height: 1;
    vertical-align: middle;
  }

  #mobileheader .wrap_icon > button.inline-search-show {
    top: 0;
  }

  #mobileheader .wrap_basket .basket-link > .js-basket-block > .count {
    top: 1px;
    right: 1px;
    bottom: auto;
    left: auto;
    min-width: 18px;
    width: auto;
    height: 18px;
    padding: 0 4px;
    line-height: 18px;
  }
}
