/* =============================================================================
   Carrito (2026-10-15) — ajuste ligero hacia el lenguaje de la ficha de producto:
   texto más pequeño, títulos Outfit finos, referencia en mayúsculas pequeñas,
   pastillas con borde suave, selector de cantidad − n +, botones azul marino.
   Solo CSS sobre el marcado existente (no se tocan clases que usa el refresco AJAX).
   Se carga en head.tpl solo en page_name == 'cart'. custom.css usa !important → aquí también.
   ============================================================================= */
body#cart {
  --mlct-ink: #101215; --mlct-txt: #3c4654; --mlct-mut: #64748b; --mlct-lbl: #8a949c;
  --mlct-act: #1d2a55; --mlct-acth: #3750a3; --mlct-soft: #f4f5f8; --mlct-line: #e6eaf0;
}
body#cart #wrapper, body#cart #content-wrapper { background: #f8f8fa !important; }
body#cart .mlct-ico { width: 18px; height: 18px; flex: none; vertical-align: middle; }
body#cart .mlct-ico--xl { width: 48px; height: 48px; color: var(--mlct-lbl); }

/* Bloques: blancos, sin cabeceras de color */
body#cart .modern-products-section,
body#cart .modern-cart-content { background: #fff !important; border: 0 !important; border-radius: 10px !important; box-shadow: none !important; overflow: hidden; }

/* Aviso de envío gratis: franja suave en lugar del bloque verde */
body#cart .modern-products-header.free_shipping_container,
body#cart .modern-products-title.free_shipping_container,
body#cart .free_shipping_container { background: #fff8e0 !important; color: var(--mlct-ink) !important; }
body#cart .free_shipping_container.ship_free,
body#cart .modern-products-header:has(.ship_free) { background: #e8f5ee !important; }
body#cart .modern-products-header:has(.free_shipping_container) { background: transparent !important; padding: 0 !important; border: 0 !important; }
body#cart .free_shipping_container,
body#cart .free_shipping_container h2 { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: 0 !important; padding: .7rem 1.25rem !important; font-family: inherit !important; font-size: .9rem !important; font-weight: 400 !important; line-height: 1.4 !important; text-transform: none !important; }
body#cart .free_shipping_container h2 { padding: 0 !important; background: transparent !important; }
body#cart .free_shipping_container strong { color: #b63d45 !important; }
body#cart .free_shipping_container.ship_free { color: #17663a !important; }

/* Línea de producto */
body#cart .modern-product-card { border-color: var(--mlct-line) !important; }
body#cart .modern-product-image,
body#cart .modern-product-image img { border-radius: 8px !important; }
body#cart .modern-product-image { border: 1px solid var(--mlct-line) !important; background: #fff; }
body#cart .modern-product-title,
body#cart .modern-product-title a { font-family: Outfit, sans-serif !important; font-size: .95rem !important; font-weight: 400 !important; line-height: 1.35 !important; color: var(--mlct-ink) !important; text-transform: none !important; }
body#cart .modern-product-title a:hover { color: var(--mlct-acth) !important; }
body#cart .modern-product-ref { margin-top: 2px; font-size: 10px !important; letter-spacing: .12em; text-transform: uppercase; color: var(--mlct-lbl) !important; }
body#cart .modern-product-ref::before { content: "Ref. "; }
body#cart .modern-attribute-tag { display: inline-flex; align-items: center; padding: 2px 10px !important; border: 1px solid #dbe1eb !important; border-radius: 999px !important; background: #fff !important; color: var(--mlct-txt) !important; font-size: 11px !important; font-weight: 400 !important; }
body#cart .modern-product-availability span { font-size: 11px !important; font-weight: 400 !important; }

/* Precios */
body#cart .modern-product-total { font-size: 1rem !important; font-weight: 600 !important; color: var(--mlct-ink) !important; }
body#cart .modern-product-unit, body#cart .modern-product-unit-alt { font-size: 11px !important; color: var(--mlct-mut) !important; }

