/* La cesta de la tienda (19/11/2026, assets/js/cesta.js): el botón «Añadir a la cesta» de cada libro, la cesta de la cabecera,
   la píldora de abajo (con algo en la cesta), el aviso de «añadido» y la cesta, que se abre desde la derecha (en el móvil, a pantalla entera).
   Con la estética de la tienda: contorno negro, sombra dura y píldoras. */
.cesta-svg { flex: none; display: block; }

/* «Añadir a la cesta»: el segundo botón, debajo o al lado de «Comprar» */
.t-alcarro { gap: 7px; }
.t-alcarro .cesta-svg { width: 18px; height: 18px; }
.t-libro .t-alcarro, .pr-info .t-alcarro { align-self: stretch; width: 100%; margin-top: 10px; }
.t-pack .row .t-alcarro { margin-left: 4px; }
.t-guia .t-compra .t-alcarro { margin-left: 0; }
.t-alcarro.en, .t-alcarro.en:hover { background: var(--ok-bg); color: var(--ok); box-shadow: 3px 3px 0 var(--ok); }
.t-alcarro.en .cesta-svg { color: var(--ok); }
.t-alcarro.pum { animation: cesta-pum .45s ease; }
@keyframes cesta-pum { 40% { transform: scale(1.06) rotate(-1.5deg); } }

/* La cesta de la cabecera */
.cesta-top { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-left: 6px; padding: 6px 13px; border: 2px solid #fff; border-radius: 999px;
  background: transparent; color: #fff; font-weight: 800; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.cesta-top:hover { background: rgba(20, 20, 20, .16); }
.cesta-top .cesta-svg { width: 20px; height: 20px; }
.cesta-num { position: absolute; top: -9px; right: -9px; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px;
  background: var(--naranja); color: var(--ink); border: 2px solid var(--ink); font: 800 .76rem/1 var(--sans); box-shadow: 2px 2px 0 var(--ink); }
.cesta-num[hidden] { display: none; }
.cesta-top.pum { animation: cesta-pum .5s ease; }
/* la tienda de clientes: la cesta va detrás de las pestañas, fuera de ellas (en el móvil las pestañas se deslizan y la cesta se queda quieta) */
.tienda-body .top > .brand { margin-right: auto; }
.top > .cesta-top { flex: none; min-height: 36px; padding: 4px 13px; margin-left: 0; }
/* en la landing, solo el dibujo (con el número): al lado de las secciones no cabe más (la hamburguesa sale hasta 1290 px, tienda.css) */
.lp-nav .cesta-top { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 12px; }
.lp-nav .cesta-top-txt { display: none; }
@media (max-width: 760px) { .top > .cesta-top .cesta-top-txt { display: none; } .top > .cesta-top { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; } }

/* La píldora de abajo, con algo en la cesta (en el móvil sustituye a «Elige tu nivel») */
.cesta-pildora { position: fixed; z-index: 45; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 16px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff; box-shadow: 4px 4px 0 var(--naranja);
  font: 800 1rem/1.1 var(--sans); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.cesta-pildora:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--naranja); }
.cesta-pildora[hidden] { display: none; }
.cesta-pildora .cesta-svg { width: 22px; height: 22px; color: var(--naranja); }
.cesta-pildora-total { padding: 6px 11px; border-radius: 999px; background: var(--naranja); color: var(--ink); }
body.con-cesta .lp-flota { display: none !important; }
@media (max-width: 600px) { .cesta-pildora { left: 16px; right: 16px; justify-content: space-between; } }

/* «Añadido a la cesta» */
.cesta-aviso { position: fixed; z-index: 80; left: 50%; top: 82px; transform: translate(-50%, -12px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100% - 32px); padding: 10px 10px 10px 16px; border: 2.5px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 5px 5px 0 var(--turq);
  font-weight: 700; transition: opacity .2s ease, transform .2s ease; }
.cesta-aviso.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.cesta-aviso-ok { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 900; }
.cesta-aviso .btn { min-height: 36px; padding: 5px 14px; font-size: .86rem; box-shadow: 3px 3px 0 var(--ink); }

/* La cesta */
.cesta-capa { position: fixed; inset: 0; z-index: 90; background: rgba(20, 20, 20, .5); opacity: 0; transition: opacity .2s ease; }
.cesta-capa.on { opacity: 1; }
.cesta-capa[hidden] { display: none; }
.cesta { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); display: flex; flex-direction: column; background: var(--bg);
  border-left: 3px solid var(--ink); box-shadow: -6px 0 0 rgba(20, 20, 20, .18); transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.cesta-capa.on .cesta { transform: none; }
