/* ==========================================================================
   Bloque de compra de la ficha de producto (simples, variables y rutinas)
   Manager BPH — módulo "Bloque de compra" (class-buy-box.php)
   ========================================================================== */

.single-product .elementor-add-to-cart {
    --bph-buy-h: 48px;
    --bph-buy-ink: #1d1d1b;
    --bph-buy-green: #4f675b;
    --bph-buy-soft: #f4f6f4;
    --bph-buy-line: rgba(29, 29, 27, .18);
}

/* ── Mensaje de puntos: aviso suave en vez de caja con borde negro ───────── */
.single-product .elementor-add-to-cart .wc-points-rewards-product-message {
    /* bloque normal: con flex, cada trozo de texto ("Compra…", "6", "Puntos!") era una columna */
    display: block !important;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 14px !important;
    padding: 11px 14px 11px 46px !important;
    text-align: left !important;
    border: 0 !important;
    border-radius: 8px;
    background: var(--bph-buy-soft);
    color: var(--bph-buy-ink);
    font-size: 14px;
    line-height: 1.4;
}

.single-product .elementor-add-to-cart .wc-points-rewards-product-message::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: var(--bph-buy-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 3.2l2.6 5.5 6 .8-4.4 4.2 1.1 6-5.3-2.9-5.3 2.9 1.1-6L3.4 9.5l6-.8z'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.single-product .elementor-add-to-cart .wc-points-rewards-product-message strong {
    font-weight: 700;
}

.single-product .elementor-add-to-cart form.cart > br {
    display: none;
}

/* ── Fila cantidad + botón ─────────────────────────────────────────────── */
.single-product .elementor-add-to-cart .e-atc-qty-button-holder,
.single-product .elementor-product-woosb form.cart {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

/* Selector de cantidad: un único recuadro con − y + dentro */
.single-product .elementor-add-to-cart form.cart .quantity-wrapper {
    position: relative;
    display: flex !important;
    align-items: stretch;
    flex: 0 0 124px;
    width: 124px;
    height: var(--bph-buy-h);
    margin: 0 !important;
    padding: 0;
    box-sizing: border-box;
    border: 1px solid var(--bph-buy-ink);
    background: #fff;
}

.single-product .elementor-add-to-cart form.cart .quantity-wrapper > button.minus,
.single-product .elementor-add-to-cart form.cart .quantity-wrapper > button.plus {
    position: static !important;
    inset: auto !important;
    flex: 0 0 38px;
    width: 38px;
    height: auto;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    background: transparent !important;
    cursor: pointer;
    transition: background-color .15s ease;
}

.single-product .elementor-add-to-cart form.cart .quantity-wrapper > button:hover {
    background: var(--bph-buy-soft) !important;
}

.single-product .elementor-add-to-cart form.cart .quantity-wrapper > button img {
    width: 13px;
    height: 13px;
    pointer-events: none;
}

.single-product .elementor-add-to-cart form.cart .quantity-wrapper .quantity {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
}

.single-product .elementor-add-to-cart form.cart .quantity-wrapper input.qty {
    width: 100% !important;
    min-width: 0 !important; /* el tema fuerza min-width:100px !important */
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--bph-buy-ink);
    -moz-appearance: textfield;
    appearance: textfield;
}

.single-product .elementor-add-to-cart form.cart .quantity-wrapper input.qty::-webkit-outer-spin-button,
.single-product .elementor-add-to-cart form.cart .quantity-wrapper input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Botón añadir al carrito: ocupa el resto de la fila, misma altura */
.single-product .elementor-add-to-cart form.cart button[name="add-to-cart"],
.single-product .elementor-add-to-cart form.cart .single_add_to_cart_button {
    flex: 1 1 auto;
    min-width: 0;
    height: var(--bph-buy-h) !important;
    min-height: var(--bph-buy-h) !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 20px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: background-color .2s ease, border-color .2s ease;
}

.single-product .elementor-add-to-cart form.cart button[name="add-to-cart"]:not(:disabled):hover {
    background-color: var(--bph-buy-green) !important;
    border-color: var(--bph-buy-green) !important;
}

/* Rutinas: el aviso de mínimo de productos ocupa su propia línea */
.single-product .elementor-product-woosb form.cart {
    flex-wrap: wrap !important; /* Elementor fija nowrap con más especificidad */
}

.single-product .elementor-product-woosb form.cart .wc-points-rewards-product-message {
    flex: 0 0 100%;
    margin-bottom: 4px !important;
}

.single-product .elementor-product-woosb form.cart .mbp-min-note {
    flex: 0 0 100%;
    margin: 2px 0 0 !important;
}

/* ── Pago exprés (Apple Pay / Google Pay) ─────────────────────────────── */
.single-product #wc-stripe-express-checkout-element {
    flex-wrap: wrap;
    margin: 12px 0 0 !important;
}

.single-product #wc-stripe-express-checkout-element::before {
    content: "o compra al instante con";
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    letter-spacing: .02em;
    color: rgba(29, 29, 27, .6);
    margin-bottom: 2px;
}

/* ── Rutinas: resumen de precio ────────────────────────────────────────── */
/* La línea "Precio del lote … Seleccionado" de WPC repite lo que ya dice el resumen */
.single-product .woosb-wrap:has(.mbp-price-summary) .woosb-summary {
    display: none !important;
}

.single-product .woosb-wrap .mbp-price-summary {
    margin: 4px 0 16px !important;
    padding: 14px 18px !important;
    border-radius: 0 8px 8px 0;
}

/* ── Móvil ─────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .single-product .elementor-add-to-cart {
        --bph-buy-h: 50px;
    }

    .single-product .elementor-add-to-cart form.cart .quantity-wrapper {
        flex-basis: 112px;
        width: 112px;
    }

    .single-product .elementor-add-to-cart form.cart .quantity-wrapper > button.minus,
    .single-product .elementor-add-to-cart form.cart .quantity-wrapper > button.plus {
        flex-basis: 34px;
        width: 34px;
    }
}
