/* Extension hook stylesheet. Add CSS with the veyo_custom_css filter. */

/* Loop / Blocks: the Veyo pill (storefront-cta.css) under the store's Add to cart. */
.veyop-loop-customize-btn.veyop-cta {
  margin-top: 0.5rem;
}

.veyop-loop-actions--blocks {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.veyop-loop-actions--blocks > .wc-block-components-product-button__button,
.veyop-loop-actions--blocks > .veyop-loop-customize-btn {
  margin: 0 !important;
}

/* As wide as the Add to cart above it, not the whole card. */
.veyop-loop-actions--blocks > .veyop-cta {
  width: auto;
  min-width: min(100%, 10rem);
}

.veyop-loop-actions--blocks > .wc-block-components-product-button,
.veyop-loop-actions--blocks > .wc-block-components-product-button .wc-block-components-product-button__button {
  margin: 0 !important;
}

/* Product page: the designer's mount takes its own row above quantity + Add to cart. */
form.cart .veyop-storefront-root,
.woocommerce-variation-add-to-cart .veyop-storefront-root {
  flex: 1 0 100%;
  width: 100%;
}

/* Cart "Edit Design" link: a finger-sized target. The block cart strips inline styles, so it is set here. */
@media (pointer: coarse) {
  .veyop-edit-design {
    display: inline-block;
    padding: 12px 0;
    font-size: max(1em, 14px);
  }
}

/*
 * Block cart on phones: WooCommerce joins item details inline with " / ", so a Veyo line wraps mid-pair
 * ("Text layer:" on one line, "$2.00" on the next) and the tall "Edit Design" target opens a gap.
 * Put each detail on its own line instead. Only Veyo lines (they carry the edit link) are touched.
 */
@media (max-width: 600px) {
  .wc-block-components-product-details:has(.veyop-edit-design) > span {
    display: block;
    overflow-wrap: anywhere;
  }
  .wc-block-components-product-details:has(.veyop-edit-design) > span > [aria-hidden="true"] {
    display: none;
  }
  .wc-block-components-product-details:has(.veyop-edit-design) .veyop-edit-design {
    padding: 8px 0;
  }
}
