/* Tarjetas de compra de las guías (S85, 27-oct-2026). Las pinta js/compra-guias.js con los datos vivos de la tienda.
   Solo tokens de system.css; prefijo .mc. Firma: el envase de la tienda (foto sobre blanco) se «posa» con multiply sobre la
   pared salvia y la peana de piedra de las imágenes de las guías.
   Variantes (sorteo en cada visita de página): A estante · B por perfil · D la tabla que se compra. E barra fija: siempre. */
:root {
  --mc-pared:  #E9EFE7;
  --mc-piedra: #E6DDCF;
  --mc-sombra: rgba(31,42,36,.26);
  --mc-barra-h: 0px;
}
.mc { font-family: var(--ff-ui); color: var(--ink); line-height: 1.45; overflow-wrap: normal; }
.mc *, .mc *::before, .mc *::after { box-sizing: border-box; }
.mc a, .article-content .mc a { color: inherit; text-decoration: none; }
.mc p { margin: 0; color: inherit; }
.mc ul, .mc ol { margin: 0; padding: 0 !important; list-style: none; }
.mc li + li { margin-top: 0 !important; }
.mc li::before, .mc li::marker { content: none; }
.mc-i { display: block; flex: none; width: 18px; height: 18px; }
.mc-marca { font-size: .62rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* La peana: el borde de la piedra está al 67 % del alto; la foto (cuadrada) se ancla por abajo según el margen blanco que deja
   cada envase (--m, medido en compra-guias-fotos.json) para que SIEMPRE apoye en la piedra. --w = ancho de la foto en cqw. */
.mc-peana { --w: 72; position: relative; display: block; flex: none; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden;
  isolation: isolate; container-type: inline-size; background: linear-gradient(180deg, var(--mc-pared) 0 67%, var(--mc-piedra) 67% 100%); }
.mc-peana::before { content: ""; position: absolute; left: 0; right: 0; top: 67%; height: 1px; background: rgba(255,255,255,.8); z-index: 0; }
.mc-peana::after { content: ""; position: absolute; z-index: 0; top: 67%; left: 50%; width: calc(var(--w) * .62cqw); height: calc(var(--w) * .1cqw);
  transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, var(--mc-sombra), transparent); }
.mc-peana img { position: absolute; z-index: 1; left: 50%; width: calc(var(--w) * 1cqw); height: calc(var(--w) * 1cqw); max-width: none;
  bottom: calc(33% - var(--w) * var(--m, .07) * 1cqw); transform: translateX(-50%); object-fit: contain; mix-blend-mode: multiply;
  transition: transform .45s var(--ease); }
.mc-peana:hover img { transform: translate(-50%, -3px); }
.mc-peana--mini { border-radius: 9px; }
/* Fotos de la tienda que no son de fondo blanco: a sangre, sin peana */
.mc-peana--foto::before, .mc-peana--foto::after { display: none; }
.mc-peana--foto img { inset: 0; width: 100%; height: 100%; transform: none; object-fit: cover; mix-blend-mode: normal; }
.mc-peana--foto:hover img { transform: none; }

/* Precio y botón de añadir */
.mc-precio { display: inline-flex; align-items: baseline; gap: .3em; font-family: var(--ff-display); font-weight: 600; font-size: 1.6rem;
  line-height: 1; letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums; color: var(--ink); white-space: nowrap; }
.mc-precio small { font-size: .6em; margin-left: -.15em; }
.mc-precio s { font-family: var(--ff-ui); font-size: .48em; font-weight: 500; color: var(--ink-soft); letter-spacing: 0; }
.mc-add { position: relative; flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 0; display: inline-grid; place-items: center;
  cursor: pointer; background: var(--c-verde-botanico); color: var(--c-crema-soft);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease); }
