/* mlcartpanel — panel lateral del carrito (Masterled, 2026-10-16). Lenguaje del rediseño master_beta. */
.mlcp {
  --mlcp-ink: #1d2a55;
  --mlcp-ink-2: #3750a3;
  --mlcp-text: #1a2332;
  --mlcp-muted: #687184;
  --mlcp-line: #e6e9ee;
  --mlcp-soft: #f7f7f9;
  --mlcp-ok: #1a9e55;
  position: fixed;
  inset: 0;
  z-index: 100050;
}
.mlcp[hidden] { display: none; }
/* 23/11/2026: solo en html (va a la ventana). Con overflow:hidden también en body, body pasaba a ser la zona de scroll y
   la cabecera fija (sticky) se soltaba: al abrir el panel con la página bajada, desaparecía */
html.mlcp-lock { overflow: hidden; }
html.mlcp-lock body { overflow: visible !important; }
html.mlcp-lock .mlchat-btn { visibility: hidden; } /* el botón del chat tapaba el panel */

.mlcp__overlay { position: absolute; inset: 0; background: rgba(15, 20, 35, .45); opacity: 0; transition: opacity .3s ease; cursor: pointer; }
.mlcp__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  background: #fff;
  color: var(--mlcp-text);
  box-shadow: -18px 0 40px -20px rgba(15, 20, 35, .45);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.22, .7, .2, 1);
  outline: none;
  font-size: 14px;
  line-height: 1.45;
}
.mlcp.is-open .mlcp__overlay { opacity: 1; }
.mlcp.is-open .mlcp__panel { transform: none; }
.mlcp__body { display: flex; flex-direction: column; min-height: 0; height: 100%; }

.mlcp__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 16px; border-bottom: 1px solid var(--mlcp-line); }
.mlcp__ok { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--mlcp-text); font-size: 16px; font-weight: 500; }
.mlcp__ok svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--mlcp-ok); }
.mlcp__close { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--mlcp-line); border-radius: 50%; background: #fff; color: var(--mlcp-ink); cursor: pointer; }
.mlcp__close:hover { border-color: var(--mlcp-ink); }
.mlcp__close svg { width: 18px; height: 18px; }

.mlcp__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 24px; }

.mlcp__added { display: flex; gap: 14px; align-items: flex-start; }
.mlcp__added-img { flex: 0 0 84px; width: 84px; height: 84px; object-fit: contain; border-radius: 8px; background: var(--mlcp-soft); }
.mlcp__added-info { flex: 1 1 auto; min-width: 0; }
.mlcp__added-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--mlcp-text); font-size: 14px; font-weight: 500; line-height: 1.35; text-decoration: none; }
.mlcp__added-name:hover { color: var(--mlcp-ink-2); }
.mlcp__added-attrs { margin: 4px 0 0; color: var(--mlcp-muted); font-size: 12px; }
.mlcp__added-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 0 0; color: var(--mlcp-muted); font-size: 13px; }
.mlcp__added-meta strong { color: var(--mlcp-text); }
.mlcp__added-price { font-size: 16px; }

