/*
 * SoldDolls catalogue visual unification — R2C41.16.6.5.6
 * Scope: product-grid arrangement + small "Plus" links only.
 * The product-card component itself is untouched: image, title, stars, price,
 * badges and spacing continue to come from product-card-global.css.
 * The explicit desktop list view (.sd-view-card) is deliberately excluded.
 */

/* SeekHeart-like "Plus" treatment: small, discreet and aligned with the tabs. */
@media (min-width: 900px) {
  html body.sd-category-level-main .sd-main-cat-sections .sd-product-structure-tabs-wrap {
    position: relative !important;
    padding-right: 58px !important;
  }

  html body.sd-category-level-main .sd-main-cat-sections .sd-product-structure-more {
    position: absolute !important;
    top: 50% !important;
    right: 0 !important;
    transform: translateY(-50%) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    min-height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(255,255,255,.72) !important;
    -webkit-text-fill-color: rgba(255,255,255,.72) !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    text-decoration: underline !important;
    text-decoration-thickness: 1px !important;
    text-underline-offset: 2px !important;
    white-space: nowrap !important;
    opacity: 1 !important;
  }

  html body.sd-category-level-main .sd-main-cat-sections .sd-product-structure-more:hover,
  html body.sd-category-level-main .sd-main-cat-sections .sd-product-structure-more:focus-visible {
    color: var(--sd-ux-blue-on-dark, #7fa7ff) !important;
    -webkit-text-fill-color: var(--sd-ux-blue-on-dark, #7fa7ff) !important;
    background: transparent !important;
    outline-color: var(--sd-ux-blue-on-dark, #7fa7ff) !important;
  }

  /* Home product-section CTA: same visual weight as SeekHeart's discreet "Plus". */
  html body.home .sd-home-v3 .sd-v3-products .sd-v3-text-link,
  html body.front-page .sd-home-v3 .sd-v3-products .sd-v3-text-link {
    position: absolute !important;
    top: -1px !important;
    right: 0 !important;
    min-height: 24px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: rgba(255,255,255,.72) !important;
    -webkit-text-fill-color: rgba(255,255,255,.72) !important;
    font-size: 0 !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    opacity: 1 !important;
  }

  html body.home .sd-home-v3 .sd-v3-products .sd-v3-text-link::after,
  html body.front-page .sd-home-v3 .sd-v3-products .sd-v3-text-link::after {
    content: "Plus" !important;
    display: block !important;
    color: inherit !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    text-decoration: underline !important;
    text-decoration-thickness: 1px !important;
    text-underline-offset: 2px !important;
    white-space: nowrap !important;
  }

  html body.home .sd-home-v3 .sd-v3-products .sd-v3-text-link:hover,
  html body.home .sd-home-v3 .sd-v3-products .sd-v3-text-link:focus-visible,
  html body.front-page .sd-home-v3 .sd-v3-products .sd-v3-text-link:hover,
  html body.front-page .sd-home-v3 .sd-v3-products .sd-v3-text-link:focus-visible {
    color: var(--sd-ux-blue-on-dark, #7fa7ff) !important;
    -webkit-text-fill-color: var(--sd-ux-blue-on-dark, #7fa7ff) !important;
    background: transparent !important;
    transform: none !important;
    outline-color: var(--sd-ux-blue-on-dark, #7fa7ff) !important;
  }
}

/*
 * One standard product grid everywhere.
 * Reference = the ACTUAL validated home grid, not only its column count:
 * - same effective desktop width as .container (1300px including 24px side padding => 1252px content)
 * - same 4-column / 2-column breakpoints
 * - same 18px desktop/tablet gap and 9px small-mobile gap
 * The explicit SeekHeart desktop LIST view (.sd-view-card) remains excluded.
 */

/* Keep all normal product grids on the same effective width as the home grid. */
html body .products-grid,
html body ul.products,
html body.sd-category-level-main .sd-product-structure-products.products {
  max-width: 1252px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

@media (min-width: 981px) {
  html body :not(.sd-view-card) > .products-grid,
  html body :not(.sd-view-card) > ul.products,
  html body.woocommerce.tax-product_cat .shop-main:not(.sd-view-card) > .products-grid,
  html body.woocommerce.tax-product_cat .shop-main:not(.sd-view-card) > ul.products,
  html body.sd-category-level-main .sd-main-cat-sections .sd-product-structure-products.products {
    display: grid !important;
    width: min(100%, 1252px) !important;
    max-width: 1252px !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
    align-items: start !important;
    justify-self: center !important;
  }

  /* Category desktop had its own 12/14px gap and a wider 1440px container.
     Override those category-only rules so its cards are genuinely the same size as home. */
  html body.sd-category-level-sub .shop-main:not(.sd-view-card) > .products-grid,
  html body.sd-category-level-sub .shop-main:not(.sd-view-card) > ul.products {
    margin-top: 2px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media (min-width: 641px) and (max-width: 980px) {
  html body :not(.sd-view-card) > .products-grid,
  html body :not(.sd-view-card) > ul.products,
  html body.woocommerce.tax-product_cat .shop-main:not(.sd-view-card) > .products-grid,
  html body.woocommerce.tax-product_cat .shop-main:not(.sd-view-card) > ul.products,
  html body.sd-category-level-main .sd-main-cat-sections .sd-product-structure-products.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
    align-items: start !important;
  }
}

@media (max-width: 640px) {
  html body :not(.sd-view-card) > .products-grid,
  html body :not(.sd-view-card) > ul.products,
  html body.woocommerce.tax-product_cat .shop-main:not(.sd-view-card) > .products-grid,
  html body.woocommerce.tax-product_cat .shop-main:not(.sd-view-card) > ul.products,
  html body.sd-category-level-main .sd-main-cat-sections .sd-product-structure-products.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    align-items: start !important;
  }
}

/*
 * Exact home-width parity on WooCommerce product categories.
 * The category archive container is intentionally narrower than the home
 * container on desktop (40px narrower from 900–1180, 64px narrower above).
 * A max-width alone cannot enlarge a child beyond that parent, which is why
 * the previous 5.5 still produced visibly smaller cards.  Expand only the
 * PRODUCT GRID back to the same effective home width and keep it centered.
 * No product-card dimensions or typography are changed here.
 */
@media (min-width: 900px) and (max-width: 1180px) {
  html body.woocommerce.tax-product_cat .shop-main:not(.sd-view-card) > .products-grid,
  html body.woocommerce.tax-product_cat .shop-main:not(.sd-view-card) > ul.products,
  html body.woocommerce.tax-product_cat.sd-category-level-main .sd-main-cat-sections .sd-product-structure-products.products {
    position: relative !important;
    left: 50% !important;
    width: calc(100% + 40px) !important;
    max-width: 1252px !important;
    transform: translateX(-50%) !important;
  }
}

@media (min-width: 1181px) {
  html body.woocommerce.tax-product_cat .shop-main:not(.sd-view-card) > .products-grid,
  html body.woocommerce.tax-product_cat .shop-main:not(.sd-view-card) > ul.products,
  html body.woocommerce.tax-product_cat.sd-category-level-main .sd-main-cat-sections .sd-product-structure-products.products {
    position: relative !important;
    left: 50% !important;
    width: calc(100% + 64px) !important;
    max-width: 1252px !important;
    transform: translateX(-50%) !important;
  }
}