.mc-add:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -14px rgba(39,107,69,.6); }
.mc-add:focus-visible, .mc-barra button:focus-visible, .mc a:focus-visible { outline: 2px solid var(--c-rosa); outline-offset: 2px; }
.mc-add .mc-i { width: 20px; height: 20px; }
a.mc-add, .article-content a.mc-add, .article-content a.mc-peana { color: var(--c-crema-soft); text-decoration: none; }
.mc-add.is-cargando { opacity: .55; pointer-events: none; }
.mc-add.is-hecho { background: var(--c-verde-salvia); }
.mc-agotado { font-size: .72rem; font-weight: 600; color: var(--ink-soft); }
.mc-link { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--c-verde-botanico) !important; white-space: nowrap; }
.mc-link .mc-i { width: 15px; height: 15px; }

/* ── A · Estante (antes del primer apartado) ── */
.article-content > .mc-estante { margin: 24px 0 28px; }
.mc-estante { padding-top: 14px; border-top: 1px solid var(--c-linea-strong); }
.mc-estante__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.mc-estante__titulo { font-family: var(--ff-display); font-weight: 500; font-size: clamp(1.3rem, 3vw, 1.7rem); line-height: 1.05; letter-spacing: -.01em; }
.mc-estante__titulo em { color: var(--c-verde-botanico); }
.mc-rail { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(124px, 34vw, 150px); gap: 12px; overflow-x: auto;
  overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 2px 0 12px; scrollbar-width: thin; scrollbar-color: var(--c-linea-strong) transparent; }
