:root {
  --apex-product-canvas: #fff;
  --apex-product-canvas-line: #d8d5cf;
  --apex-product-meta-canvas: #f5f4f1;
  --apex-product-meta-text: #4f4a46;
  --apex-product-meta-accent: #ad2730;
  --apex-tools-canvas: #fff;
}

/* Manufacturer product photography belongs on a neutral studio canvas. */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap {
  border-bottom-color: var(--apex-product-canvas-line) !important;
  background: var(--apex-product-meta-canvas) !important;
  background-image: none !important;
}

.woocommerce ul.products li.product .woocommerce-LoopProduct-link img,
.woocommerce ul.products li.product a img,
.woocommerce ul.products li.product img:first-of-type,
.woocommerce-page ul.products li.product img,
.wc-block-grid__product-image,
.wc-block-grid__product-image img,
.wc-block-components-product-image,
.wc-block-components-product-image img {
  border-bottom-color: var(--apex-product-canvas-line) !important;
  background: var(--apex-product-canvas) !important;
  background-image: none !important;
}

/* Keep the information beneath each image compact and legible on the light canvas. */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap > .woocommerce-LoopProduct-link,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap > .woocommerce-LoopProduct-link {
  display: grid !important;
  grid-template-areas:
    "image image"
    "category actions"
    "delivery actions";
  grid-template-columns: minmax(0, 1fr) max-content;
  background: var(--apex-product-meta-canvas) !important;
  color: var(--apex-product-meta-text) !important;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap > .woocommerce-LoopProduct-link > img,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap > .woocommerce-LoopProduct-link > img {
  grid-area: image;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-grid-cat,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-grid-cat {
  grid-area: category;
  align-self: end;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 13px 0 0 16px !important;
  color: var(--apex-product-meta-accent) !important;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-free-delivery-badge,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-free-delivery-badge {
  grid-area: delivery;
  align-self: start;
  min-width: 0;
  margin: 5px 0 13px 16px !important;
  color: var(--apex-product-meta-text) !important;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-free-delivery-badge > span,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-free-delivery-badge > span {
  color: var(--apex-product-meta-text) !important;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-free-delivery-badge .apex-delivery-icon,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-free-delivery-badge .apex-delivery-icon {
  color: var(--apex-product-meta-accent) !important;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tools-card-actions,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tools-card-actions {
  grid-area: actions;
  align-self: center;
  width: auto !important;
  margin: 0 !important;
  padding: 11px 13px 11px 10px !important;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tool-control,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tool-control {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  border-color: #2d2c2b !important;
  background: #171718 !important;
  color: #f7f5f1 !important;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tool-control:hover,
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tool-control:focus-visible,
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tool-control[aria-pressed="true"],
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tool-control:hover,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tool-control:focus-visible,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tool-control[aria-pressed="true"] {
  border-color: #ad2730 !important;
  background: #ad2730 !important;
  color: #fff !important;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tool-control:focus-visible,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tool-control:focus-visible {
  outline: 2px solid #171718 !important;
  outline-offset: 2px !important;
}

body.single-product.woocommerce div.product .woocommerce-product-gallery,
body.single-product.woocommerce div.product .woocommerce-product-gallery .flex-viewport,
body.single-product.woocommerce div.product .woocommerce-product-gallery__wrapper,
body.single-product.woocommerce div.product .woocommerce-product-gallery__image,
body.single-product.woocommerce div.product .woocommerce-product-gallery__image > a,
body.single-product.woocommerce div.product .woocommerce-product-gallery__image img,
body.single-product.woocommerce div.product .woocommerce-product-gallery img.zoomImg {
  background: var(--apex-product-canvas) !important;
  background-image: none !important;
}

body.single-product.woocommerce div.product .flex-control-thumbs li,
body.single-product.woocommerce div.product .flex-control-thumbs img,
body.single-product.woocommerce div.product .flex-control-thumbs img.flex-active {
  background: var(--apex-product-canvas) !important;
  background-image: none !important;
}

.apex-saved-product__image,
.apex-saved-product__image img,
.apex-compare-product-head img,
.apex-compare-mobile-product__image,
.apex-compare-mobile-product__image img,
.woocommerce-cart-form__cart-item .product-thumbnail,
.woocommerce-cart-form__cart-item .product-thumbnail img,
.woocommerce-checkout-review-order-table .product-name img {
  background: var(--apex-product-canvas) !important;
  background-image: none !important;
}

.apex-advisor-result-card__image,
.apex-advisor-result-card__image img,
.apex-builder-selected-product > a,
.apex-builder-selected-product > a img,
.apex-builder-search-results img {
  background: var(--apex-product-canvas) !important;
  background-image: none !important;
}

@media (max-width: 600px) {
  /* The advisor remains available without covering product copy or competing with a second floating control. */
  #ast-scroll-top {
    display: none !important;
  }

  .apex-advisor-launch {
    right: 12px !important;
    bottom: 16px !important;
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
  }

  .apex-advisor-launch > span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
  }

  .woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-grid-cat,
  .woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-grid-cat {
    padding-top: 11px !important;
    padding-left: 12px !important;
  }

  .woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-free-delivery-badge,
  .woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-free-delivery-badge {
    gap: 5px;
    margin: 4px 0 11px 12px !important;
    font-size: 10px !important;
  }

  .woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tools-card-actions,
  .woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tools-card-actions {
    gap: 6px;
    padding: 9px 9px 9px 6px !important;
  }

  .woocommerce ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tool-control,
  .woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap .apex-shop-tool-control {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
  }
}
