/* Smart Discounts - Integración con el listado (titanitoscategoria) y la ficha (titanitosficha) */

/* ---------- Tarjeta de listado ---------- */
.tc-p__lab span.d.sd-tc-d {
  background: var(--sd-badge-bg, #d0021b);
  color: var(--sd-badge-fg, #fff);
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: 0;
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1.1;
  box-shadow: 0 4px 12px -6px rgba(208, 2, 27, .65);
}
.tc-p.sd-sale .tc-p__pr { color: var(--sd-sale-color, #d0021b); font-weight: 800; font-size: 1.08rem; }
.tc-p.sd-sale .tc-p__pr s { color: var(--grey, #5e5b56); font-weight: 400; font-size: .86rem; }
[data-tc-sheet-pr] s { color: var(--grey, #5e5b56); font-weight: 400; margin-right: 6px; }
[data-tc-sheet-pr]:has(s) { color: var(--sd-sale-color, #d0021b); font-weight: 800; }

/* ---------- Ficha: precio ---------- */
.tf__price.sd-sale { align-items: center; row-gap: 4px; }
.tf__price.sd-sale s { font-size: 1.05rem; }
.tf__price.sd-sale b { color: var(--sd-sale-color, #d0021b); font-size: 1.9rem; font-weight: 800; line-height: 1; }
.sd-tf-pct {
  background: var(--sd-badge-bg, #d0021b);
  color: var(--sd-badge-fg, #fff);
  font-weight: 800;
  font-size: .9rem;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 8px;
}
.sd-tf-save { flex-basis: 100%; color: var(--sd-sale-color, #d0021b); font-size: .84rem; font-weight: 600; }

/* ---------- Ficha: etiqueta sobre la foto ---------- */
.tf__stage .sd-badge--ficha {
  position: absolute; top: 14px; left: 14px; z-index: 3; pointer-events: none;
  background: var(--sd-badge-bg, #d0021b) !important; color: var(--sd-badge-fg, #fff) !important;
  font-size: 1.05rem; font-weight: 800; line-height: 1; padding: 9px 12px; border-radius: 10px;
  box-shadow: 0 6px 16px -8px rgba(208, 2, 27, .7);
}

/* ---------- Ficha: unidades ---------- */
.sd-units { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 16px; }
.sd-units__cap { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gris, #5e5b56); }
.sd-units__total { font-size: .88rem; font-weight: 600; margin-left: auto; }
.sd-qty.sd-qty--ficha { display: inline-flex; align-items: stretch; height: 46px; margin: 0; border: 1px solid #d9d6d0; border-radius: 10px; overflow: hidden; background: #fff; }
.sd-qty--ficha .sd-qty__btn { width: 44px; border: 0; background: transparent; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; padding: 0; }
.sd-qty--ficha .sd-qty__btn:hover { background: #f3f1ed; }
.sd-qty--ficha .sd-qty__input { width: 54px; height: auto; border: 0; border-left: 1px solid #ebe8e2; border-right: 1px solid #ebe8e2; border-radius: 0; text-align: center; font-size: 1rem; font-weight: 700; padding: 0; background: transparent; box-shadow: none; -moz-appearance: textfield; appearance: textfield; }
.sd-qty--ficha .sd-qty__input::-webkit-outer-spin-button, .sd-qty--ficha .sd-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sd-units + .tf__add { margin-top: 12px !important; }

/* ---------- Ficha: precio por cantidad ---------- */
.sd-tiers.sd-tiers--ficha { max-width: none; margin: 16px 0 0; border: 1px solid #e6e3dd; border-radius: 12px; font-size: .9rem; overflow: hidden; }
.sd-tiers--ficha .sd-tiers__title { background: #f7f5f1; font-size: .72rem; letter-spacing: .08em; padding: 10px 14px; }
.sd-tiers--ficha .sd-tiers__row { padding: 10px 14px; gap: 10px; }
.sd-tiers--ficha .sd-tiers__pick { border-radius: 8px; padding: 5px 10px; font-weight: 600; background: #fff; }
.sd-tiers--ficha .sd-tiers__row.is-active { background: #fff5f5; box-shadow: inset 3px 0 0 var(--sd-sale-color, #d0021b); }
.sd-tiers__hint { padding: 9px 14px; border-top: 1px solid #eee; font-size: .82rem; font-weight: 600; color: var(--sd-sale-color, #d0021b); }
.sd-tiers__hint:empty { display: none; }

/* ---------- Página de precios especiales / tarjetas del tema ---------- */
.product-price-and-shipping:has(.regular-price) .product-price { color: var(--sd-sale-color, #d0021b) !important; font-weight: 800; }

/* ---------- Descuento por volumen (suma del carrito) ---------- */
.sd-vol { margin: 16px 0 0; padding: 12px 14px; border: 1px solid #f3c9cd; border-radius: 12px; background: #fff7f7; font-size: .9rem; }
.sd-vol__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.sd-vol__tag { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sd-sale-color, #d0021b); font-weight: 700; }
.sd-vol__title { font-size: 1rem; font-weight: 800; }
.sd-vol__bar { height: 8px; border-radius: 99px; background: #f1dcde; overflow: hidden; margin: 10px 0 8px; }
.sd-vol__bar i { display: block; height: 100%; border-radius: 99px; background: var(--sd-sale-color, #d0021b); transition: width .35s ease; }
.sd-vol__text { margin: 0; font-weight: 600; }
.sd-vol__text b { color: var(--sd-sale-color, #d0021b); }
.sd-vol__note { margin: 4px 0 0; font-size: .8rem; color: #6b6762; }
.sd-vol.is-done { border-color: #bfe3c8; background: #f3fbf5; }
.sd-vol.is-done .sd-vol__bar { background: #d5eedb; }
.sd-vol.is-done .sd-vol__bar i { background: #1f9d4c; }
.sd-vol.is-done .sd-vol__tag { color: #1f9d4c; }
.sd-vol--banner { margin: 0 0 16px; }
.sd-vol--banner .sd-vol__bar { max-width: 420px; }
@media (prefers-reduced-motion: reduce) { .sd-vol__bar i { transition: none; } }

.sd-vol--drawer { margin: 10px 16px 6px; padding: 10px 12px; }
.sd-vol--drawer .sd-vol__title { font-size: .92rem; }
.sd-vol--drawer .sd-vol__text { font-size: .86rem; }
