/* Archivo: tienda.css - Version v1.47 - 2026-11-03
   Desglose de ofertas por paquete en carrito y checkout. */
body[data-page="tienda"], body[data-page="carrito"], body[data-page="checkout"], body[data-page="pago"], body[data-page="descargas"] { background: #fafafa; color: #111; }
.tienda-main { max-width: 1200px; min-height: 70vh; margin: 0 auto; padding: 90px 80px 100px; font-size: .85rem; font-weight: 300; line-height: 1.4; }
.tienda-header { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 64px; }
.tienda-main h1 { margin: 0; font-family: 'RobotoWebBarbar', sans-serif; font-size: 1rem; font-weight: 400; font-variant-caps: all-small-caps; letter-spacing: .05rem; line-height: 1.25; }
.tienda-main a { color: inherit; }
.tienda-header a { font-size: .75rem; font-weight: 300; text-decoration: none; }
.tienda-header a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Grilla editorial de cuatro columnas: imagen, título/precio, autores y descripción.
   Las filas compartidas conservan la alineación sin recortar los títulos. */
.tienda-main.tienda-catalogo { max-width: 1600px; padding-right: 40px; padding-left: 40px; }
.tienda-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 24px; row-gap: 8px; }
.tienda-producto { min-width: 0; display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 4px; }
.tienda-producto a { display: block; text-decoration: none; }
.tienda-portada { position: relative; aspect-ratio: 3 / 2; background: rgba(0,0,0,.025); }
.tienda-portada img { position: absolute; inset: 10%; width: 80%; height: 80%; object-fit: contain; }
.tienda-producto h2 { min-height: 2.4em; margin: 0; font-size: .85rem; font-weight: 300; text-transform: uppercase; line-height: 1.2; overflow-wrap: anywhere; }
.tienda-producto .tienda-autor { min-height: 0; margin: 0; font-size: .85rem; font-weight: 200; line-height: 1.2; overflow-wrap: anywhere; }
.tienda-producto .tienda-precio { margin: 0; font-size: .75rem; font-weight: 300; line-height: 1.4; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tienda-titulo-compra { display: grid; grid-template-columns: minmax(0,1fr) max-content; align-items: start; column-gap: 12px; min-width: 0; }
.tienda-compra { display: flex; align-items: center; gap: 6px; font-size: .75rem; }
.tienda-producto .tienda-descripcion { margin: 0; padding-bottom: 32px; font-size: .8rem; font-weight: 200; line-height: 1.5; overflow-wrap: anywhere; }
.tienda-producto form { margin: 0; }
@media (max-width: 1000px) { .tienda-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; } }
@media (max-width: 800px) {
  .tienda-main.tienda-catalogo { padding-right: 25px; padding-left: 25px; }
  .tienda-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 15px; }
  .tienda-producto .tienda-descripcion { padding-bottom: 16px; }
}
@media (max-width: 560px) { .tienda-grid { grid-template-columns: minmax(0,1fr); } }
.tienda-main button, .tienda-boton { appearance: none; border: 0; border-radius: 0; padding: 9px 12px; background: #b3b3b3; color: #fff; font-family: inherit; font-size: .75rem; font-weight: 400; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.tienda-main button:hover, .tienda-boton:hover { background: #999; }
.tienda-producto .tienda-agregar-icono { display: inline-flex; width: 24px; height: 24px; padding: 1px; background: transparent; color: #111; text-decoration: none; }
.tienda-agregar-icono svg { display: block; flex: none; opacity: .45; transition: opacity .15s ease; }
.tienda-producto .tienda-agregar-icono:hover { background: transparent; color: #111; }
.tienda-agregar-icono:hover svg, .tienda-agregar-icono:focus-visible svg { opacity: .85; }
.tienda-agregar-icono:disabled svg { opacity: .25; }
.tienda-producto-cantidad { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #000; color: #fff; font-size: 12px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.tienda-agregar-icono [hidden] { display: none; }
.tienda-producto .tienda-disponibilidad { margin: 0; color: #777; font-size: .75rem; font-weight: 300; line-height: 1.6; }
.tienda-main :is(a, button, input, select):focus-visible { outline: 1px solid #111; outline-offset: 4px; }
.carrito-tabla-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.carrito-tabla-scroll:focus-visible { outline: 1px solid #111; outline-offset: 4px; }
.carrito-tabla { width: 100%; min-width: 620px; table-layout: fixed; border-collapse: collapse; }
.carrito-col-portada { width: 64px; }
.carrito-col-precio { width: 100px; }
.carrito-col-cantidad { width: 76px; }
.carrito-col-subtotal { width: 112px; }
.carrito-col-acciones { width: 56px; }
.carrito-tabla th { padding: 0 8px 12px; font-size: .75rem; font-weight: 300; text-align: left; color: #666; }
.carrito-tabla td { padding: 24px 8px; border-bottom: 1px solid #ddd; vertical-align: middle; }
.carrito-tabla .carrito-numero { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.carrito-tabla .carrito-cantidad { text-align: center; }
.carrito-publicacion { overflow-wrap: anywhere; }
.carrito-publicacion form { margin: 0; }
.carrito-tabla input[type="number"] { width: 100%; height: 32px; padding: 5px; font: inherit; font-variant-numeric: tabular-nums; border: 1px solid #ddd; border-radius: 0; background: transparent; color: inherit; }
.carrito-tabla .carrito-miniatura { position: relative; padding: 0; }
.carrito-miniatura a { position: absolute; inset: 8px 6px 8px 0; display: flex; justify-content: flex-start; align-items: stretch; }
.carrito-miniatura img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: left center; }
.carrito-tabla .carrito-acciones { text-align: right; }
.carrito-iconos form { margin: 0; }
[data-carrito-error][hidden], [data-carrito-vacio][hidden] { display: none; }
.carrito-tabla-scroll[hidden], .carrito-total[hidden] { display: none; }
[data-carrito-id][aria-busy="true"] input { opacity: .65; }
.carrito-iconos { display: flex; justify-content: flex-end; gap: 6px; }
.tienda-main .carrito-icono { width: 30px; height: 32px; flex: 0 0 30px; padding: 0; background: #111; color: #fff; }
.tienda-main .carrito-icono:hover { background: #333; }
.carrito-icono svg { display: block; flex: none; }
.carrito-tabla strong, .carrito-total strong { font-weight: 400; }
.carrito-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.carrito-total { display: flex; justify-content: flex-end; align-items: center; gap: 24px; margin-top: 24px; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 480px) minmax(240px, 360px); gap: 72px; align-items: start; }
.tienda-checkout, .checkout-address { display: grid; gap: 20px; }
.tienda-checkout h2, .checkout-resumen h2, .tienda-checkout legend { margin: 0; font-size: 1rem; font-weight: 400; }
.tienda-checkout label:not(.checkout-choice) { display: block; }
.tienda-checkout input:not([type="radio"]), .tienda-checkout textarea, .tienda-checkout select { display: block; width: 100%; box-sizing: border-box; margin-top: 8px; padding: 10px; font: inherit; color: inherit; border: 1px solid #ddd; background: transparent; border-radius: 0; }
.tienda-checkout fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; }
.tienda-checkout legend { padding: 0; margin-bottom: 16px; }
.tienda-checkout p { margin: 0; }
.tienda-checkout .checkout-choice { display: flex; align-items: flex-start; gap: 10px; }
.checkout-choice input { margin: 2px 0 0; padding: 0; border: 0; accent-color: #555; }
.checkout-choice small { font-size: inherit; color: #666; }
.checkout-address[hidden] { display: none; }
.tienda-checkout button { justify-self: start; }
.tienda-checkout button:disabled, .checkout-resumen button:disabled { cursor: not-allowed; opacity: .6; }
.checkout-resumen > button { margin-top: 24px; background: #bfff00; color: #111; }
.checkout-resumen > button:hover:not(:disabled) { background: #ade600; }
.checkout-resumen h2 { margin-bottom: 20px; }
.checkout-resumen ul, .checkout-resumen dl { padding: 0; margin: 0; list-style: none; }
.checkout-resumen li, .checkout-resumen dl div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid #ddd; }
.checkout-resumen dd { margin: 0; white-space: nowrap; }
.checkout-resumen dl div:last-child { font-weight: 400; }
body[data-page="pago"] .tienda-main h2 { font-size: .9rem; font-weight: 400; margin-top: 28px; }
.transferencia-datos { max-width: 520px; margin: 24px 0; }
.transferencia-datos > div { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr; gap: 16px; padding: 6px 0; }
.transferencia-datos dd { margin: 0; overflow-wrap: anywhere; }
.tienda-error { border: 0; padding: 14px 18px; background: #111; color: #fff; font-size: .8rem; line-height: 1.55; }
.tienda-error a { color: inherit; text-decoration: underline; }
.tienda-aviso { padding: 16px 20px; background: #f2f2f2; color: #111; font-size: .8rem; line-height: 1.6; }
.tienda-aviso h2 { margin: 0 0 8px; font-size: 1rem; font-weight: 500; }
.tienda-aviso p { margin: 0 0 12px; }
.checkout-layout-digital .checkout-form-grid { grid-template-columns: 1fr; }
.checkout-layout-digital .checkout-contacto { max-width: 600px; }
.descargas-main { max-width: 1000px; }
.pedido-descargas { list-style: none; margin: 28px 0; padding: 0; }
.pedido-descargas li { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 0; border-bottom: 1px solid #ddd; }
.pedido-descargas li > span { overflow-wrap: anywhere; }
.pedido-descargas .tienda-boton { flex-shrink: 0; background: #111; }
@media(max-width:480px) { .pedido-descargas li { align-items: flex-start; flex-direction: column; gap: 12px; } }
@media (max-width: 1000px) { .tienda-main { padding-right: 40px; padding-left: 40px; } }
@media (max-width: 700px) {
  .tienda-main { padding: 90px 20px 70px; }
  .tienda-header { margin-bottom: 40px; }
  .checkout-layout { grid-template-columns: 1fr; gap: 40px; }
  .carrito-total { align-items: flex-start; flex-direction: column; gap: 16px; }
}

[data-factura-campos][hidden], [data-factura-aviso][hidden], .checkout-choice[hidden] { display: none; }

/* Tienda se divide en slots de ocho títulos, con snap entre páginas. */
.slot.slot-tienda { height: 100vh; min-height: 100vh; overflow: hidden; }
.tienda-main.tienda-catalogo.tienda-slot { height: 100vh; min-height: 0; max-width: none; box-sizing: border-box; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; padding: 80px 40px 40px; }
.tienda-slot::-webkit-scrollbar { display: none; }
.tienda-slot .tienda-header, .tienda-slot .tienda-grid { max-width: 1600px; margin-left: auto; margin-right: auto; }
.tienda-slot .tienda-header { margin-bottom: 40px; }
.tienda-slot .tienda-header h2 { margin: 0; font-family: 'RobotoWebBarbar', sans-serif; font-size: 1rem; font-weight: 400; font-variant-caps: all-small-caps; letter-spacing: .05rem; line-height: 1.25; }
@media (max-width: 800px) {
  .tienda-main.tienda-catalogo.tienda-slot { height: auto; min-height: 0; overflow: visible; padding: var(--safe-top, 80px) 25px 25px; }
}

.tienda-header.tienda-header-carrito { justify-content: flex-end; }
.tienda-panel { position: fixed; inset: auto 0 0 auto; margin: 0; padding: 24px; width: 400px; max-width: 100vw; height: 75dvh; max-height: 75dvh; overflow-y: auto; box-sizing: border-box; border: 0; background: #fff; color: #111; display: flex; flex-direction: column; font: 300 .8rem/1.4 'RobotoWebBarbar', sans-serif; animation: tienda-panel-entrada .25s ease-out; }
.tienda-panel:not([open]) { display: none; }
.tienda-panel::backdrop { background: rgba(0,0,0,.12); }
.tienda-panel.is-closing { animation: tienda-panel-salida .18s ease-in forwards; }
.tienda-panel > header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.tienda-panel h2 { margin: 0; font: 400 1rem/24px 'RobotoWebBarbar', sans-serif; font-variant-caps: all-small-caps; text-transform: none; letter-spacing: .01rem; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.tienda-panel button { appearance: none; border: 0; background: transparent; color: inherit; font: inherit; padding: 4px 0; cursor: pointer; }
.tienda-panel button svg { display: block; }
.tienda-panel [data-tienda-panel-mensaje] { margin: 12px 0 0; font-size: .75rem; }
.tienda-panel [data-tienda-panel-mensaje]:empty { display: none; }
.tienda-panel [role="alert"] { color: #a32626; }
.tienda-panel ul { overscroll-behavior: contain; flex: 1; min-height: 0; overflow-y: auto; margin: 20px 0; padding: 0; list-style: none; }
.tienda-panel li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eee; overflow-wrap: anywhere; }
.tienda-panel li img { flex: 0 0 36px; width: 36px; height: 52px; object-fit: contain; }
.tienda-panel li p { margin: 0; }
.tienda-panel li p + p { margin-top: 6px; font-size: .7rem; font-variant-numeric: tabular-nums; }
.tienda-panel > footer { display: flex; flex-direction: column; gap: 12px; position: static; padding: 0; margin: 0; background: transparent; }
.tienda-panel footer p { margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.tienda-panel [data-tienda-panel-total] { font-weight: 700; }
.tienda-panel a { color: inherit; text-underline-offset: 3px; }
.tienda-panel a.tienda-boton { background: #111; color: #fff; }
.tienda-panel a[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.tienda-panel [hidden] { display: none; }
.tienda-panel :is(a,button):focus-visible { outline: 1px solid #111; outline-offset: 4px; }
@keyframes tienda-panel-entrada { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes tienda-panel-salida { from { transform: translateX(0); } to { transform: translateX(100%); } }
@media(prefers-reduced-motion: reduce) { .tienda-panel, .tienda-panel.is-closing { animation: none; } }

.tienda-panel > header { min-height: 24px; margin-bottom: 0; }
.tienda-panel a.tienda-finalizar { background: #bfff00; color: #111; }
.tienda-panel a.tienda-finalizar:hover { background: #ade600; }
.tienda-panel [data-tienda-vaciar] { margin: 0; }
.tienda-panel [data-tienda-vaciar] button { font-size: .75rem; text-decoration: underline; text-underline-offset: 3px; }


.tienda-panel-secundarios { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
.tienda-panel .tienda-panel-secundarios :is(a,button) { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; box-sizing: border-box; padding: 9px 4px; border: 0; background: #111; color: #fff; font: inherit; font-size: .75rem; line-height: 1.4; text-decoration: none; white-space: nowrap; }

/* La X comparte caja cuadrada en el detalle y en cada línea del panel. */
.tienda-main .carrito-icono { width: 28px; height: 28px; flex-basis: 28px; }
.tienda-panel li > div { flex: 1; min-width: 0; }
.tienda-panel [data-tienda-quitar] { flex: 0 0 28px; margin: 0; }
.tienda-panel .tienda-panel-quitar { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; background: transparent; color: #111; }
.tienda-panel .tienda-panel-quitar:disabled { opacity: .4; }
.tienda-panel > header { display: grid; grid-template-columns: minmax(0,1fr) 28px; align-items: center; min-height: 28px; }
.tienda-panel > header h2 { line-height: 28px; }
.tienda-panel > header [data-tienda-panel-cerrar] { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; margin: 0; }
.tienda-panel > header [data-tienda-panel-cerrar] svg { width: 1rem; height: 1rem; }

.tienda-portada img { transition: opacity .25s ease; }
.tienda-portada .tienda-portada-reverso { opacity: 0; }
@media (hover: hover) {
  .tienda-portada-enlace.tiene-reverso:hover .tienda-portada-frente { opacity: 0; }
  .tienda-portada-enlace.tiene-reverso:hover .tienda-portada-reverso { opacity: 1; }
}
.tienda-portada-enlace.tiene-reverso:focus-visible .tienda-portada-frente { opacity: 0; }
.tienda-portada-enlace.tiene-reverso:focus-visible .tienda-portada-reverso { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .tienda-portada img { transition: none; } }

.tienda-producto .tienda-autor { color: #000; opacity: .75; }

.tienda-titulo-autores { min-width: 0; }
.tienda-titulo-autores h2 { min-height: 0; margin-bottom: 4px; }

[data-checkout-payment][hidden], [data-checkout-free][hidden] { display: none; }

.tienda-producto.es-nuevo .tienda-portada { background: rgba(0,0,0,.08); }
.tienda-etiqueta { font-size: .75rem; font-weight: 400; }
.tienda-etiqueta-nuevo, .tienda-etiqueta-oferta { font: inherit; opacity: 1; }
.tienda-etiqueta-nuevo { color: #00ff7f; }
.tienda-etiqueta-oferta { color: #ff8000; }

.tienda-nuevo-circulo, .tienda-oferta-circulo { position: absolute; top: 10px; left: 12px; z-index: 2; width: 16px; height: 16px; border-radius: 50%; background: #00ff7f; pointer-events: none; }
.tienda-oferta-circulo { background: #ff8000; }
.tienda-nuevo-circulo + .tienda-oferta-circulo { left: 36px; }

@media(max-width:800px){.slot.slot-tienda{min-height:0;overflow:visible;}}
.tienda-panel-cantidad { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; }
.tienda-panel .tienda-panel-cantidad button { width: 24px; height: 24px; padding: 0; border: 1px solid #ddd; display: grid; place-items: center; line-height: 1; }
.tienda-panel-cantidad span { min-width: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.tienda-panel .tienda-panel-cantidad button:disabled { opacity: .3; cursor: default; }

.tienda-precio-original { display: block; opacity: .5; font-size: .7rem; font-weight: 300; text-decoration: line-through; }
.tienda-compra { align-items: flex-start; }

.carrito-total .tienda-boton { background: #bfff00; color: #111; }
.carrito-total .tienda-boton:hover { background: #ade600; }

.tienda-main h1.carrito-titulo { font-family: 'DM Sans',sans-serif; font-size: 3rem; font-weight: var(--carrito-title-weight,700); line-height: 1.1; font-variant-caps: normal; text-transform: var(--carrito-title-case,none); letter-spacing: normal; word-break: break-word; overflow-wrap: break-word; hyphens: auto; }
.carrito-tabla tfoot td { padding: 20px 8px 0; border-bottom: 0; }
.carrito-tabla tfoot tr + tr td { padding-top: 16px; }
.carrito-tabla .carrito-total { margin: 0; padding: 0; gap: 0; flex-direction: column; align-items: flex-end; }

/* Confirmación: referencia visible, resumen tabulado y pago en columna propia. */
.pedido-header { margin-bottom: 48px; }
.pedido-referencia { margin: 18px 0 0; font-size: 1rem; }
.pedido-referencia strong { font-weight: 600; }
.pedido-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 64px; align-items: start; }
body[data-page="pago"] .pedido-main h2 { margin: 0 0 18px; font-size: 1rem; font-weight: 500; }
.pedido-productos-scroll { overflow-x: auto; }
.pedido-productos { width: 100%; border-collapse: collapse; }
.pedido-productos th { font-size: .75rem; font-weight: 400; color: #666; }
.pedido-productos th, .pedido-productos td { padding: 14px 0; text-align: left; border-bottom: 1px solid #ddd; }
.pedido-productos td:first-child { padding-right: 20px; }
.pedido-productos :is(th,td):nth-child(2) { width: 68px; text-align: center; }
.pedido-productos :is(th,td):last-child { width: 90px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pedido-totales { max-width: 260px; margin: 20px 0 36px auto; }
.pedido-totales > div { display: flex; justify-content: space-between; gap: 24px; padding: 7px 0; }
.pedido-totales > div:last-child { margin-top: 8px; padding-top: 14px; border-top: 1px solid #ddd; font-weight: 600; }
.pedido-totales dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pedido-totales small { font-weight: 400; font-size: .7rem; }
.pedido-detalles { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px; padding-top: 28px; border-top: 1px solid #ddd; }
.pedido-main p { margin: 0 0 16px; }
.pedido-main .pedido-referencia { margin-top: 18px; }
.pedido-pago { border-left: 1px solid #ddd; padding-left: 32px; }
.pedido-pago .transferencia-datos { margin: 24px 0; }
.pedido-pago .transferencia-datos > div { grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); padding: 9px 0; border-bottom: 1px solid #e5e5e5; }
.pedido-pago .transferencia-datos dt { color: #666; }
.pedido-pago .transferencia-datos > div:last-child { font-weight: 600; }
@media(max-width: 800px) {
  .pedido-layout { grid-template-columns: minmax(0,1fr); gap: 36px; }
  .pedido-pago { border-left: 0; border-top: 1px solid #ddd; padding: 28px 0 0; }
}
@media(max-width: 480px) { .pedido-detalles { grid-template-columns: minmax(0,1fr); } }

.webpay-salida-detalle { max-width: 480px; }
.webpay-salida-detalle h2 { margin: 0 0 20px; font-size: 1rem; font-weight: 500; }
.webpay-salida-detalle dl { margin: 0 0 28px; }
.webpay-salida-detalle dl > div { display: flex; justify-content: space-between; gap: 24px; padding: 14px 0; border-bottom: 1px solid #ddd; }
.webpay-salida-detalle dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.webpay-salida-detalle small { font-size: .7rem; font-weight: 300; }
.webpay-salida-detalle p { margin: 0 0 12px; }
.webpay-salida-aviso { color: #666; font-size: .75rem; }
.webpay-salida-detalle form { margin-top: 28px; }
.webpay-salida-detalle button { background: #bfff00; color: #111; }
.webpay-salida-detalle button:hover { background: #ade600; }

.pedido-detalles-sin-envio { grid-template-columns: minmax(0,1fr); }

/* Revisión del carrito antes del pago. */
.carrito-total { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
.carrito-total .carrito-volver-tienda { background: #fff; color: #111; border: 1px solid #111; }
.carrito-total .carrito-volver-tienda:hover { background: #f5f5f5; }

/* Checkout: formulario desplazable a la izquierda y pedido a la derecha. */
body[data-page="checkout"] { margin: 0; }
body[data-page="checkout"] .tienda-main { max-width: 1440px; padding: 72px 40px 16px; }
body[data-page="checkout"] .tienda-header { margin-bottom: 16px; }
body[data-page="checkout"] .tienda-header h1 { font-size: 2rem; }
.checkout-layout { grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); gap: 40px; }
.tienda-checkout { display: block; }
.checkout-form-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.checkout-datos, .checkout-opciones { display: grid; align-content: start; gap: 14px; min-width: 0; }
.checkout-contacto, .checkout-address, [data-factura-campos] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.checkout-contacto > h2, .checkout-address > h2, .checkout-address > p, [data-factura-campos] > h2 { grid-column: 1 / -1; }
.tienda-checkout label { min-width: 0; }
.tienda-checkout input:not([type="radio"]):not([type="hidden"]), .tienda-checkout textarea, .tienda-checkout select { margin-top: 4px; padding: 7px 8px; }
.tienda-checkout fieldset { gap: 9px; min-width: 0; }
.tienda-checkout legend { margin-bottom: 8px; }
.tienda-checkout [data-checkout-reservado] { display: block; }
.checkout-documento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checkout-documento > p, .checkout-documento > [data-factura-campos] { grid-column: 1 / -1; }
.checkout-resumen h2 { margin-bottom: 10px; }
.checkout-resumen li, .checkout-resumen dl div { padding: 7px 0; gap: 10px; }
.checkout-resumen > button { margin-top: 16px; width: 100%; }
@media (max-width: 1000px) {
  body[data-page="checkout"] .tienda-main { padding-right: 24px; padding-left: 24px; }
  .checkout-layout { grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; }
  .checkout-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body[data-page="checkout"] .tienda-main { padding: 80px 20px 32px; }
  body[data-page="checkout"] .tienda-header { align-items: flex-start; }
  .checkout-layout { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 380px) {
  .checkout-contacto, .checkout-address, [data-factura-campos] { grid-template-columns: 1fr; }
}

.checkout-opciones { font-size: .8rem; line-height: 1.3; }
.checkout-opciones fieldset { gap: 7px; }
[data-factura-campos] { gap: 6px 10px; font-size: .75rem; line-height: 1.3; }
.tienda-checkout [data-factura-campos] input { padding: 5px 7px; margin-top: 3px; }

.checkout-resumen li { display: grid; grid-template-columns: 56px minmax(0, 1fr) max-content; align-items: center; gap: 14px; }
.checkout-resumen li > span { overflow-wrap: anywhere; }
.checkout-resumen .checkout-item-precio { white-space: nowrap; }
.checkout-portada { display: block; width: 56px; height: 76px; object-fit: contain; }
.checkout-portada-vacia { background: rgba(0,0,0,.025); }
@media (min-width: 701px) {
  body[data-page="checkout"] .tienda-main { height: 100dvh; min-height: 0; box-sizing: border-box; display: flex; flex-direction: column; }
  body[data-page="checkout"] .tienda-header { flex-shrink: 0; }
  .checkout-layout { flex: 1; min-height: 0; align-items: stretch; }
  .tienda-checkout { overflow-y: auto; min-height: 0; padding-right: 18px; scrollbar-gutter: stable; }
  .tienda-checkout:focus-visible { outline: 1px solid #111; outline-offset: 3px; }
  .checkout-resumen { display: flex; flex-direction: column; min-height: 0; }
  .checkout-resumen > ul { overflow-y: auto; min-height: 0; }
  .checkout-resumen > h2, .checkout-resumen > dl, .checkout-resumen > button { flex-shrink: 0; }
}

/* Selección única con controles cuadrados y documento junto al pago. */
.checkout-choice input[type="radio"] { appearance: none; -webkit-appearance: none; display: grid; place-content: center; flex: 0 0 14px; width: 14px; height: 14px; margin: 2px 0 0; border: 1px solid #111; border-radius: 0; background: #fff; cursor: pointer; }
.checkout-choice input[type="radio"]:checked { background: #111; }
.checkout-choice input[type="radio"]:checked::after { content: ''; width: 3px; height: 7px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checkout-choice input[type="radio"]:focus-visible { outline: 2px solid #111; outline-offset: 3px; }
.checkout-choice input[type="radio"]:disabled { opacity: .35; cursor: not-allowed; }
.checkout-documento-pago { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; border-top: 1px solid #ddd; padding-top: 16px; }
.checkout-pago { min-width: 0; }
@media (max-width: 1000px) and (min-width: 701px), (max-width: 480px) {
  .checkout-documento-pago { grid-template-columns: 1fr; }
}

.tienda-producto .tienda-precio { white-space: normal; max-width: 145px; }
.pedido-descargas .tienda-boton, .pedido-descargas-aviso .tienda-boton { color: #fff; }

/* Presentaciones de un mismo producto */
.tienda-compra { flex-direction: column; gap: 6px; }
.tienda-variante { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.tienda-formato { display: block; }
.producto-variante { margin: 0 0 20px; }
.producto-variante .producto-precio { margin: 0 0 8px; }
.producto-variante .producto-disponibilidad { margin: 0; }

/* Desglose de ofertas en carrito y pedido. */
.tienda-ofertas, [data-tienda-panel-ofertas], [data-carrito-ofertas] { margin: 12px 0; }
.tienda-ofertas ul, [data-tienda-panel-ofertas] ul, [data-carrito-ofertas] ul { list-style: none; margin: 6px 0; padding: 0; }
.checkout-resumen .tienda-ofertas li { display: block; padding: 2px 0; border: 0; }
[data-tienda-panel-ofertas] p { margin: 4px 0; }
