/*
 * Podil Food mobile homepage, stage 01B.
 *
 * This file is intentionally scoped to body.common-home on small screens.
 * It does not style checkout, cart, account pages, product data, desktop
 * layouts, footer contents, or Syrve-related elements.
 */
@media (max-width: 767.98px) {
  body.common-home #common-home {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 16px 76px !important;
    overflow: hidden !important;
  }

  body.common-home #common-home > .row {
    margin: 0 !important;
  }

  body.common-home #common-home #content {
    float: none !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 10px 0 0 !important;
  }

  /*
   * The page does not need the generic “Категорії” heading. The existing
   * “Показати всі” control remains available in a compact right-aligned row.
   */
  body.common-home #content > .heading {
    display: block !important;
    min-height: 30px !important;
    margin: 0 0 4px !important;
  }

  body.common-home #content > .heading .heading__top {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    min-height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.common-home #content > .heading .heading__title {
    display: none !important;
  }

  body.common-home #content > .heading .category-show-all-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin: 0 !important;
  }

  body.common-home #content > .heading .category-show-all-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    min-height: 30px !important;
    margin: 0 !important;
    padding: 6px 12px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: #f69029 !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 18px !important;
    white-space: nowrap !important;
    box-shadow: none !important;
  }

  /*
   * Kitchens use one consistent mobile scale. Swiper still owns the slide
   * widths and the existing “show all / hide” JavaScript remains untouched.
   */
  body.common-home #category_top.category-carousel {
    width: 100% !important;
    margin: 0 0 12px !important;
    padding: 4px 0 8px !important;
    overflow: hidden !important;
  }

  body.common-home #category_top .category-carousel__wrapper {
    align-items: flex-start !important;
  }

  body.common-home #category_top .item-category {
    gap: 6px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 2px !important;
  }

  body.common-home #category_top .item-category__link:first-child {
    flex: 0 0 68px !important;
    width: 68px !important;
    height: 68px !important;
    margin: 0 auto !important;
    border: 1px solid rgba(21, 21, 21, 0.08) !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12) !important;
    overflow: hidden !important;
  }

  body.common-home #category_top .item-category__image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    border-radius: 50% !important;
    object-fit: cover !important;
  }

  body.common-home #category_top .item-category__name,
  body.common-home #category_top .item-category__name a {
    display: block !important;
    width: 100% !important;
    max-width: 94px !important;
    margin: 0 auto !important;
    color: #151515 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 15px !important;
    letter-spacing: -0.01em !important;
    text-align: center !important;
    overflow-wrap: anywhere !important;
  }

  body.common-home #category_top .category-pagination {
    min-height: 6px !important;
    margin: 8px 0 0 !important;
    gap: 5px !important;
  }

  body.common-home #category_top .category-pagination .swiper-pagination-bullet {
    width: 6px !important;
    height: 6px !important;
    margin: 0 !important;
  }

  body.common-home #category_top.is-show-all {
    overflow: visible !important;
  }

  body.common-home #category_top.is-show-all .category-carousel__wrapper {
    gap: 16px 8px !important;
  }

  /*
   * The current OpenCart carousel contains a 130×100 px manufacturer logo.
   * It must never be stretched to a 343×139 banner. The slide is therefore a
   * compact fixed-height card and the source image keeps its own proportions.
   */
  body.common-home .carousel-advertising {
    width: 100% !important;
    height: 112px !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    border: 1px solid rgba(21, 21, 21, 0.08) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06) !important;
    overflow: hidden !important;
  }

  body.common-home .carousel-advertising .swiper-container,
  body.common-home .carousel-advertising .swiper-wrapper,
  body.common-home .carousel-advertising .swiper-slide {
    height: 110px !important;
    min-height: 110px !important;
  }

  body.common-home .carousel-advertising .swiper-slide {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    aspect-ratio: auto !important;
    padding: 8px 12px !important;
    background: #ffffff !important;
  }

  body.common-home .carousel-advertising .swiper-slide > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
  }

  body.common-home .carousel-advertising .swiper-slide img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: min(80%, 180px) !important;
    max-height: 92px !important;
    margin: 0 auto !important;
    object-fit: contain !important;
  }

  body.common-home .carousel-advertising .swiper-pager {
    display: none !important;
  }

  body.common-home .carousel-advertising .swiper-pagination {
    bottom: 5px !important;
  }

  body.common-home .carousel-advertising .swiper-slide:only-child ~ *,
  body.common-home .carousel-advertising:has(.swiper-slide:only-child) > .swiper-pagination {
    display: none !important;
  }

  body.common-home .home_bottom {
    margin-top: 16px !important;
  }

  body.common-home footer.footer {
    padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 359.98px) {
  body.common-home #common-home {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }

  body.common-home #category_top .item-category__link:first-child {
    width: 64px !important;
    height: 64px !important;
    flex-basis: 64px !important;
  }

  body.common-home .carousel-advertising {
    height: 104px !important;
  }

  body.common-home .carousel-advertising .swiper-container,
  body.common-home .carousel-advertising .swiper-wrapper,
  body.common-home .carousel-advertising .swiper-slide {
    height: 102px !important;
    min-height: 102px !important;
  }

  body.common-home .carousel-advertising .swiper-slide img {
    max-height: 84px !important;
  }
}