.mlcp__summary { margin-top: 18px; padding: 14px 16px; border-radius: 10px; background: var(--mlcp-soft); }
.mlcp__subtotal { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; }
.mlcp__subtotal strong { font-size: 17px; color: var(--mlcp-text); }
.mlcp__ship { margin-top: 10px; }
.mlcp__ship p { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--mlcp-text); font-size: 13px; }
.mlcp__ship p svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--mlcp-ink); }
.mlcp__ship.is-free p, .mlcp__ship.is-free p svg { color: var(--mlcp-ok); font-weight: 500; }
.mlcp__bar { display: block; height: 6px; overflow: hidden; border-radius: 99px; background: #e3e6eb; }
.mlcp__bar i { display: block; height: 100%; border-radius: inherit; background: var(--mlcp-ink); transition: width .5s ease; }
.mlcp__ship.is-free .mlcp__bar i { background: var(--mlcp-ok); }

.mlcp__actions { display: grid; gap: 10px; margin-top: 16px; }
.mlcp__btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 18px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.mlcp__btn--primary { border: 0; background: var(--mlcp-ink); color: #fff; }
.mlcp__btn--primary:hover, .mlcp__btn--primary:focus { background: var(--mlcp-ink-2); color: #fff; text-decoration: none; }
.mlcp__btn--ghost { border: 1px solid var(--mlcp-ink); background: #fff; color: var(--mlcp-ink); }
.mlcp__btn--ghost:hover { background: var(--mlcp-soft); }

.mlcp__more { margin-top: 26px; }
.mlcp__more-title { margin: 0 0 12px; color: var(--mlcp-text); font-size: 15px; font-weight: 500; text-transform: none; }
.mlcp__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.mlcp__card { display: flex; flex-direction: column; min-width: 0; padding: 10px; border: 1px solid var(--mlcp-line); border-radius: 10px; background: #fff; }
.mlcp__card-img { position: relative; display: block; aspect-ratio: 1 / 1; margin-bottom: 8px; overflow: hidden; border-radius: 8px; background: var(--mlcp-soft); }
.mlcp__card-img img { width: 100%; height: 100%; object-fit: contain; }
.mlcp__tag { position: absolute; top: 6px; left: 6px; z-index: 1; padding: 3px 7px; border-radius: 99px; background: #ffdd00; color: var(--mlcp-ink); font-size: 10px; font-weight: 600; letter-spacing: .02em; }
.mlcp__card-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 2.6em; color: var(--mlcp-text); font-size: 12.5px; line-height: 1.3; text-decoration: none; }
.mlcp__card-name:hover { color: var(--mlcp-ink-2); }
.mlcp__card-attrs { display: block; margin-top: 2px; overflow: hidden; color: var(--mlcp-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mlcp__vsel {
  display: block;
  width: 100%;
  height: 32px;
  margin: 6px 0 0;
  padding: 0 26px 0 8px;
  border: 1px solid var(--mlcp-line);
  border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d2a55' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center / 13px;
  color: var(--mlcp-text);
  font: inherit;
  font-size: 12px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.mlcp__vsel:focus { border-color: var(--mlcp-ink); outline: none; box-shadow: 0 0 0 2px rgba(29, 42, 85, .12); }
.mlcp__add:disabled:not(.is-done) { opacity: .45; cursor: not-allowed; }
.mlcp__add:disabled:not(.is-done):hover { background: #fff; color: var(--mlcp-ink); }
.mlcp__card-price { display: block; margin: 6px 0 8px; color: var(--mlcp-text); font-size: 14px; font-weight: 600; }
.mlcp__card-price s { margin-right: 4px; color: var(--mlcp-muted); font-size: 11px; font-weight: 400; }
.mlcp__add { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; margin-top: auto; padding: 0 10px; border: 1px solid var(--mlcp-ink); border-radius: 8px; background: #fff; color: var(--mlcp-ink); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background-color .2s ease, color .2s ease; }
.mlcp__add:hover, .mlcp__add:focus { background: var(--mlcp-ink); color: #fff; text-decoration: none; }
.mlcp__add svg { width: 15px; height: 15px; }
.mlcp__add-label, .mlcp__add-done { display: inline-flex; align-items: center; gap: 6px; }
.mlcp__add-done { display: none; }
.mlcp__add.is-loading { opacity: .6; pointer-events: none; }
.mlcp__add.is-done { border-color: var(--mlcp-ok); background: var(--mlcp-ok); color: #fff; pointer-events: none; }
.mlcp__add.is-done .mlcp__add-label { display: none; }
.mlcp__add.is-done .mlcp__add-done { display: inline-flex; }
.mlcp__add--link { border-color: var(--mlcp-line); color: var(--mlcp-text); }

/* Cabecera: tick + «Ver carro» + cerrar; cupón flotante (30/10/2026) */
.mlcp__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mlcp__head-r { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.mlcp__pill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: 1px solid var(--mlcp-line); border-radius: 99px; background: #fff; color: var(--mlcp-ink); font-size: 13px; font-weight: 500; text-decoration: none; }
.mlcp__pill:hover, .mlcp__pill:focus { border-color: var(--mlcp-ink); color: var(--mlcp-ink); text-decoration: none; }
.mlcp__pill svg { width: 17px; height: 17px; }
.mlcp__voucher { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; color: var(--mlcp-ok); font-size: 13px; }
.mlcp__voucher-del { margin-left: 4px; padding: 0 4px; border: 0; background: none; color: var(--mlcp-muted); font-size: 16px; line-height: 1; cursor: pointer; }
.mlcp__voucher-del:hover { color: var(--mlcp-ink); }
.mlcp__coupon { position: absolute; left: 50%; bottom: 16px; z-index: 2; transform: translateX(-50%); max-width: calc(100% - 32px); }
.mlcp__coupon.is-open { left: 16px; right: 16px; transform: none; }
.mlcp__coupon-pill { height: 38px; padding: 0 18px; border: 0; border-radius: 99px; background: var(--mlcp-ink); color: #fff; font: inherit; font-size: 13px; font-weight: 500; box-shadow: 0 6px 18px -6px rgba(15, 20, 35, .45); cursor: pointer; }
.mlcp__coupon-pill:hover { background: var(--mlcp-ink-2); }
.mlcp__coupon-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--mlcp-line); border-radius: 12px; background: #fff; box-shadow: 0 10px 28px -10px rgba(15, 20, 35, .45); }
.mlcp__coupon-form[hidden] { display: none; }
.mlcp__coupon-form input { flex: 1 1 140px; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--mlcp-line); border-radius: 8px; font: inherit; font-size: 14px; }
.mlcp__coupon-form input:focus { border-color: var(--mlcp-ink); outline: none; }
.mlcp__coupon-apply { height: 38px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--mlcp-ink); color: #fff; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.mlcp__coupon-apply:disabled { opacity: .6; }
.mlcp__coupon-x { width: 32px; height: 32px; padding: 0; border: 0; background: none; color: var(--mlcp-muted); font-size: 20px; cursor: pointer; }
.mlcp__coupon-msg { flex-basis: 100%; margin: 0; color: var(--mlcp-ok); font-size: 12px; }
.mlcp__coupon-msg.is-error { color: #c0392b; }
.mlcp__mycoupons { flex-basis: 100%; font-size: 13px; }
.mlcp__mycoupons summary { color: var(--mlcp-ink); font-weight: 500; cursor: pointer; }
.mlcp__mycoupons ul { display: grid; gap: 6px; max-height: 180px; margin: 8px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.mlcp__mycoupon { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 1px dashed var(--mlcp-ink); border-radius: 8px; background: var(--mlcp-soft); color: var(--mlcp-text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.mlcp__mycoupon:hover { background: #fff; }
.mlcp__mycoupon em { flex: none; color: var(--mlcp-ok); font-style: normal; font-weight: 600; }
.mlcp__scroll { padding-bottom: 72px; } /* que la píldora no tape lo último */

/* «Compra tu carrito en 1 paso» (pago exprés de Stripe del carrito) */
.mlcp__express { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--mlcp-line); }
.mlcp__express[hidden] { display: none; }
.mlcp__express-t { margin: 0 0 8px; color: var(--mlcp-text); font-size: 13px; font-weight: 500; text-align: center; }
.mlcp__express-err { margin: 8px 0 0; color: #c0392b; font-size: 12px; }

/* Versión B: líneas del carrito con cantidad y borrar (30/10/2026) */
.mlcp__lines { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.mlcp__line { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--mlcp-line); }
.mlcp__line:last-child { padding-bottom: 0; border-bottom: 0; }
/* Lista plegable (B tras añadir): producto añadido + medio siguiente, con fundido y círculo con chevron */
.mlcp__lines { overflow: hidden; transition: max-height .4s cubic-bezier(.22, .7, .2, 1); }
.mlcp__lines.is-folded { -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.mlcp__fold { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: -18px auto 0; padding: 0;
  border: 1px solid var(--mlcp-line); border-radius: 50%; background: #fff; color: var(--mlcp-ink); box-shadow: 0 4px 12px -4px rgba(15, 20, 35, .3); cursor: pointer; }
.mlcp__fold:hover { border-color: var(--mlcp-ink); }
.mlcp__fold svg { width: 18px; height: 18px; transition: transform .3s ease; }
.mlcp__fold.is-open { margin-top: 8px; }
.mlcp__fold.is-open svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .mlcp__lines, .mlcp__fold svg { transition: none; } }
.mlcp__line.is-added .mlcp__line-img { box-shadow: 0 0 0 2px var(--mlcp-ok); }
.mlcp__line-img { flex: 0 0 64px; width: 64px; height: 64px; overflow: hidden; border-radius: 8px; background: var(--mlcp-soft); }
.mlcp__line-img img { width: 100%; height: 100%; object-fit: contain; }
.mlcp__line-info { flex: 1 1 auto; min-width: 0; }
.mlcp__line-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.mlcp__line-total { margin-left: auto; color: var(--mlcp-text); font-size: 15px; }
.mlcp__qty { display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--mlcp-line); border-radius: 8px; }
.mlcp__qty-btn { width: 30px; height: 100%; padding: 0; border: 0; background: none; color: var(--mlcp-ink); font: inherit; font-size: 16px; cursor: pointer; }
.mlcp__qty-btn:hover { background: var(--mlcp-soft); }
.mlcp__qty-btn:disabled, .mlcp__del:disabled { opacity: .45; cursor: progress; }
.mlcp__qty-n { min-width: 26px; text-align: center; font-weight: 500; }
.mlcp__del { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--mlcp-muted); cursor: pointer; }
.mlcp__del:hover { background: var(--mlcp-soft); color: var(--mlcp-ink); }
.mlcp__del svg { width: 18px; height: 18px; }
.mlcp__empty { margin: 8px 0 0; color: var(--mlcp-muted); }

.mlcp__loading { display: flex; flex: 1 1 auto; align-items: center; justify-content: center; min-height: 240px; }
.mlcp__loading span { width: 28px; height: 28px; border: 2px solid var(--mlcp-line); border-top-color: var(--mlcp-ink); border-radius: 50%; animation: mlcp-spin .8s linear infinite; }
@keyframes mlcp-spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  .mlcp__panel { width: 100%; }
  .mlcp__head { padding: 14px 16px 12px; }
  .mlcp__scroll { padding: 16px 16px 22px; }
  .mlcp__actions { grid-template-columns: 1fr; }
}
@media (min-width: 521px) {
  .mlcp__actions { grid-template-columns: 1fr 1fr; }
  .mlcp__btn--primary { order: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .mlcp__panel, .mlcp__overlay, .mlcp__bar i { transition: none; }
}

/* --------------------------------------------------------------------------
   Bloque «Completa tu pedido» en el carrito (v1.3.0). Reutiliza las tarjetas .mlcp__card.
   .mlxs lleva también la clase .mlcp para heredar las variables, pero NO es fixed (se anula aquí).
   -------------------------------------------------------------------------- */
.mlcp.mlxs { position: static; inset: auto; z-index: auto; margin: 28px 0 8px; padding: 22px 22px 18px; border-radius: 12px; background: #fff; }
.mlcp.mlxs:empty { display: none; }
.mlxs__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 14px; }
.mlxs__title { margin: 0; padding: 0; color: var(--mlcp-text); font-size: 20px; font-weight: 300; letter-spacing: -.2px; text-transform: none; }
.mlxs__sub { margin: 0; color: var(--mlcp-muted); font-size: 13px; }
.mlxs__nav { display: flex; gap: 6px; margin-left: auto; }
.mlxs__arrow { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--mlcp-line); border-radius: 50%; background: #fff; color: var(--mlcp-ink); cursor: pointer; }
.mlxs__arrow:hover { border-color: var(--mlcp-ink); }
.mlxs__arrow svg { width: 16px; height: 16px; }
.mlxs .mlxs__row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(176px, calc((100% - 50px) / 6)); grid-template-columns: none; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: 6px; }
.mlxs .mlcp__card { scroll-snap-align: start; }
.mlcp__tag--free { background: #1a9e55; color: #fff; }
.mlcp__card-why { display: block; margin: 0 0 4px; overflow: hidden; color: var(--mlcp-muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 991px) { .mlxs .mlxs__row { grid-auto-columns: minmax(160px, calc((100% - 30px) / 4)); } }
@media (max-width: 575px) {
  .mlcp.mlxs { padding: 18px 14px 14px; margin-top: 20px; }
  .mlxs .mlxs__row { grid-auto-columns: 46%; }
  .mlxs__nav { display: none; }
}
/* carrusel del carrito sin barra de desplazamiento (flechas, arrastre y táctil) */
.mlxs .mlxs__row { scrollbar-width: none; -ms-overflow-style: none; }
.mlxs .mlxs__row::-webkit-scrollbar { display: none; }

/* 13/11/2026: aviso de imprescindibles que faltan (panel y página del carrito) */
.mlcp__more-title--alert, .mlxs__title.mlcp__more-title--alert { color: #c62828; font-weight: 600; }
.mlcp__more-title--alert::before { content: "!"; display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin-right: .45em; border-radius: 50%; background: #c62828; color: #fff; font-size: .8em; font-weight: 700; vertical-align: .08em; }

/* 19/11/2026 · Línea recién añadida: el marco verde se recortaba (box-shadow fuera de la caja y .mlcp__lines con overflow:hidden);
   ahora es un contorno por dentro. */
.mlcp__line.is-added .mlcp__line-img { box-shadow: none; outline: 2px solid var(--mlcp-ok); outline-offset: -2px; }
/* Una sola variante: se indica como texto, sin selector (mismo alto que el selector para no descuadrar la rejilla) */
.mlcp__vone { display: block; height: 32px; margin: 6px 0 0; overflow: hidden; color: var(--mlcp-muted); font-size: 12px; line-height: 32px; text-overflow: ellipsis; white-space: nowrap; }
/* «Añadir» con los colores del botón «Añadir al carrito» de la ficha (#1d2a55 / blanco; hover #3750a3) */
.mlcp__add:not(.mlcp__add--link):not(.is-done) { border-color: var(--mlcp-ink); background: var(--mlcp-ink); color: #fff; }
.mlcp__add:not(.mlcp__add--link):not(.is-done):hover, .mlcp__add:not(.mlcp__add--link):not(.is-done):focus { border-color: var(--mlcp-ink-2); background: var(--mlcp-ink-2); color: #fff; }
.mlcp__add:not(.mlcp__add--link):disabled:not(.is-done):hover { border-color: var(--mlcp-ink); background: var(--mlcp-ink); }

/* 23/11/2026: en móvil el panel empieza justo bajo la cabecera (--ml-hdr-b lo pone header-mobile.tpl; en escritorio no
   existe y queda en 0, como antes) */
.mlcp { top: var(--ml-hdr-b, 0px); }

/* 23/11/2026: botón exprés a todo el ancho del panel y con el radio de los botones (8px) */
/* 04/12/2026: sin overflow:hidden. El contenedor mide 0 px hasta que Stripe pinta los botones, y Stripe no los pinta si
   no ven el elemento: con overflow:hidden se quedaba vacío. Las esquinas ya las redondea Stripe (borderRadius 8px). */
.mlcp__express-btn { width: 100%; max-width: none; border-radius: 8px; }
