/**
 * Snippet 04 — Precios y Descuentos

 *
 * PROPÓSITO:
 * Estilos del bloque de precio, precio tachado (regular price),
 * precio de oferta, precio por gramo y acciones de producto.
 *
 * DEPENDENCIAS: 00-variables.css
 * AFECTA: .product-price, .regular-price, .sale-price,
 *         .price-per-gram, .product-actions, .add-to-cart-btn
 *
 * RESTRICCIÓN FUNCIONAL:
 * .regular-price y .sale-price son generados por WooCommerce.
 * Sus estructuras HTML no deben modificarse desde aquí.
 * Solo se controla su apariencia visual.
 *
 * El botón .add-to-cart-btn dispara el evento WooCommerce
 * de agregar al carrito vía AJAX. No eliminar ni renombrar
 * sin validar el JS asociado.
 */

/* Bloque de precio principal */
.product-price {
  line-height: 100%;
  display:flex;
  font-weight: 600;
}

/* Precio regular (tachado) — badge rojo */
span.regular-price {
  font-size: 16px;
  background: var(--color-sale-bg);
  padding: var(--spacing-sm);
  gap: var(--spacing-xs);
  line-height: 1;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--color-sale-text);
  text-align: center;
  width: fit-content;
  height: fit-content;
  margin-bottom: auto;
  display: flex;
  flex-direction: column;
  margin-right: var(--spacing-sm);
}

/* Texto "Antes:" dentro del badge de precio regular */
span.regular-price span.before-text {
  font-size: 12px;
}

/* Número tachado */
span.regular-price span.reguler-number {
  text-decoration: line-through;
}

/* Forzar color blanco en texto dentro del precio regular */
.pop_up_body span.regular-price * {
  color: var(--color-white);
}

/* Precio por gramo */
.price-per-gram {
  font-size: 25px;
  color: var(--color-primary);
  width: fit-content;
  line-height: 120%;
  margin-top: auto;
  padding-left: var(--spacing-md);
  font-weight: 400;
}

/* Acciones de producto (botón + cantidad) */
.product-actions {
  display: flex;
  align-items: center;
  margin-top: 12px;
}

/* Botón Agregar al Carrito */
button.add-to-cart-btn {
  flex: 1;
  color: var(--color-white);
  padding: 16px var(--spacing-md);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  background-color: var(--color-primary);
  border-radius: var(--radius-sm);
  display: flex;
  border: 0;
  text-transform: uppercase;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  width: 100%;
}

button.add-to-cart-btn:hover {
  background-color: var(--color-primary);
  border: 0;
  color: var(--color-white);
}

/* Ícono del carrito — generado por CSS (no requiere img en HTML) */
.add-to-cart-btn::before {
  content: '';
  left: 13px;
  width: 15px;
  height: 20px;
  background: var(--asset-cart-icon) no-repeat center center;
  background-size: cover;
  display: inline-block;
}

/* Versión legacy del botón (fuera de button) — mantener por compatibilidad */
.add-to-cart-btn {
  margin-top: 15px;
  padding: 10px 15px;
  background-color: var(--color-cta-primary);
  color: var(--color-white);
  border: none;
  cursor: pointer;
}

.add-to-cart-btn:hover {
  background-color: var(--color-cta-hover);
}

/* Ocultar acciones en columna derecha del popup (visible solo en móvil) */
.product-right .pro-popup.product-actions {
  display: none;
}

/* ── Fila cantidad + botón ───────────────────────────────────────── */
.sj-atc-row {
  grid-column: span 2 / span 2;
  display: flex;
  align-items: stretch;
  gap: 12px;
}

/* Selector de cantidad */
.sj-qty {
  display: flex;
  align-items: stretch;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  /* override .quantity-selector */
  width: auto;
  box-shadow: none;
  position: static;
}

.sj-qty button.sj-qty__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-height: 40px;
  background-color: var(--color-white);
  border: none;
  border-radius: 0;
  color: #000 !important;
  font-size: 32px;
  font-weight: 300;
  cursor: pointer;
  transition: background 0.15s ease;
  /* reset heredado */
  position: static;
  padding: 0;
  line-height: 1;
}

.sj-qty__btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.sj-atc-row .sj-qty input.sj-qty__input {
  width: 40px;
  min-height: 40px;
  border: 0;
  text-align: center;
  background: var(--color-white);
  border-left: 1.5px solid #000;
  border-right: 1.5px solid #000;
  color: #000;
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-primary);
  /* override .quantity-input */
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Botón añadir al carrito */
.sj-atc-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  min-height: 52px;
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.1s ease;
  /* reset heredado de .add-to-cart-btn */
  margin-left: 0;
  margin-top: 0;
}

.sj-atc-btn:hover {
  background: #c44f00;
}

.sj-atc-btn:active {
  transform: scale(0.98);
}

.sj-atc-btn svg {
  flex-shrink: 0;
}

/* Override: ocultar el ::before del icono CSS heredado dentro de .sj-atc-btn */
.sj-atc-btn::before {
  display: none;
}

/* ── Trust badges ────────────────────────────────────────────────── */
.sj-trust-row {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.sj-trust-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-white);
  font-size: 12px;
  font-family: var(--font-secondary);
  letter-spacing: 0.3px;
  flex: 1;
  justify-content: center;
}

.sj-trust-item .sj-trust-label {
  color: var(--color-primary);
}

.sj-trust-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.sj-trust-divider {
  color: var(--color-white);
  font-size: 14px;
  padding: 0 2px;
  align-self: center;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .sj-atc-btn {
    font-size: 13px;
    padding: 0 16px;
    letter-spacing: 0.5px;
  }
}

@media (max-width: 479px) {
  .sj-atc-row {
    gap: 8px;
  }

  .sj-qty__btn {
    width: 38px;
  }

  .sj-qty__input {
    width: 40px;
  }

  .sj-trust-item {
    font-size: 11px;
    gap: 5px;
  }

  .sj-trust-item svg {
    width: 15px;
    height: 15px;
  }
}