.cesta:focus { outline: none; }
.cesta-cab { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--terra); color: #fff; border-bottom: 3px solid var(--ink); }
.cesta-cab h2 { margin: 0; color: #fff; font-size: 1.35rem; display: flex; align-items: center; gap: 9px; }
.cesta-cab h2 .cesta-svg { width: 24px; height: 24px; }
.cesta-cab small { font: 700 .86rem var(--sans); opacity: .9; }
.cesta-x { margin-left: auto; width: 40px; height: 40px; border: 2px solid #fff; border-radius: 12px; background: transparent; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.cesta-x:hover { background: #fff; color: var(--ink); }
.cesta-cuerpo { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 8px; }
.cesta-lineas { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.cesta-linea { position: relative; display: grid; grid-template-columns: 62px 1fr; gap: 12px; padding: 12px 12px 12px 12px; background: #fff; border: 2px solid var(--ink); border-radius: var(--r-sm);
  box-shadow: 3px 3px 0 var(--ink); }
.cesta-linea.pack { box-shadow: 3px 3px 0 var(--turq); }
.cesta-linea img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--line); background: var(--claro); }
.cesta-linea-txt { min-width: 0; padding-right: 26px; }
.cesta-linea h3 { margin: 0 0 3px; font-size: 1rem; line-height: 1.2; }
.cesta-linea p { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.35; }
.cesta-chip { display: inline-block; margin: 0 0 5px; padding: 2px 9px; border-radius: 999px; background: var(--turq); color: var(--ink); border: 1.5px solid var(--ink);
  font: 800 .66rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .06em; }
.cesta-chip.ok { background: var(--naranja); }
.cesta-precio { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.cesta-precio b { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.cesta-precio s { color: var(--muted); font-size: .88rem; }
.cesta-quitar { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.cesta-quitar:hover { background: var(--ko-bg); color: var(--ko); }
.cesta-cant { display: inline-flex; align-items: center; margin-left: auto; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; }
.cesta-cant button { width: 32px; height: 30px; border: 0; background: transparent; font-weight: 900; font-size: 1.05rem; cursor: pointer; }
.cesta-cant button:hover { background: var(--hueco); }
.cesta-cant button:disabled { opacity: .35; cursor: default; }
.cesta-cant span { min-width: 22px; text-align: center; font-weight: 800; }
.cesta-nota { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--hueco); border: 1.5px dashed var(--ink-2); font-size: .86rem; line-height: 1.4; }
.cesta-nota.info { background: #e4f4f3; }
.cesta-sug { margin: 0 0 14px; display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; padding: 12px; background: var(--hueco); border: 2px solid var(--ink);
  border-radius: var(--r-sm); box-shadow: 3px 3px 0 var(--naranja); }
.cesta-sug img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--ink); }
.cesta-sug p { margin: 0 0 8px; font-size: .88rem; line-height: 1.35; }
.cesta-sug .btn { min-height: 34px; padding: 4px 13px; font-size: .84rem; box-shadow: 3px 3px 0 var(--ink); }
.cesta-sug .mano { font: 700 1.15rem/1 var(--mano); color: var(--terra); }
.cesta-pie { padding: 14px 18px max(16px, env(safe-area-inset-bottom)); background: #fff; border-top: 3px solid var(--ink); }
.cesta-ahorro { display: flex; justify-content: space-between; margin: 0 0 4px; color: var(--ok); font-weight: 800; font-size: .92rem; }
.cesta-total { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 12px; }
.cesta-total span { font-weight: 800; }
.cesta-total b { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; }
.cesta-total s { margin-right: 8px; color: var(--muted); font-size: 1rem; font-family: var(--sans); font-weight: 700; }
.cesta-pagar { width: 100%; min-height: 52px; font-size: 1.08rem; }
.cesta-pagar[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.cesta-seguro { margin: 10px 0 0; text-align: center; font-size: .78rem; color: var(--muted); line-height: 1.35; }
.cesta-seguir { display: block; margin: 8px auto 0; border: 0; background: transparent; font-weight: 800; font-size: .88rem; text-decoration: underline; text-decoration-color: var(--terra);
  text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.cesta-vacia { text-align: center; padding: 26px 8px 10px; }
.cesta-vacia img { width: 150px; height: auto; }
.cesta-vacia h3 { margin: 10px 0 6px; font-size: 1.25rem; }
.cesta-vacia p { color: var(--muted); }
.cesta-cargando { opacity: .55; transition: opacity .15s; }
body.cesta-abierta { overflow: hidden; }
@media (max-width: 480px) {
  .cesta { width: 100%; border-left: 0; }
  .cesta-linea { grid-template-columns: 52px 1fr; }
  .cesta-linea img { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) { .cesta, .cesta-capa, .cesta-aviso { transition: none; } .t-alcarro.pum, .cesta-top.pum { animation: none; } }

/* lo que paga con el código (USE5 en la tienda, ALUMNOS5 en las zonas de alumnos) */
.cesta-con-codigo { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: -6px 0 12px; padding: 7px 12px; border-radius: 12px;
  background: var(--hueco); border: 1.5px dashed var(--ink-2); font-size: .9rem; }
.cesta-con-codigo b:last-child { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }

/* ── Fuera de la plataforma: las tiendas de las zonas de alumnos (cesta_zona.php). Sin app.css: los colores, las letras y los botones van aquí,
   solo en lo de la cesta (.cesta-fuera), para no tocar nada de la zona ── */
.cesta-fuera { --bg: #f7f1e8; --ink: #141414; --ink-2: #2d2d2d; --muted: #645e52; --line: #ddd3c0; --claro: #f3eee4; --hueco: #fff3d9;
  --terra: #c44536; --terra-t: #b03a2c; --naranja: #fba724; --turq: #68c9c7; --ok: #2a7347; --ok-bg: #e2f3e7; --ko: #b8392b; --ko-bg: #fbe4df;
  --r: 16px; --r-sm: 12px; --serif: 'Fredoka', 'Nunito', 'Trebuchet MS', system-ui, sans-serif; --sans: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --mano: 'Fredoka', 'Nunito', system-ui, sans-serif;   /* la letra a mano (Caveat) no está en la zona: el «¡Ojo!», con la de los títulos */
  font: 500 16px/1.5 var(--sans); color: var(--ink); text-align: left; letter-spacing: normal; }
/* lo básico, con :where() para no pasar por encima de las reglas de la cesta */
:where(.cesta-fuera) *, :where(.cesta-fuera) *::before, :where(.cesta-fuera) *::after { box-sizing: border-box; }
:where(.cesta-fuera) :where(h2, h3) { font-family: var(--serif); font-weight: 600; letter-spacing: -.005em; text-transform: none; color: inherit; }
:where(.cesta-fuera) :where(p) { margin: 0; }
:where(.cesta-fuera) :where(ul) { list-style: none; }
:where(.cesta-fuera) :where(img) { max-width: 100%; }
:where(.cesta-fuera) :where(button) { font: inherit; color: inherit; }
.cesta-fuera .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 20px; border-radius: 999px;
  background: var(--terra); color: #fff; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); font: 800 .95rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease; }
.cesta-fuera .btn:hover { color: #fff; transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.cesta-fuera .btn.sm { min-height: 36px; padding: 5px 14px; font-size: .86rem; box-shadow: 3px 3px 0 var(--ink); }
.cesta-fuera .muted { color: var(--muted); }
.cesta-fuera.cesta-pildora { font: 800 1rem/1.1 var(--sans); color: #fff; }
.cesta-fuera.cesta-aviso { top: 18px; }
.cesta-fuera .cesta-cab small { color: #fff; }
.cesta-fuera .cesta-total { margin: 0 0 12px; }

/* en la tienda de la zona: «Añadir a la cesta» debajo de «Comprar» (con la forma de sus botones) y la franja de arriba */
.cz-alcarro { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 7px; padding: 8px 12px; background: #fff; color: #141414;
  border: 2.5px solid #141414; border-radius: 12px; font: inherit; font-weight: 800; font-size: 15px; line-height: 1.2; cursor: pointer; }
.cz-alcarro:hover { background: #fff3d9; }
.cz-alcarro .cesta-svg { width: 18px; height: 18px; flex: none; }
.cz-alcarro.en, .cz-alcarro.en:hover { background: #e2f3e7; color: #2a7347; border-color: #2a7347; }
.cz-alcarro.pum { animation: cesta-pum .45s ease; }
.cz-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 16px 0 0; padding: 12px 16px; background: #fff; border: 2.5px solid #141414;
  border-radius: 16px; box-shadow: 4px 4px 0 #68c9c7; font-size: 15px; line-height: 1.4; }
.cz-barra .cesta-svg { width: 26px; height: 26px; color: #c44536; flex: none; }
.cz-barra span { flex: 1; min-width: 200px; }
.cz-barra button { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; background: #141414; color: #fff; border: 0; border-radius: 999px;
  font: inherit; font-weight: 800; font-size: 14.5px; cursor: pointer; }
.cz-barra button .cesta-svg { width: 18px; height: 18px; color: #fba724; }
.cz-barra .cesta-num { position: static; min-width: 22px; height: 22px; margin-left: 2px; box-shadow: none; }
/* en el móvil, las tarjetas de la zona van de dos en dos: sin el dibujo, para que «Añadir a la cesta» quepa en una línea */
@media (max-width: 640px) {
  .t-card:not(.t-pack) .cz-alcarro { font-size: 14px; padding: 8px 6px; }
  .t-card:not(.t-pack) .cz-alcarro .cesta-svg { display: none; }
}
