/*
 * Whapido Bulk Variations - Styles
 */

/* -----------------------------
   Single product price typography
------------------------------ */

/* Simple: 14px bold */
body.single-product div.product.product-type-simple .summary .price,
body.single-product div.product.product-type-simple .product-info .price,
body.single-product div.product.product-type-simple .summary p.price {
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

/* Variable: hide range price (we show Total in sticky) */
body.whpbv-active div.product.product-type-variable .summary > .price,
body.whpbv-active div.product.product-type-variable .summary p.price,
body.whpbv-active div.product.product-type-variable .product-info .price {
  display: none !important;
}

/* Hide native Woo variable selector + native add-to-cart in bulk mode */
body.whpbv-active form.variations_form,
body.whpbv-active .variations_form,
body.whpbv-active table.variations,
body.whpbv-active .variations,
body.whpbv-active .reset_variations,
body.whpbv-active .single_variation_wrap,
body.whpbv-active .woocommerce-variation,
body.whpbv-active .woocommerce-variation-add-to-cart,
body.whpbv-active .single_add_to_cart_button,
body.whpbv-active .woocommerce-variation-price,
body.whpbv-active .woocommerce-variation-availability {
  display: none !important;
}

/* -----------------------------
   Bulk block
------------------------------ */

.whpbv {
  margin: 14px 0 18px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  background: #fff;
}

.whpbv-title {
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: .08em;
}

.whpbv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Layout: label (left) | price (right) | qty (fixed center) */
.whpbv-row {
  display: grid;
  /*
   * Más ancho para el nombre de la variación.
   * Achicamos el bloque de cantidad (botones +/- + input).
   */
  grid-template-columns: 1fr 92px 86px;
  align-items: center;
  gap: 6px;

  padding: 10px;
  background: #fafafa;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
}

.whpbv-label {
  font-weight: 400 !important;
  color: #111827;
  text-align: left;
  justify-self: start;
}

.whpbv-price {
  font-weight: 400 !important;
  text-align: right;
  white-space: nowrap;
  font-size: 14px;
}

/* Woo suele envolver el precio con spans (amount, currencySymbol). Forzamos peso normal. */
.whpbv-price * {
  font-weight: 400 !important;
}

.whpbv-qty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.whpbv-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.12);
  background: #f3f4f6;
  color: #111827;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}


.whpbv-input {
  width: 10px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  text-align: center;
  padding: 0 2px;
}

/* Slightly tighter on very narrow phones */
@media (max-width: 360px) {
  .whpbv-row { grid-template-columns: 1fr 84px 84px; }
  .whpbv-btn { width: 28px; height: 28px; }
  .whpbv-input { width: 10px; height: 28px; }
}

/* Mobile: price align left +2px */
@media (max-width: 480px) {
  .whpbv-price {
    text-align: left;
    font-size: 16px; /* +2px */
  }
}

/* -----------------------------
   Sticky integration
------------------------------ */


/* Sticky typography: smaller + robust for long prices */
body.single-product .whp-sticky-atc .whp-btn-price,
body.single-product #whp-sticky-atc .whp-btn-price {
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55vw;
  display: block;
}

body.single-product .whp-sticky-atc .whp-sticky-cta,
body.single-product #whp-sticky-atc .whp-sticky-cta,
body.single-product .whp-sticky-atc button.whp-sticky-cta,
body.single-product #whp-sticky-atc button.whp-sticky-cta {
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  white-space: nowrap;
}

@media (min-width: 768px) {
  body.single-product .whp-sticky-atc .whp-btn-price,
  body.single-product #whp-sticky-atc .whp-btn-price {
    max-width: 240px;
  }
}

/* Sticky price on mobile: align left +2px */
@media (max-width: 480px) {
  body.single-product .whp-sticky-atc .whp-btn-price,
  body.single-product #whp-sticky-atc .whp-btn-price {
    text-align: left;
    font-size: 16px !important; /* +2px */
  }
}

/* Sticky typography: smaller + robust for long prices */
body.single-product .whp-sticky-atc .whp-btn-price,
body.single-product #whp-sticky-atc .whp-btn-price {
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55vw;
  display: block;
}

