/*
 * Single product buy row (simple products), see inc/product-buy-now-button.php:
 * "Quantity" caption / [−1+] + total weight / [Add to cart (outline, cart icon) | Buy now (solid)].
 * Flex order + a zero-height line break (::after) put the two buttons on their own row, half each.
 */

.single-product .summary form.cart:not(.variations_form) .quantity-caption {
  flex: 1 1 100%;
  margin: 0 0 calc(-1 * var(--space-1));
  font-weight: var(--font-weight-semibold);
}

.single-product .summary form.cart:not(.variations_form) .quantity,
.single-product .summary form.cart:not(.variations_form) .quantity-total {
  order: 1;
}

.single-product .summary form.cart:not(.variations_form) .quantity-total {
  flex: 1 1 auto;
  padding-top: 0;
}

.single-product .summary form.cart:not(.variations_form)::after {
  content: '';
  order: 2;
  flex: 1 1 100%;
  margin-top: calc(-1 * var(--space-3)); /* cancels the extra row gap of this empty line */
}

.single-product .summary form.cart:not(.variations_form) .single_add_to_cart_button,
.single-product .summary form.cart:not(.variations_form) .buy-now-button {
  order: 3;
  flex: 1 1 0;
  min-width: 0;
}

/* Add to cart = outline (secondary); Buy now = solid. */
.single-product .summary .single_add_to_cart_button.button {
  border: 1px solid var(--color-primary);
  background: var(--color-surface);
  color: var(--color-primary-hover);
}

/* Cart icon before the label (Woo escapes the button text, so it is drawn here; same path as the header cart). */
.single-product .summary .single_add_to_cart_button.button::before {
  content: '';
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  background: currentColor;
  -webkit-mask: var(--icon-cart) center / contain no-repeat;
  mask: var(--icon-cart) center / contain no-repeat;
}

.single-product .summary .single_add_to_cart_button.button {
  --icon-cart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2l2.4 10.2a2 2 0 0 0 2 1.6h7.7a2 2 0 0 0 1.9-1.5L21 8H6.2'/%3E%3Ccircle cx='10' cy='20' r='1.2'/%3E%3Ccircle cx='17' cy='20' r='1.2'/%3E%3C/svg%3E");
}

.single-product .summary .single_add_to_cart_button.button:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
}

/* Phones: keep both labels on one line; Add to cart (longer label, icon) gets a little more room. */
@media (max-width: 479px) {
  .single-product .summary form.cart:not(.variations_form) .single_add_to_cart_button,
  .single-product .summary form.cart:not(.variations_form) .buy-now-button {
    gap: var(--space-1);
    padding-inline: var(--space-2);
    font-size: var(--font-size-sm);
    white-space: nowrap;
  }

  .single-product .summary form.cart:not(.variations_form) .single_add_to_cart_button {
    flex-grow: 1.35;
  }

  .single-product .summary .single_add_to_cart_button.button::before {
    width: 1.05rem;
    height: 1.05rem;
  }
}
