/* Add to cart + favorites sit side by side when the column is wide enough and
   stack to full width when it isn't (e.g. the narrow Quick View summary). */
.woocommerce div.product form.cart:has(> .bv-favorite-button),
.woocommerce div.product .woocommerce-variation-add-to-cart:has(> .bv-favorite-button) {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

/* WooCommerce's clearfix pseudo-elements would otherwise count as flex items. */
.woocommerce div.product form.cart:has(> .bv-favorite-button)::before,
.woocommerce div.product form.cart:has(> .bv-favorite-button)::after,
.woocommerce div.product .woocommerce-variation-add-to-cart:has(> .bv-favorite-button)::before,
.woocommerce div.product .woocommerce-variation-add-to-cart:has(> .bv-favorite-button)::after {
  display: none;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
  flex: 1 1 auto;
  margin: 0;
}

.woocommerce div.product form.cart .bv-favorite-button {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #222;
  background: #fff;
  color: #222;
  font-weight: 700;
  /* uppercase via CSS, not in the label strings, so the JS "Saved to
     favorites" state is covered too and aria-label stays sentence case */
  text-transform: uppercase;
  vertical-align: middle;
  cursor: pointer;
}

.bv-favorite-button > span:first-child { font-size: 22px; line-height: 1; }
.bv-favorite-button:hover,
.bv-favorite-button:focus,
.bv-favorite-button.is-saved { background: #000; color: #fff; }
.bv-favorites { position: fixed; right: 18px; bottom: 18px; z-index: 10000; }
.bv-favorites-toggle { padding: 11px 16px; border: 0; border-radius: 22px; background: #000; color: #fff; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.3); cursor: pointer; }
.bv-favorites-toggle span:first-child { color: #ffd02f; }
.bv-favorites-count { display: inline-block; min-width: 18px; margin-left: 4px; border-radius: 10px; background: #fff; color: #000; font-size: 12px; }
.bv-favorites-panel { position: absolute; right: 0; bottom: 50px; width: 310px; padding: 16px; background: #fff; color: #222; box-shadow: 0 2px 18px rgba(0,0,0,.3); }
.bv-favorites-heading { display: flex; justify-content: space-between; margin-bottom: 12px; }
.bv-favorites-close { border: 0; background: none; font-size: 22px; cursor: pointer; }
.bv-favorites-empty { color: #666; font-size: 14px; }
.bv-favorites-list { margin: 0; padding: 0; list-style: none; }
.bv-favorites-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid #ddd; }
.bv-favorites-list img { width: 42px; height: 42px; object-fit: cover; }
.bv-favorites-list a { flex: 1; color: #222; font-size: 13px; text-decoration: underline; }
.bv-favorite-remove { border: 0; background: none; color: #666; font-size: 20px; cursor: pointer; }

@media (max-width: 480px) {
  .woocommerce div.product form.cart .single_add_to_cart_button,
  .woocommerce div.product form.cart .bv-favorite-button { flex-basis: 100%; }
  .bv-favorites { right: 10px; bottom: 10px; }
  .bv-favorites-panel { right: -4px; width: min(310px, calc(100vw - 20px)); }
}