/* Eliminar: papelera gris (antes círculo rojo con texto) */
body#cart .modern-remove-btn,
body#cart .modern-remove-btn-compact { display: inline-flex !important; align-items: center; justify-content: center; width: 34px !important; height: 34px !important; padding: 0 !important; border: 0 !important; border-radius: 8px !important; background: transparent !important; color: var(--mlct-lbl) !important; box-shadow: none !important; font-size: 0 !important; }
body#cart .modern-remove-btn:hover,
body#cart .modern-remove-btn-compact:hover { background: #fdf0f0 !important; color: #c0392b !important; }

/* Cantidad: − n + horizontal como en la ficha (TouchSpin intacto, solo se recoloca) */
body#cart .bootstrap-touchspin { display: inline-flex !important; align-items: stretch; width: auto !important; height: 40px; border: 1px solid #dbe1eb !important; border-radius: 8px !important; background: #fff; overflow: hidden; }
body#cart .bootstrap-touchspin .input-group-addon { display: none !important; }
body#cart .bootstrap-touchspin .input-group-btn-vertical { display: contents !important; }
body#cart .bootstrap-touchspin input.js-cart-line-product-quantity { order: 2; width: 40px !important; height: 38px !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; text-align: center; font-size: 14px !important; font-weight: 500; color: var(--mlct-ink) !important; -moz-appearance: textfield; }
body#cart .bootstrap-touchspin input.js-cart-line-product-quantity::-webkit-inner-spin-button,
body#cart .bootstrap-touchspin input.js-cart-line-product-quantity::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
body#cart .bootstrap-touchspin .bootstrap-touchspin-down { order: 1; }
body#cart .bootstrap-touchspin .bootstrap-touchspin-up { order: 3; }
body#cart .bootstrap-touchspin .btn-touchspin { position: static !important; display: inline-flex !important; align-items: center; justify-content: center; width: 34px !important; height: 38px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; color: var(--mlct-ink) !important; box-shadow: none !important; }
body#cart .bootstrap-touchspin .btn-touchspin:hover { background: var(--mlct-soft) !important; }
body#cart .bootstrap-touchspin .btn-touchspin i { display: none !important; }
body#cart .bootstrap-touchspin .btn-touchspin::before { content: ""; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--mlct-ico) center / contain no-repeat; mask: var(--mlct-ico) center / contain no-repeat; }
body#cart .bootstrap-touchspin .bootstrap-touchspin-down::before { --mlct-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12h16' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
body#cart .bootstrap-touchspin .bootstrap-touchspin-up::before { --mlct-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12h16M12 4v16' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* Resumen: cabecera blanca con título fino (antes barra azul) */
body#cart .modern-cart-header { background: #fff !important; color: var(--mlct-ink) !important; border: 0 !important; padding: 1rem 1.5rem !important; }
body#cart .modern-cart-header h1 { display: flex; align-items: baseline; gap: .5rem; margin: 0 !important; font-family: Outfit, sans-serif !important; font-size: 1.35rem !important; font-weight: 200 !important; color: var(--mlct-ink) !important; text-transform: none !important; }
body#cart .modern-cart-header h1 small { font-size: .8rem !important; color: var(--mlct-mut) !important; }
body#cart .modern-summary-line { font-size: .88rem !important; }
body#cart .modern-summary-label { color: var(--mlct-txt) !important; }
body#cart .modern-summary-value { color: var(--mlct-ink) !important; font-weight: 500 !important; }
body#cart .modern-summary-line.total-line { margin-top: .25rem; border-top: 1px solid var(--mlct-line) !important; }
body#cart .modern-summary-line.total-line .modern-summary-label { font-family: Outfit, sans-serif; font-size: 1.05rem !important; font-weight: 400 !important; color: var(--mlct-ink) !important; }
body#cart .modern-summary-line.total-line .modern-summary-value { font-size: 1.25rem !important; font-weight: 600 !important; }

