/* Rosaifa 4.14.10 — mobile Shop category-card refinement.
   Keeps archive navigation compact, equal-height and readable without changing links or category data. */

@media (max-width: 680px) {
  .post-type-archive-product .rf-archive-subcats,
  .tax-product_cat .rf-archive-subcats,
  .tax-product_tag .rf-archive-subcats {
    align-items: stretch !important;
    gap: 10px !important;
    margin: 0 -20px 12px !important;
    padding: 0 20px 8px !important;
    scroll-padding-inline: 20px;
  }

  .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;
    flex: 0 0 clamp(178px, 48vw, 194px) !important;
    grid-template-columns: 70px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    height: 96px !important;
    max-height: 96px !important;
    min-height: 96px !important;
    min-width: 0;
    padding-right: 10px !important;
  }

  .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;
    height: 96px !important;
    min-width: 0;
    width: 70px !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;
    height: 100% !important;
    object-fit: cover;
    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: 12px !important;
    hyphens: none;
    line-height: 1.16 !important;
    min-width: 0;
    overflow-wrap: normal !important;
    padding: 0 8px 3px 10px !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: 9px !important;
    line-height: 1.2 !important;
    min-width: 0;
    overflow: hidden;
    padding: 0 8px 0 10px !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

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

  .post-type-archive-product .rf-archive-subcat > span,
  .tax-product_cat .rf-archive-subcat > span,
  .tax-product_tag .rf-archive-subcat > span {
    width: 66px !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: 11.5px !important;
  }
}
