/**
 * Aviv theme — mobile override.
 *
 * Turns two home-page rails into static 2-column grids on mobile
 * (no horizontal slider, no autoplay/marquee motion):
 *
 *  1. .quick-category-band  → .category-runway
 *  2. section.home-catalog-slider.home-deals-shelf.track-slider
 *     (the "cycle" marquee that .home-catalog-slider__viewport /
 *     __track / __cycle drive via assets/js/modules/carousels.js)
 *
 * Loaded AFTER assets/scss-refactor/main.css (see inc/assets.php),
 * so every rule below only needs !important to stay authoritative
 * against the compiled stylesheet regardless of source order.
 *
 * Breakpoint matches the theme's own mobile threshold used
 * throughout 05-sections/*.scss and 90-migration/_legacy-map.scss.
 */

@media (max-width: 700px) {

  /* ---------------------------------------------------------------
   * 1) quick-category-band — .category-runway → 2-column grid
   * --------------------------------------------------------------- */

  body[data-page="home"] .category-runway {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    grid-auto-columns: unset !important;
    width: 100% !important;
    max-width: none !important;
    gap: 24px 14px !important;
    overflow: visible !important;
    overflow-x: visible !important;
    scroll-snap-type: none !important;
    scroll-padding-inline: 0 !important;
    scrollbar-width: auto !important;
    padding: 0 !important;
  }

  body[data-page="home"] .category-runway__item {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none !important;
    scroll-snap-align: none !important;
  }

  body[data-page="home"] .category-runway__item > span {
    width: min(148px, 68%) !important;
    margin-inline: auto !important;
  }

  /* ---------------------------------------------------------------
   * 2) home-catalog-slider / home-deals-shelf — 2-column grid
   * --------------------------------------------------------------- */

  /* No slider on mobile: hide the prev/next controls entirely. */
  body[data-page="home"] .home-catalog-slider.home-deals-shelf.track-slider .track-slider__controls {
    display: none !important;
  }

  body[data-page="home"] .home-catalog-slider__carousel,
  body[data-page="home"] .home-catalog-slider__viewport {
    overflow: visible !important;
  }

  /* The track is the element the marquee JS animates via
     translate3d(); collapsing it to a plain block with no transform
     kills the sliding motion outright (inline styles set by JS lose
     to an !important rule in an external sheet). */
  body[data-page="home"] .home-catalog-slider__track {
    display: block !important;
    width: 100% !important;
    transform: none !important;
    direction: rtl !important;
  }

  /* carousels.js clones the whole cycle into the track for the
     infinite-marquee illusion (element carries data-catalog-clone).
     Hide that clone so products are never duplicated in the grid. */
  body[data-page="home"] .home-catalog-slider__track [data-catalog-clone] {
    display: none !important;
  }

  body[data-page="home"] .home-catalog-slider__cycle {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 14px !important;
    flex-wrap: unset !important;
    direction: rtl !important;
  }

  body[data-page="home"] .home-catalog-slider__cycle > .product-card {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    inline-size: 100% !important;
  }
}
