/* Rosaifa 4.14.16 — mobile Shop category rail: always show two complete cards. */

@media (max-width: 760px) {
  .post-type-archive-product .rf-archive-subcats,
  .tax-product_cat .rf-archive-subcats,
  .tax-product_tag .rf-archive-subcats {
    box-sizing: border-box !important;
    display: flex !important;
    gap: 10px !important;
    margin: 0 !important;
    overflow-x: auto !important;
    padding: 0 0 8px !important;
    scroll-padding-inline: 0 !important;
    scroll-snap-type: x proximity;
    width: 100% !important;
  }

  .post-type-archive-product .rf-archive-subcat,
  .tax-product_cat .rf-archive-subcat,
  .tax-product_tag .rf-archive-subcat {
    align-content: center !important;
    box-sizing: border-box !important;
    flex: 0 0 calc((100% - 10px) / 2) !important;
    grid-template-columns: 58px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    height: 92px !important;
    max-height: 92px !important;
    min-height: 92px !important;
    min-width: 0 !important;
    padding-right: 6px !important;
    scroll-snap-align: start;
  }

  .post-type-archive-product .rf-archive-subcat > span,
  .tax-product_cat .rf-archive-subcat > span,
  .tax-product_tag .rf-archive-subcat > span {
    align-self: stretch !important;
    height: 92px !important;
    min-width: 0 !important;
    width: 58px !important;
  }

  .post-type-archive-product .rf-archive-subcat img,
  .tax-product_cat .rf-archive-subcat img,
  .tax-product_tag .rf-archive-subcat img {
    display: block !important;
    height: 100% !important;
    object-fit: cover !important;
    width: 100% !important;
  }

  .post-type-archive-product .rf-archive-subcat strong,
  .tax-product_cat .rf-archive-subcat strong,
  .tax-product_tag .rf-archive-subcat strong {
    align-self: end !important;
    font-size: 11px !important;
    hyphens: none !important;
    line-height: 1.15 !important;
    min-width: 0 !important;
    overflow-wrap: normal !important;
    padding: 0 4px 3px 8px !important;
    word-break: normal !important;
  }

  .post-type-archive-product .rf-archive-subcat small,
  .tax-product_cat .rf-archive-subcat small,
  .tax-product_tag .rf-archive-subcat small {
    align-self: start !important;
    font-size: 8.5px !important;
    line-height: 1.2 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    padding: 0 4px 0 8px !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Keep Filters and Recommended visually balanced and centered. */
  .post-type-archive-product .rf-p5-shop-toolbar .rf-p5-head-actions,
  .tax-product_cat .rf-p5-shop-toolbar .rf-p5-head-actions,
  .tax-product_tag .rf-p5-shop-toolbar .rf-p5-head-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .post-type-archive-product .rf-p5-shop-toolbar .rf-p5-filter-open,
  .tax-product_cat .rf-p5-shop-toolbar .rf-p5-filter-open,
  .tax-product_tag .rf-p5-shop-toolbar .rf-p5-filter-open,
  .post-type-archive-product .rf-p5-shop-toolbar .rf-p5-sort-control select,
  .tax-product_cat .rf-p5-shop-toolbar .rf-p5-sort-control select,
  .tax-product_tag .rf-p5-shop-toolbar .rf-p5-sort-control select {
    box-sizing: border-box !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .post-type-archive-product .rf-p5-shop-toolbar .rf-p5-filter-open,
  .tax-product_cat .rf-p5-shop-toolbar .rf-p5-filter-open,
  .tax-product_tag .rf-p5-shop-toolbar .rf-p5-filter-open {
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .post-type-archive-product .rf-p5-shop-toolbar .rf-p5-sort-control select,
  .tax-product_cat .rf-p5-shop-toolbar .rf-p5-sort-control select,
  .tax-product_tag .rf-p5-shop-toolbar .rf-p5-sort-control select {
    font-size: 13px !important;
    padding-left: 10px !important;
    padding-right: 28px !important;
    text-align: center !important;
    text-align-last: center !important;
  }
}

@media (max-width: 380px) {
  .post-type-archive-product .rf-archive-subcat,
  .tax-product_cat .rf-archive-subcat,
  .tax-product_tag .rf-archive-subcat {
    grid-template-columns: 52px minmax(0, 1fr) !important;
    height: 88px !important;
    max-height: 88px !important;
    min-height: 88px !important;
  }

  .post-type-archive-product .rf-archive-subcat > span,
  .tax-product_cat .rf-archive-subcat > span,
  .tax-product_tag .rf-archive-subcat > span {
    height: 88px !important;
    width: 52px !important;
  }

  .post-type-archive-product .rf-archive-subcat strong,
  .tax-product_cat .rf-archive-subcat strong,
  .tax-product_tag .rf-archive-subcat strong {
    font-size: 10.5px !important;
  }

  .post-type-archive-product .rf-p5-shop-toolbar .rf-p5-sort-control select,
  .tax-product_cat .rf-p5-shop-toolbar .rf-p5-sort-control select,
  .tax-product_tag .rf-p5-shop-toolbar .rf-p5-sort-control select {
    font-size: 12px !important;
  }
}