body.single-product .whp-sticky-atc .whp-sticky-cta,
body.single-product #whp-sticky-atc .whp-sticky-cta,
body.single-product .whp-sticky-atc button.whp-sticky-cta,
body.single-product #whp-sticky-atc button.whp-sticky-cta {
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  white-space: nowrap;
}

@media (min-width: 768px) {
  body.single-product .whp-sticky-atc .whp-btn-price,
  body.single-product #whp-sticky-atc .whp-btn-price {
    max-width: 240px;
  }
}

/* Sticky price on mobile: align left +2px */
@media (max-width: 480px) {
  body.single-product .whp-sticky-atc .whp-btn-price,
  body.single-product #whp-sticky-atc .whp-btn-price {
    text-align: left;
    font-size: 16px !important; /* +2px */
  }
}

/* Sticky typography: smaller + robust for long prices */
body.single-product .whp-sticky-atc .whp-btn-price,
body.single-product #whp-sticky-atc .whp-btn-price {
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55vw;
  display: block;
}

body.single-product .whp-sticky-atc .whp-sticky-cta,
body.single-product #whp-sticky-atc .whp-sticky-cta,
body.single-product .whp-sticky-atc button.whp-sticky-cta,
body.single-product #whp-sticky-atc button.whp-sticky-cta {
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  white-space: nowrap;
}

@media (min-width: 768px) {
  body.single-product .whp-sticky-atc .whp-btn-price,
  body.single-product #whp-sticky-atc .whp-btn-price {
    max-width: 240px;
  }
}

/* Sticky price on mobile: align left +2px */
@media (max-width: 480px) {
  body.single-product .whp-sticky-atc .whp-btn-price,
  body.single-product #whp-sticky-atc .whp-btn-price {
    text-align: left;
    font-size: 16px !important; /* +2px */
  }
}
/* In bulk mode, hide sticky qty controls (theme sticky) */
body.whpbv-active .whp-sticky-qty,
body.whpbv-active .whp-sticky-atc .whp-sticky-qty {
  display: none !important;
}

/* -----------------------------
   UX: attention + sticky modes
------------------------------ */

/* Highlight block when user must select options */
.whpbv.whpbv-highlight {
  border-color: rgba(34, 197, 94, 0.45) !important; /* subtle green */
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

/* Ensure label is on the far right in normal "AGREGAR" mode */
body.single-product #whp-sticky-atc .whp-sticky-cta .whp-btn-label {
  margin-left: auto;
  text-align: right;
}

/* "Seleccionar opciones" mode: keep total visible but grey, align label to the right */
body.whpbv-active #whp-sticky-atc .whp-sticky-cta.whpbv-needs-selection {
  background: var(--nasa-primary-color, var(--primary-color, #e13123)) !important;
  position: relative;
  justify-content: flex-end !important;
}

body.whpbv-active #whp-sticky-atc .whp-sticky-cta.whpbv-needs-selection .whp-btn-price {
  opacity: 0.55;
  position: absolute;
  left: 16px;
}

body.whpbv-active #whp-sticky-atc .whp-sticky-cta.whpbv-needs-selection .whp-btn-label {
  margin-left: auto;
  text-align: right;
  padding-right: 16px;
  font-size: 12px !important; /* -2px */
}

/* Ensure button isn't visually stuck disabled by theme when we enable it */
body.whpbv-active .whp-sticky-atc.whpbv-bulk-sticky button.whpbv-force-enabled,
body.whpbv-active #whp-sticky-atc.whpbv-bulk-sticky button.whpbv-force-enabled {
  opacity: 1 !important;
  pointer-events: auto !important;
  filter: none !important;
}

/* When plugin marks disabled */
body.whpbv-active .whp-sticky-atc.whpbv-bulk-sticky button.whpbv-force-disabled,
body.whpbv-active #whp-sticky-atc.whpbv-bulk-sticky button.whpbv-force-disabled {
  opacity: 0.55 !important;
  pointer-events: none !important;
}

/* Sticky price on mobile: align left +2px */
@media (max-width: 480px) {
  body.whpbv-active .whp-sticky-atc .whp-btn-price,
  body.whpbv-active #whp-sticky-atc .whp-btn-price {
    text-align: left;
    font-size: 16px !important; /* +2px */
  }
}