.mc-card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mc-card .mc-peana { margin-bottom: 5px; }
.mc-card__nombre { font-size: .8rem; font-weight: 600; line-height: 1.3; min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-card__pie { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 3px; }
.mc-card .mc-precio { font-size: 1.35rem; }
.mc-card .mc-add { width: 40px; height: 40px; }
.mc-card--todos { justify-content: flex-start; }
.mc-card--todos a { display: grid; place-content: center; justify-items: center; gap: 8px; aspect-ratio: 1 / 1; border-radius: 12px;
  border: 1px dashed var(--c-linea-strong); font-size: .82rem; font-weight: 600; color: var(--c-verde-botanico) !important; text-align: center; padding: 10px; }
.mc-card--todos .mc-i { width: 22px; height: 22px; }
.mc-entrega { display: inline-flex; align-items: center; gap: 8px; font-size: .76rem; line-height: 1.35; color: var(--ink-soft) !important; }
.mc-entrega b { color: var(--ink); font-weight: 600; }
.mc-entrega .mc-i { width: 17px; height: 17px; color: var(--c-verde-botanico); }
.mc-entrega:hover b { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 700px) {
  .mc-rail { margin-inline: calc(var(--gut) * -1); padding-inline: var(--gut); scroll-padding-inline: var(--gut); }
  .mc-estante__head .mc-link { display: none; }
  .mc-estante__titulo { font-size: 1.24rem; white-space: nowrap; }
}
@media (min-width: 701px) {
  .mc-card--todos { display: none; }
  .mc-rail { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
}

/* ── B · Por perfil (debajo de la lista de cada caso «Si…») ── */
.article-content > .mc-perfil { margin: 12px 0 24px; }
.mc-perfil { border-radius: 16px; background: var(--c-blanco); box-shadow: 0 0 0 1px var(--c-linea), 0 18px 44px -30px rgba(39,107,69,.4); overflow: hidden; }
.mc-perfil__top { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px 10px 10px; }
.mc-perfil__top .mc-peana { width: 72px; }
.mc-perfil__txt { display: grid; gap: 3px; min-width: 0; }
.mc-perfil__nombre { font-size: .88rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-perfil__compra { display: grid; justify-items: end; gap: 6px; }
.mc-perfil__compra .mc-precio { font-size: 1.45rem; }
.mc-perfil__mas li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 12px 7px 10px; border-top: 1px solid var(--c-linea); }
.mc-perfil__mas .mc-peana { width: 40px; }
.mc-perfil__mini { display: grid; gap: 1px; min-width: 0; }
.mc-perfil__mini .mc-marca { font-size: .56rem; }
.mc-perfil__mini a { font-size: .78rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-perfil__mas .mc-precio { font-size: 1.15rem; }
.mc-perfil__mas .mc-add { width: 40px; height: 40px; }
@media (min-width: 701px) {
  .mc-perfil__top { grid-template-columns: 88px minmax(0, 1fr) auto; gap: 16px; padding: 12px 16px 12px 12px; }
  .mc-perfil__top .mc-peana { width: 88px; }
  .mc-perfil__compra { grid-auto-flow: column; align-items: center; gap: 14px; }
  .mc-perfil__mas li { padding: 7px 16px 7px 12px; }
}

/* ── D · La tabla que se compra: la MISMA tabla; la celda del producto lleva foto, precio y botón.
   En móvil la columna del producto se queda fija y el resto de columnas se desliza. ── */
.mc-celda { display: grid; gap: 8px; }
.mc-celda__fila { display: flex; align-items: flex-end; gap: 20px; font-family: var(--ff-ui); }
.mc-celda__foto { position: relative; flex: none; width: 54px; }
.mc-celda .mc-peana { width: 54px; }
.mc-celda .mc-add { position: absolute; right: -8px; bottom: -8px; z-index: 2; width: 30px; height: 30px; box-shadow: 0 0 0 3px var(--bg); }
.mc-celda .mc-add::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
.mc-celda .mc-add .mc-i { width: 16px; height: 16px; }
.mc-celda .mc-precio { font-size: 1.22rem; padding-bottom: 1px; }
.mc-desliza { display: none; }
@media (max-width: 700px) {
  .mc-desliza { display: flex; align-items: center; gap: 6px; margin: 10px 0 -4px; font-size: .72rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-soft); }
  .mc-desliza .mc-i { width: 16px; height: 16px; color: var(--c-verde-botanico); }
  .mc-tabla--fija tr > :first-child { position: sticky; left: 0; z-index: 1; min-width: 138px; background: var(--bg);
    box-shadow: inset -1px 0 0 var(--c-linea-strong), 10px 0 14px -12px rgba(31,42,36,.28); }
  .mc-tabla--fija thead tr > :first-child, .mc-tabla--fija tr > th:first-child { z-index: 2; background: var(--c-crema); }
}

/* ── E · Barra fija (siempre): el producto del apartado que estás leyendo. X o deslizar hacia abajo para quitarla. ── */
.mc-barra { position: fixed; z-index: 60; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 8px 12px; align-items: center; padding: 8px;
  border-radius: 20px; background: var(--c-verde-botanico); color: var(--c-crema-soft); box-shadow: 0 20px 60px -20px rgba(0,0,0,.45);
  transform: translateY(calc(100% + 30px)); opacity: 0; visibility: hidden; touch-action: none;
  transition: transform .45s var(--ease), opacity .3s var(--ease), visibility 0s linear .45s; }
.mc-barra.is-on { transform: none; opacity: 1; visibility: visible; transition: transform .45s var(--ease), opacity .3s var(--ease); }
.mc-barra.is-arrastre { transition: none; }
.mc-barra .mc-peana { width: 48px; border-radius: 12px; }
.mc-barra__asa { position: absolute; top: 4px; left: 50%; width: 34px; height: 4px; margin-left: -17px; border-radius: 2px; background: rgba(250,247,243,.32); }
.mc-barra__txt { display: grid; gap: 1px; min-width: 0; }
.mc-barra__ctx { font-size: .6rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--c-verde-mint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-barra__nombre { font-size: .8rem; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-barra .mc-precio { color: var(--c-crema-soft); font-size: 1.35rem; }
.mc-barra .mc-precio s { color: var(--c-verde-mint); }
.mc-barra__btn { border: 0; cursor: pointer; height: 44px; padding: 0 16px; border-radius: 999px; background: var(--c-rosa); color: var(--c-grafito);
  font: 600 .82rem var(--ff-ui); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background-color .25s var(--ease); }
.mc-barra__btn .mc-i { width: 16px; height: 16px; }
.mc-barra__btn.is-cargando { opacity: .6; pointer-events: none; }
.mc-barra__btn.is-hecho { background: var(--c-verde-mint); }
.mc-barra__cerrar { position: absolute; top: -9px; right: -3px; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--c-crema-soft); color: var(--c-grafito); box-shadow: 0 4px 12px -4px rgba(0,0,0,.4); }
.mc-barra__cerrar::before { content: ""; position: absolute; inset: -9px; }
.mc-barra__cerrar .mc-i { width: 14px; height: 14px; }
.mc-barra__mas { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 1px 0; scrollbar-width: none; touch-action: pan-x; }
.mc-barra__mas::-webkit-scrollbar { display: none; }
.mc-barra__mas-tit { flex: none; padding-left: 4px; font-size: .7rem; font-weight: 600; color: var(--c-verde-mint); }
.mc-barra__mas button { flex: none; max-width: 230px; height: 30px; padding: 0 11px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(250,247,243,.13); color: var(--c-crema-soft); font: 500 .74rem var(--ff-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-barra__mas button:hover { background: rgba(250,247,243,.22); }
.mc-barra .mc-entra { animation: mc-entra .35s var(--ease); }
@keyframes mc-entra { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 899px) {
  .mc-barra { gap: 8px 10px; }
  .mc-barra__nombre { white-space: normal; font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .mc-barra .mc-precio { font-size: 1.22rem; }
  .mc-barra__btn { width: 44px; padding: 0; justify-content: center; }
  .mc-barra__btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mc-barra__btn .mc-i { width: 20px; height: 20px; }
}
@media (min-width: 900px) {
  .mc-barra { left: auto; right: 96px; bottom: 24px; width: 410px; touch-action: auto; }
  .mc-barra__asa { display: none; }
}
/* Con la barra puesta, el botón de WhatsApp sube para no taparla (en ordenador van uno al lado del otro) */
@media (max-width: 899px) {
  body.mc-barra-on .fab-wa { bottom: calc(var(--mc-barra-h) + 26px) !important; transition: bottom .45s var(--ease); }
}

/* Aviso tras añadir (o «la compra online se activa en unos días» mientras la tienda está en escaparate) */
.mc-toast { position: fixed; z-index: 70; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(440px, calc(100vw - 20px));
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px 12px 16px; border-radius: 14px; background: var(--c-grafito); color: var(--c-crema-soft);
  font-size: .84rem; line-height: 1.45; box-shadow: 0 20px 50px -18px rgba(0,0,0,.5);
  transform: translate(-50%, 20px); opacity: 0; visibility: hidden; transition: transform .35s var(--ease), opacity .25s var(--ease), visibility 0s linear .35s; }
.mc-toast.is-on { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .35s var(--ease), opacity .25s var(--ease); }
body.mc-barra-on .mc-toast { bottom: calc(var(--mc-barra-h) + 22px); }
.mc-toast p { flex: 1; padding-top: 2px; }
.mc-toast a { color: var(--c-rosa) !important; font-weight: 600; text-decoration: underline !important; text-underline-offset: 3px; white-space: nowrap; }
.mc-toast b { font-weight: 600; }
.mc-toast a[href^="tel:"] { display: inline; min-height: 0; min-width: 0; padding: 0; }
.mc-toast__x { flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(250,247,243,.12); color: inherit; }
.mc-toast__x .mc-i { width: 14px; height: 14px; }

@media (prefers-reduced-motion: reduce) {
  .mc *, .mc-barra, .mc-toast { transition: none !important; animation: none !important; }
}
@media print { .mc-barra, .mc-toast, .mc-estante, .mc-perfil, .mc-desliza { display: none !important; } }
