/* rd_xsell - estilos de los bloques de venta cruzada (ficha de producto).
 * Todo va bajo .rd-xsell para no pisar nada del tema. Responsive:
 *  - escritorio: fila de tarjetas con "+" y resumen a la derecha (estilo Amazon)
 *  - móvil: items en lista vertical compacta y resumen a lo ancho
 */

.rd-xsell { margin: 28px 0 8px; clear: both; }
.rd-xsell .rd-xsell-title {
  font-size: 20px; font-weight: 700; margin: 0 0 16px; color: #1a1a1a;
}

/* ---------- FBT ---------- */
.rd-xsell-fbt-wrap {
  display: flex; align-items: center; justify-content: center; gap: 34px;
  flex-wrap: wrap; border: 1px solid #e6e6e6; border-radius: 12px;
  padding: 18px; background: #fff;
}
.rd-xsell-fbt-items {
  display: flex; align-items: flex-start; justify-content: center; gap: 10px;
  flex: 0 1 auto; flex-wrap: wrap; min-width: 0;
}
.rd-xsell-item {
  position: relative; width: 168px; padding: 6px;
  display: flex; flex-direction: column;
}
.rd-xsell-plus {
  align-self: center; font-size: 26px; font-weight: 300; color: #767676;
  padding: 0 2px; margin-top: 52px;
}
.rd-xsell-check-wrap {
  position: absolute; top: 2px; right: 2px; z-index: 2; cursor: pointer;
  margin: 0; line-height: 1;
}
.rd-xsell-check-wrap .rd-xsell-check {
  position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer;
}
.rd-xsell-check-box {
  display: inline-block; width: 22px; height: 22px; border-radius: 5px;
  border: 2px solid #adadad; background: #fff; position: relative;
  transition: all .15s ease;
}
.rd-xsell-check:checked + .rd-xsell-check-box { background: #509e2f; border-color: #509e2f; }
.rd-xsell-check:checked + .rd-xsell-check-box::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.rd-xsell-check:disabled + .rd-xsell-check-box { opacity: .4; }
.rd-xsell-check:focus-visible + .rd-xsell-check-box { outline: 2px solid #509e2f; outline-offset: 2px; }

.rd-xsell-thumb { display: block; background: #f7f7f7; border-radius: 8px; overflow: hidden; position: relative; }
.rd-xsell-thumb img { width: 100%; height: auto; display: block; mix-blend-mode: multiply; }
.rd-xsell-info { padding: 8px 2px 0; }
.rd-xsell-name {
  font-size: 13px; line-height: 1.35; margin: 0 0 4px; color: #333;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.rd-xsell-name a { color: #2162a4; text-decoration: none; }
.rd-xsell-name a:hover { text-decoration: underline; }
/* Todo lo del precio SIEMPRE en una sola línea: nada de saltos hacia abajo.
   Si no cabe, el JS la escala (transform) hasta que quepa. */
.rd-xsell-price-line {
  margin: 0; display: flex; align-items: baseline; gap: 6px;
  flex-wrap: nowrap; white-space: nowrap; min-width: 0;
  transform-origin: left center;
}
.rd-xsell-item-price { font-size: 16px; font-weight: 700; color: #1a1a1a; }
.rd-xsell-old-price { font-size: 12.5px; color: #8a8a8a; }
.rd-xsell-unavailable .rd-xsell-thumb { opacity: .45; }

/* selects de talla/color: compactos (etiqueta y select en la misma línea,
   para que 3 grupos —talla/color/copa— no estiren la tarjeta) */
.rd-xsell-variants { margin-top: 5px; }
.rd-xsell-variant { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 11px; color: #777; }
.rd-xsell-variant-name { flex: 0 0 auto; margin: 0; font-weight: 600; min-width: 34px; }
.rd-xsell-sel {
  flex: 1 1 auto; min-width: 0; padding: 3px 5px; font-size: 12px;
  border: 1px solid #ccc; border-radius: 6px; background: #fff; color: #333;
}
.rd-xsell-nostock { display: inline-block; margin-top: 3px; font-size: 12px; color: #b04a4a; font-weight: 600; }

/* resumen: pegado al pack y centrado con él (estilo Amazon) */
.rd-xsell-fbt-summary { flex: 0 0 auto; width: 232px; }
.rd-xsell-total-line { font-size: 15px; color: #333; margin: 0 0 12px; }
.rd-xsell-total { font-size: 21px; font-weight: 800; color: #1a1a1a; }
.rd-xsell-addall {
  display: block; width: 100%; border: 0; cursor: pointer;
  background: #509e2f; color: #fff; font-size: 15px; font-weight: 700;
  padding: 12px 18px; border-radius: 24px; transition: background .15s ease;
}
.rd-xsell-addall:hover:not(:disabled) { background: #417f26; }
.rd-xsell-addall:disabled { opacity: .55; cursor: default; }
.rd-xsell-addall.rd-xsell-loading { opacity: .75; }
.rd-xsell-msg { margin: 10px 0 0; font-size: 13px; color: #b04a4a; }

/* ---------- carrusel "también compraron" ---------- */
.rd-xsell-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 172px;
  gap: 14px; overflow-x: auto; padding: 4px 2px 12px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.rd-xsell-tile {
  scroll-snap-align: start; display: flex; flex-direction: column;
  border: 1px solid #ececec; border-radius: 10px; padding: 10px;
  background: #fff;
}
.rd-xsell-tile-thumb { display: block; background: #f7f7f7; border-radius: 7px; overflow: hidden; position: relative; }
.rd-xsell-tile-thumb img { width: 100%; height: auto; display: block; mix-blend-mode: multiply; }
.rd-xsell-tile-name {
  font-size: 12.5px; line-height: 1.3; margin: 8px 0 4px; min-height: 33px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rd-xsell-tile-name a { color: #333; text-decoration: none; }
.rd-xsell-tile-name a:hover { color: #2162a4; }
.rd-xsell-tile .rd-xsell-item-price { font-size: 15px; }
.rd-xsell-tile-btn {
  margin-top: auto; display: block; text-align: center; cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 8px 10px; border-radius: 18px;
  border: 1.5px solid #509e2f; color: #509e2f; background: #fff;
  text-decoration: none; transition: all .15s ease; margin-top: 8px;
}
.rd-xsell-tile-btn:hover { background: #509e2f; color: #fff; text-decoration: none; }
.rd-xsell-tile-add:disabled { opacity: .6; cursor: default; }

/* ---------- badges de oferta/nuevo/descuento, como en el listado ----------
   Los chips sobre la imagen usan las clases del tema (.product-flags /
   .product-flag on-sale|new): heredan sus colores. Aquí solo se ajusta el
   tamaño a las miniaturas del bloque. El "-XX%" replica el chip del listado
   (.discount-percentage: fondo #e0525c, radio 5px). */
.rd-xsell .product-flags { top: 6px; left: 6px; font-size: 10px; }
.rd-xsell .product-flags li.product-flag { margin: 0 4px 4px 0; box-shadow: 1px 1px 1px rgba(0,0,0,.18); }
.rdx-discount {
  display: inline-block; padding: 4px 5px; font-size: 12px; font-weight: 700;
  background: #e0525c; color: #fff; border-radius: 5px; line-height: 1;
  vertical-align: middle;
}

/* estrellitas eTrusted (Trusted Shops), bajo el nombre como Amazon */
.rd-xsell etrusted-widget.rdx-stars { display: block; margin: 1px 0 3px; min-height: 0; overflow: hidden; }
@media (max-width: 767px) {
  .rd-xsell .product-flags { font-size: 9px; top: 4px; left: 4px; }
}

/* ---------- modal "productos añadidos" (varios del pack) ----------
   Reutiliza #blockcart-modal del tema; esto solo maqueta las líneas extra. */
#blockcart-modal .rdx-modal-lines { display: flex; flex-direction: column; gap: 14px; }
#blockcart-modal .rdx-modal-line { display: flex; gap: 12px; align-items: flex-start; }
#blockcart-modal .rdx-modal-line .product-image { width: 74px; height: auto; flex: 0 0 74px; }
#blockcart-modal .rdx-modal-line-info { min-width: 0; }
#blockcart-modal .rdx-modal-line .product-name { margin: 0 0 3px; }
#blockcart-modal .rdx-modal-line .product-price { margin: 0 0 3px; }
#blockcart-modal .rdx-modal-attr { font-size: 12px; color: #555; }

/* ---------- móvil ---------- */
@media (max-width: 767px) {
  .rd-xsell .rd-xsell-title { font-size: 17px; }
  .rd-xsell-fbt-wrap { padding: 14px 12px; gap: 14px; }
  .rd-xsell-fbt-items { flex-direction: column; gap: 12px; flex-basis: 100%; }
  .rd-xsell-plus { display: none; }
  .rd-xsell-item {
    width: 100%; flex-direction: row; gap: 12px; align-items: flex-start;
    padding: 0 0 12px; border-bottom: 1px solid #f0f0f0;
  }
  .rd-xsell-item:last-child { border-bottom: 0; padding-bottom: 0; }
  .rd-xsell-thumb { flex: 0 0 84px; width: 84px; }
  .rd-xsell-info { flex: 1 1 auto; padding-top: 0; min-width: 0; }
  .rd-xsell-name { -webkit-line-clamp: 2; }
  .rd-xsell-check-wrap { position: static; order: 3; align-self: center; }
  .rd-xsell-item { display: flex; }
  .rd-xsell-check-wrap { margin-left: auto; }
  .rd-xsell-fbt-summary {
    flex: 1 1 100%; width: auto; min-width: 0; border-top: 1px solid #e6e6e6; padding-top: 14px;
  }
  .rd-xsell-variants { max-width: 220px; }
  .rd-xsell-strip { grid-auto-columns: 148px; }
}
