/* ==========================================================================
   Tostao · Sitio — vista rápida de la cesta (minicarrito)
   Escritorio: desplegable a la derecha, bajo la cabecera. Móvil y tableta (hasta 960 px): panel lateral con velo.
   Fijo en pantalla (position: fixed) para que se abra bien con la cabecera fija y con la que no lo es (tienda y formaciones).
   ========================================================================== */

@keyframes ts-mc-baja { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes ts-mc-entra { from { transform: translateX(100%); } to { transform: none; } }

/* la bolsa, marcada mientras el panel está abierto */
.ts-w .ts-bolsa[aria-expanded="true"] { background: rgba(255, 255, 255, .16); }

/* con el panel abierto la cabecera pasa por encima de todo (como con el cajón del móvil) */
html:not(.tostao-previo):not(.tostao-salto):not(.tostao-tactil) body > header.elementor-location-header:has(.ts-mc:not([hidden])) { z-index: 100000; }

/* ---- el panel ---- */
.ts-w .ts-mc { --ts-mc-top: 96px; position: fixed; top: var(--ts-mc-top); right: var(--ts-lado); z-index: 100001; width: min(410px, calc(100vw - 32px)); max-height: calc(100vh - var(--ts-mc-top) - 16px); max-height: calc(100dvh - var(--ts-mc-top) - 16px); display: flex; flex-direction: column; background: #fff; color: var(--ts-granate); border: 1px solid var(--ts-linea); border-radius: 20px; box-shadow: 0 26px 40px rgba(94, 33, 41, .14), 0 2px 8px rgba(94, 33, 41, .08); overflow: hidden; font-family: var(--ts-fuente); text-align: left; }
.ts-w .ts-mc[hidden] { display: none; }
.ts-w .ts-mc :focus-visible { outline: 3px solid var(--ts-granate); outline-offset: 2px; }
.ts-w .ts-mc:not([hidden]) { animation: ts-mc-baja .16s ease-out; }

.ts-w .ts-mc-cab { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 22px; border-bottom: 1px solid var(--ts-linea); }
.ts-w .ts-mc-titulo { margin: 0; padding: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font: 800 20px/1.2 var(--ts-fuente); letter-spacing: -.2px; color: var(--ts-granate); }
.ts-w .ts-mc-cuenta { font: 700 12.5px/1.2 var(--ts-fuente); letter-spacing: 0; color: var(--ts-suave); }
.ts-w .ts-mc-x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--ts-crema-claro); color: var(--ts-granate); transition: background .15s; }
.ts-w .ts-mc-x:hover { background: var(--ts-crema); }
.ts-w .ts-mc-x svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ---- contenido (se renueva con los fragmentos de WooCommerce) ---- */
.ts-w .ts-mc-contenido { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.ts-w .ts-mc-lista { list-style: none; margin: 0; padding: 2px 22px; flex: 1 1 auto; min-height: 0; max-height: min(46vh, 380px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(91, 17, 23, .5) transparent; /* barra fina y discreta: en Windows la clásica se comía el borde del panel */ }
.ts-w .ts-mc-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) 44px; column-gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--ts-linea); transition: opacity .15s; }
.ts-w .ts-mc-item:last-child { border-bottom: 0; }
.ts-w .ts-mc-item.ts-mc-quitando { opacity: .45; pointer-events: none; }
.ts-w .ts-mc-foto { width: 56px; height: 56px; border: 1px solid var(--ts-linea); border-radius: 12px; background: var(--ts-gris); overflow: hidden; display: grid; place-items: center; /* el marco da forma también a las fotos con fondo blanco */ }
.ts-w .ts-mc-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ts-w .ts-mc-pend svg { width: 30px; height: 30px; stroke: var(--ts-granate); fill: none; stroke-width: 1.4; opacity: .35; }
/* recorte sin fondo (cafeteras: marca _tostao_foto_sin_fondo): sin panel gris, la máquina entera y apoyada abajo sobre crema claro */
.ts-w .ts-mc-foto.ts-sf { background: var(--ts-sf-fondo, var(--ts-crema-claro)); }
.ts-w .ts-mc-foto.ts-sf img { object-fit: contain; object-position: 50% 100%; box-sizing: border-box; padding: 4px 3px 3px; }
.ts-w .ts-mc-info { min-width: 0; }
.ts-w .ts-mc-nombre { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; font: 700 14px/1.3 var(--ts-fuente); color: var(--ts-granate); }
.ts-w a.ts-mc-nombre:hover { text-decoration: underline; text-underline-offset: 3px; }
.ts-w .ts-mc-meta { margin: 3px 0 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font: 500 12.5px/1.35 var(--ts-fuente); color: var(--ts-suave); }
.ts-w .ts-mc-cant { margin: 5px 0 0; font: 600 13px/1.3 var(--ts-fuente); color: var(--ts-granate); }
.ts-w .ts-mc-cant .amount { font-weight: 800; }
.ts-w .ts-mc-bono .ts-mc-cant .amount { font-size: 14px; }
.ts-w .ts-mc-unid { font-weight: 600; color: var(--ts-suave); }
.ts-w .ts-mc-quitar { width: 44px; height: 44px; margin: -9px -8px 0 0; justify-self: end; display: grid; place-items: center; border-radius: 50%; color: var(--ts-suave); transition: background .15s, color .15s; }
.ts-w .ts-mc-quitar:hover { background: var(--ts-crema-claro); color: var(--ts-granate); }
.ts-w .ts-mc-quitar svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* pie: subtotal y botones (siempre a la vista; solo se desplaza la lista) */
.ts-w .ts-mc-pie { flex: none; display: grid; gap: 8px; padding: 16px 22px 20px; border-top: 1px solid var(--ts-linea); background: var(--ts-crema-claro); }
.ts-w .ts-mc-fila { margin: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font: 600 14px/1.3 var(--ts-fuente); color: var(--ts-granate); }
.ts-w .ts-mc-fila strong { font-weight: 800; }
.ts-w .ts-mc-fila-total strong { font-size: 19px; }
.ts-w .ts-mc-desc { color: var(--ts-suave); }
.ts-w .ts-mc-nota { margin: 0; font: 500 12px/1.4 var(--ts-fuente); color: var(--ts-suave); }
.ts-w .ts-mc-botones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.ts-w .ts-mc-btn { flex: 1 1 150px; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border-radius: 999px; font: 700 13.5px/1.2 var(--ts-fuente); text-align: center; text-decoration: none; transition: background .15s, color .15s; }
.ts-w .ts-mc-btn-p { background: var(--ts-amarillo); color: var(--ts-granate); }
.ts-w .ts-mc-btn-p:hover { background: var(--ts-granate); color: var(--ts-amarillo); }
.ts-w .ts-mc-btn-lin { background: #fff; color: var(--ts-granate); box-shadow: inset 0 0 0 1.5px var(--ts-granate); }
.ts-w .ts-mc-btn-lin:hover { background: var(--ts-crema); }

/* cesta vacía */
.ts-w .ts-mc-vacio { display: grid; justify-items: center; gap: 8px; padding: 30px 24px 26px; text-align: center; }
.ts-w .ts-mc-vacio-ico { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--ts-crema-claro); margin-bottom: 4px; }
.ts-w .ts-mc-vacio-ico svg { width: 32px; height: 32px; stroke: var(--ts-granate); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ts-w .ts-mc-vacio p { margin: 0; font: 500 14px/1.5 var(--ts-fuente); color: var(--ts-suave); max-width: 300px; }
.ts-w .ts-mc-vacio .ts-mc-vacio-t { font: 800 17px/1.25 var(--ts-fuente); color: var(--ts-granate); }
.ts-w .ts-mc-vacio .ts-mc-botones { width: 100%; margin-top: 10px; }

/* ---- móvil y tableta: panel lateral ---- */
@media (max-width: 960px) {
	.ts-w .ts-mc { top: 0; right: 0; bottom: 0; width: min(92vw, 420px); max-height: none; border-radius: 20px 0 0 20px; border-width: 0 0 0 1px; box-shadow: -18px 0 40px rgba(43, 13, 17, .22); }
	.ts-w .ts-mc:not([hidden]) { animation: ts-mc-entra .2s ease-out; }
	.ts-w .ts-mc-cab { padding-top: max(14px, env(safe-area-inset-top)); }
	.ts-w .ts-mc-lista { max-height: none; }
	.ts-w .ts-mc-pie { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
	.ts-w .ts-mc-vacio { align-content: start; }
	/* el velo cubre también la cabecera; el panel queda por encima */
	html.ts-mc-abierto { overflow: hidden; }
	html.ts-mc-abierto .ts-w .ts-cab { z-index: auto; }
}

/* teléfonos: los botones van uno debajo de otro, a todo el ancho (el texto no se parte) */
@media (max-width: 520px) {
	.ts-w .ts-mc-botones { flex-direction: column; }
	.ts-w .ts-mc-btn { flex: none; width: 100%; min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
	.ts-w .ts-mc:not([hidden]), .ts-w .ts-mc-item, .ts-w .ts-mc-x, .ts-w .ts-mc-quitar, .ts-w .ts-mc-btn { animation: none !important; transition: none !important; }
}

/* Revisión de diseño (23-nov-2026): el panel es blanco y las fotos con fondo blanco se ven blancas; el recorte sin fondo también va sobre blanco (no sobre crema) para que las miniaturas sean iguales */
.ts-w .ts-mc-foto.ts-sf { background: #fff; }

/* Revisión de diseño 2 (24-nov-2026): una cafetera independiente enseña la gama (hasta 3 líneas) y, debajo, el acabado entero (antes «… frío Acero…» cortado) */
.ts-w .ts-mc-nombre:has(.ts-mc-ac) { display: block; -webkit-line-clamp: unset; overflow: visible; }
.ts-w .ts-mc-nombre .ts-mc-g { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.ts-w .ts-mc-nombre .ts-mc-ac { display: block; margin-top: 2px; font-weight: 600; }