/* Botones: estética de «Añadir al carrito» */
body#cart .modern-checkout-btn { display: flex !important; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: 0 1rem !important; border: 1px solid var(--mlct-act) !important; border-radius: 8px !important; background: var(--mlct-act) !important; color: #fff !important; box-shadow: none !important; font-size: 12px !important; font-weight: 500 !important; letter-spacing: .1em; text-transform: uppercase; text-decoration: none !important; transition: background .2s, border-color .2s; }
body#cart .modern-checkout-btn:hover { background: var(--mlct-acth) !important; border-color: var(--mlct-acth) !important; color: #fff !important; }
body#cart .modern-checkout-btn .mlct-ico { width: 17px; height: 17px; }
body#cart a.modern-checkout-btn.mlct-continue { min-height: 42px; margin-top: .5rem !important; background: #fff !important; border-color: #d4dce6 !important; color: var(--mlct-ink) !important; }
body#cart a.modern-checkout-btn.mlct-continue:hover { background: var(--mlct-soft) !important; color: var(--mlct-ink) !important; }

/* Código promocional y guardar carrito: bloques planos dentro del resumen */
body#cart .modern-promo-section,
body#cart #saved-carts-section .card,
body#cart .modern-cart-summary .card { background: transparent !important; border: 0 !important; border-top: 1px solid var(--mlct-line) !important; border-radius: 0 !important; box-shadow: none !important; padding: 1rem 0 0 !important; margin-top: 1rem !important; }
body#cart .modern-promo-header,
body#cart .modern-cart-summary .card-title { display: flex; align-items: center; gap: .45rem; margin: 0 0 .6rem !important; font-family: inherit !important; font-size: .85rem !important; font-weight: 600 !important; color: var(--mlct-ink) !important; }
body#cart .modern-promo-header .mlct-ico { display: inline-block !important; width: 16px; height: 16px; color: var(--mlct-act); }
body#cart .modern-cart-summary .card-text { font-size: .78rem !important; color: var(--mlct-mut) !important; }
body#cart .modern-promo-input,
body#cart #cart-name { height: 42px !important; padding: 0 .85rem !important; border: 1px solid #dbe1eb !important; border-radius: 8px !important; background: #fff !important; box-shadow: none !important; font-size: .85rem !important; text-align: left !important; }
body#cart .modern-promo-input::placeholder,
body#cart #cart-name::placeholder { font-size: .85rem !important; }
body#cart .modern-promo-btn,
body#cart #save-cart-btn { min-height: 42px !important; padding: 0 1rem !important; border-radius: 8px !important; background: var(--mlct-act) !important; color: #fff !important; box-shadow: none !important; font-size: 12px !important; font-weight: 500 !important; letter-spacing: .1em; text-transform: uppercase; }
body#cart .modern-cart-summary .view-carts-btn { width: 100%; margin-top: .5rem; min-height: 38px; border: 1px solid #d4dce6 !important; border-radius: 8px !important; background: #fff !important; color: var(--mlct-ink) !important; font-size: .8rem !important; }
body#cart .modern-cart-summary .view-carts-btn:hover { background: var(--mlct-soft) !important; }
body#cart .modern-voucher-remove { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--mlct-mut); }
body#cart .modern-voucher-remove:hover { background: #fdf0f0; color: #c0392b; }

/* Carrito vacío */
body#cart .modern-empty-title { font-family: Outfit, sans-serif !important; font-weight: 200 !important; font-size: 1.5rem !important; }
body#cart .modern-continue-shopping { display: inline-flex !important; align-items: center; gap: .45rem; border-radius: 8px !important; background: var(--mlct-act) !important; color: #fff !important; font-size: 12px !important; font-weight: 500 !important; letter-spacing: .1em; text-transform: uppercase; }

@media (prefers-reduced-motion: reduce) {
  body#cart .modern-checkout-btn { transition: none; }
}

