/* Mobile category indexes and Available Jewelry archives.
 * Layered important rules override the separate legacy slide snippets.
 * Gallery artwork pages retain the approved mobile-flow.css layout. */
@layer an-category-mobile-flow {
  @media (max-width:782px) {
    /* Match the accepted Gallery hierarchy on the shop landing and archives. */
    .an-shop-index .an-shop-index-title,
    main.an-category-catalog :is(.store-catalog-title, .an-catalog-mobile-category) {
      font-family:inherit!important;
      font-size:18px!important;
      font-weight:400!important;
      line-height:1.3!important;
      letter-spacing:normal!important;
      word-break:normal!important;
      overflow-wrap:normal!important;
    }
    .an-shop-index .an-shop-index-title {
      margin-bottom:24px!important;
    }
    main.an-category-catalog :is(.an-catalog-back-link, .an-catalog-category-nav a) {
      font-size:13px!important;
      line-height:1.3!important;
      min-height:44px!important;
    }
    main.an-category-catalog .an-catalog-empty p {
      font-size:14px!important;
      line-height:1.5!important;
    }
    html:has(.an-gallery-index, .an-shop-index, main.an-category-catalog),
    body:has(.an-gallery-index, .an-shop-index, main.an-category-catalog) {
      scroll-snap-type:none!important;
      scroll-padding:0!important;
      scroll-behavior:auto!important;
    }
    body:has(.an-gallery-index, .an-shop-index, main.an-category-catalog) :is(
      .wp-site-blocks, .an-catalog-snap-root, main, .an-gallery-index, .an-gallery-index *,
      .an-shop-index, .an-shop-index *, main.an-category-catalog *,
      footer, footer *
    ) {
      scroll-snap-type:none!important;
      scroll-snap-align:none!important;
      scroll-snap-stop:normal!important;
      scroll-margin:0!important;
    }
    :is(.an-gallery-index, .an-shop-index) :is(
      .an-gallery-index-home, .an-gallery-index-next,
      .an-shop-index-home, .an-shop-index-next
    ),
    main.an-category-catalog :is(
      .an-catalog-home, .an-catalog-next, .an-catalog-row-nav,
      .an-catalog-back-link > [aria-hidden="true"],
      .an-catalog-piece-link > [aria-hidden="true"]
    ) {
      display:none!important;
    }
    :is(.an-gallery-index, .an-shop-index) {
      min-height:0!important;
      padding-bottom:32px!important;
    }
    :is(.an-gallery-index-pair, .an-shop-index-pair) {
      height:auto!important;
      min-height:0!important;
      max-height:none!important;
    }

    main.an-category-catalog {
      min-height:0!important;
      padding-bottom:40px!important;
    }
    main.an-category-catalog :is(.an-catalog-navigation, .an-catalog-back-nav) {
      position:static!important;
      inset:auto!important;
    }
    main.an-category-catalog .an-catalog-collection {
      clip-path:none!important;
    }
    main.an-category-catalog .an-catalog-products {
      row-gap:40px!important;
    }
    main.an-category-catalog .an-catalog-products > li {
      height:auto!important;
      min-height:0!important;
      max-height:none!important;
      padding:0!important;
      justify-content:flex-start!important;
    }
    main.an-category-catalog .an-catalog-product-image {
      flex:0 0 auto!important;
      height:clamp(240px,80vw,460px)!important;
      min-height:0!important;
      max-height:none!important;
    }
  }
  @media (max-width:599px) {
    :is(.an-gallery-index-pair, .an-shop-index-pair) {
      grid-template-rows:auto auto!important;
      gap:24px!important;
      padding:0!important;
      margin:0 0 24px!important;
    }
    :is(.an-gallery-index-card, .an-shop-index-card) {
      height:auto!important;
    }
  }
}
