/* These rules affect only instances of the shared New in the store block. */
.af-new-in-store {
  box-sizing: border-box;
  padding: clamp(3rem, 7vw, 5.5rem) var(--ag-gutter, clamp(1rem, 4vw, 3rem));
  background: var(--af-background, #f3f6f7);
}
.af-new-in-store__inner { max-width: var(--ag-container, 82rem); margin-inline: auto; }
.af-new-in-store__heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.af-new-in-store__heading h2 { color: var(--af-ocean, #073f57); font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.1; margin: .35rem 0 0; }
.af-new-in-store__label { color: var(--af-primary, #0d7379); text-transform: none; font-size: .78rem; font-weight: 800; letter-spacing: .13em; margin: 0; }
.af-new-in-store__heading > a { color: var(--af-primary, #0d7379); font-weight: 700; }
.af-new-in-store .woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(var(--af-new-columns, 4), minmax(0, 1fr)) !important;
  gap: 1rem !important;
  margin: 0;
  padding: 0;
}
.af-new-in-store .woocommerce ul.products::before,
.af-new-in-store .woocommerce ul.products::after { display: none; }
.af-new-in-store .woocommerce ul.products li.product {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* Override WooCommerce's percentage widths and mobile float spacing. */
  width: 100% !important;
  max-width: none;
  justify-self: stretch;
  margin: 0 !important;
  padding: .75rem;
  background: var(--af-surface, white);
  border: 1px solid var(--af-card-border, #d8e2e6);
  border-radius: .45rem;
  float: none !important;
}
.af-new-in-store .woocommerce ul.products li.product .woocommerce-LoopProduct-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.af-new-in-store .woocommerce ul.products li.product .woocommerce-LoopProduct-link img { width: 100%; aspect-ratio: 1; object-fit: contain; height: auto; }
.af-new-in-store .woocommerce ul.products li.product .price { margin-top: auto; padding-top: .5rem; }
.af-new-in-store .woocommerce ul.products li.product > .button {
  box-sizing: border-box;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 3rem;
  width: 100%;
  margin: 1rem 0 0;
  padding: .7rem 1rem;
  line-height: 1.25;
  text-align: center;
}
@media (max-width: 900px) {
  .af-new-in-store .woocommerce ul.products { grid-template-columns: repeat(min(var(--af-new-columns, 4), 2), minmax(0, 1fr)) !important; }
}
@media (max-width: 767px) {
  .af-new-in-store .woocommerce ul.products { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 767px) {
  .af-new-in-store .woocommerce ul.products li.product .woocommerce-LoopProduct-link img {
    /* Reserve a compact area even before lazy-loaded images resolve. */
    aspect-ratio: auto;
    height: clamp(180px, 60vw, 260px);
    object-fit: contain;
    object-position: center bottom;
    margin-bottom: .5rem;
  }
  .af-new-in-store .woocommerce ul.products li.product .woocommerce-loop-product__title {
    padding-block: .25rem .5rem;
  }
}

/* The successful add button itself becomes the cart link. */
.af-new-in-store a.added_to_cart { display: none !important; }
.af-new-in-store .button.af-cart-ready::after { display: none; }

.af-new-in-store .button.af-cart-loading {
  opacity: 1;
  cursor: progress;
}
.af-new-in-store .button.af-cart-loading::after { display: none; }
.af-new-in-store .af-cart-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  box-sizing: border-box;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: af-cart-spin .7s linear infinite;
}
@keyframes af-cart-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .af-new-in-store .af-cart-spinner { animation-duration: 2s; }
}