/* El aviso móvil de envío gratis no debe verse en escritorio (la regla display:flex de arriba pisaba .mobile-only) */
body#cart .free_shipping_container.mobile-only { display: none !important; }
@media (max-width: 991px) { body#cart .free_shipping_container.mobile-only { display: flex !important; } }

/* El aviso ocupa el ancho de la tarjeta sin invadir su cabecera. */
@media (max-width: 991px) {
  body#cart .modern-cart-summary { --mlct-summary-gutter: 2rem; padding-top: 1rem !important; }
  body#cart #shipping_container_mobile {
    width: auto !important;
    margin: 0 calc(0px - var(--mlct-summary-gutter)) !important;
  }
  body#cart #shipping_container_mobile + .modern-products-section-integrated { margin-top: 1rem !important; padding-top: 0 !important; }
}
@media (max-width: 768px) {
  body#cart .modern-cart-summary { --mlct-summary-gutter: 1.5rem; }
}
@media (max-width: 480px) {
  body#cart .modern-cart-summary { --mlct-summary-gutter: 1rem; }
}
@media (max-width: 599px) {
  body#cart #shipping_container_mobile {
    margin: -1rem calc(0px - var(--mlct-summary-gutter)) 0 !important;
  }
}
@media (max-width: 767px) {
  body#cart .modern-promo-form { align-items: stretch; }
  body#cart .modern-promo-input {
    flex: 0 0 auto !important;
    min-height: 42px !important;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Envío gratis no alcanzado: importe en rojo suave + barra de progreso fina */
body#cart .free_shipping_container,
body#cart .free_shipping_container h2 { flex-wrap: wrap; column-gap: .35rem !important; row-gap: .45rem !important; }
body#cart .mlct-ship-amt { color: #b63d45 !important; font-weight: 600 !important; }
body#cart .mlct-ship-bar { flex: 0 0 100%; max-width: 360px; height: 4px; border-radius: 999px; background: rgba(16, 18, 21, .08); overflow: hidden; }
body#cart .mlct-ship-bar i { display: block; height: 100%; border-radius: inherit; background: #e0a800; transition: width .4s cubic-bezier(.22,.7,.2,1); }

/* Lista móvil: TouchSpin en horizontal (botones con texto «-»/«+» dentro de .input-group-btn) */
body#cart .bootstrap-touchspin .input-group-btn { display: contents !important; }
body#cart .bootstrap-touchspin .btn-touchspin { font-size: 0 !important; line-height: 0 !important; }
body#cart .bootstrap-touchspin .input-group-btn:first-child .btn-touchspin::before { --mlct-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12h16' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
body#cart .bootstrap-touchspin .input-group-btn:first-child { order: 1; }
body#cart .bootstrap-touchspin .input-group-btn:last-child .btn-touchspin::before { --mlct-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12h16M12 4v16' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
body#cart .bootstrap-touchspin .input-group-btn:last-child .btn-touchspin { order: 3; }
body#cart .bootstrap-touchspin .input-group-btn:first-child .btn-touchspin { order: 1; }

/* Lista compacta (≤991px): el tema fijaba las filas (30px 20px 0) y el texto se montaba */
body#cart .modern-product-layout-compact { grid-template-rows: auto auto auto auto !important; row-gap: 4px !important; align-items: start; }
body#cart .modern-product-title-compact { min-width: 0; }

/* 768–991px: el tema no definía áreas para la lista compacta y todo se apilaba (fallo previo). Mismas áreas que en móvil. */
@media (min-width: 768px) and (max-width: 991px) {
  body#cart .modern-product-layout-compact {
    grid-template-areas:
      "imagen nombre nombre nombre nombre borrar"
      "imagen disponibilidad disponibilidad disponibilidad nada2 nada2"
      "imagen referencia referencia variante variante variante"
      "cantidad cantidad cantidad nada precio precio" !important;
    grid-template-columns: 60px repeat(3, minmax(0, 1fr)) minmax(0, 1fr) 34px !important;
    column-gap: 12px !important;
  }
  body#cart .modern-product-image-compact { grid-area: imagen; }
}

/* 2026-10-16 (v8): el resumen se separaba de su cabecera y la columna blanca se estiraba vacía con muchos productos.
   La columna entera (.modern-cart-content: cabecera + resumen) es UNA tarjeta sticky del alto de su contenido. */
body#cart .modern-cart-summary { position: static !important; top: auto !important; }
@media (min-width: 1120px) {
  body#cart .modern-cart-grid { align-items: start; }
  body#cart .modern-cart-content { position: sticky; top: 120px; align-self: start; overflow: visible; }
}

/* 23/11/2026: botón exprés de Stripe a todo el ancho (como «Finalizar pedido») y con el mismo radio de 8px */
body#cart #stripe-express-checkout-element { width: 100%; max-width: none !important; border-radius: 8px; overflow: hidden; }
