/* ==========================================================================
   Tostao · Sitio — ventana de formaciones (módulo «ventana»).
   Diseño aprobado el 21-nov-2026 (prototipo v35): fondo granate, foto a la derecha fundida,
   fecha en grande en amarillo, barra inferior más oscura con flechas, puntos y «Ahora no».
   Solo escritorio y tableta: por debajo de 768 px no existe. El CSS se carga con media="(min-width: 768px)".
   ========================================================================== */

.ts-w .ts-v {
	--ts-v-seg: 6s;
	position: fixed;
	inset: 0;
	z-index: 99000; /* por debajo del cajón móvil (100000): nunca lo tapa */
	display: flex;
	padding: 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: rgba(43, 13, 17, .5);
	font-family: var(--ts-fuente);
	color: var(--ts-crema);
	opacity: 0;
	transition: opacity .25s ease;
}
.ts-w .ts-v[hidden] { display: none; }
.ts-w .ts-v.on { opacity: 1; }

/* ---- diálogo ---- */
.ts-w .ts-v-dlg {
	position: relative;
	width: min(980px, 100%);
	margin: auto;
	background: var(--ts-granate);
	color: var(--ts-crema);
	border-radius: 26px;
	overflow: hidden;
	box-shadow: 0 30px 70px rgba(43, 13, 17, .45);
	transform: translateY(10px);
	transition: transform .3s ease;
	outline: 0;
}
.ts-w .ts-v.on .ts-v-dlg { transform: none; }
.ts-w .ts-v :focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.ts-w .ts-v .ts-v-dlg:focus,
.ts-w .ts-v .ts-v-dlg:focus-visible { outline: 0; } /* el contenedor recibe el foco solo para anunciar el diálogo */

.ts-w .ts-v .ts-v-cierre {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 5;
	width: 46px;
	height: 46px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: rgba(63, 21, 14, .72);
	color: var(--ts-amarillo);
	box-shadow: 0 0 0 1px rgba(255, 255, 0, .5);
	transition: background .15s;
}
.ts-w .ts-v .ts-v-cierre:hover { background: var(--ts-granate-osc); box-shadow: 0 0 0 1.5px var(--ts-amarillo); }
.ts-w .ts-v .ts-v-cierre svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---- tarjetas: todas en la misma celda, así el alto es el de la más alta y no salta al rotar ---- */
.ts-w .ts-v-diapos { display: grid; }
.ts-w .ts-v-diapo {
	grid-area: 1 / 1;
	position: relative;
	display: flex;
	min-height: 446px;
	opacity: 0;
	visibility: hidden;
	transition: opacity .22s ease, visibility 0s .22s;
}
.ts-w .ts-v-diapo.on { opacity: 1; visibility: visible; transition: opacity .4s ease .22s, visibility 0s; }

.ts-w .ts-v-foto { position: absolute; top: 0; right: 0; bottom: 0; width: 64%; background: var(--ts-granate-osc); }
.ts-w .ts-v-foto img { display: block; width: 100%; height: 100%; object-fit: cover; max-width: none; }
/* Desvanecido funcional: la foto se funde con el fondo para que el texto se lea (como en el prototipo aprobado). */
.ts-w .ts-v-foto::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, var(--ts-granate) 0%, rgba(91, 17, 23, .8) 24%, rgba(91, 17, 23, .22) 62%, rgba(91, 17, 23, 0) 100%);
}

.ts-w .ts-v-info {
	position: relative;
	z-index: 1;
	width: 62%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 14px;
	padding: 44px 20px 30px 50px;
}
.ts-w .ts-v-sf .ts-v-info { width: 100%; max-width: 760px; }

.ts-w .ts-v-chip { display: flex; align-items: center; gap: 12px; color: var(--ts-amarillo); font: 800 12px/1.3 var(--ts-fuente); letter-spacing: .2em; text-transform: uppercase; }
.ts-w .ts-v-chip::before { content: ""; flex: none; width: 34px; height: 3px; background: var(--ts-amarillo); border-radius: 2px; }

.ts-w .ts-v .ts-v-t { margin: 0; padding: 0; font: 700 clamp(30px, 4vw, 40px)/1.04 var(--ts-fuente); letter-spacing: -1px; color: #fff; text-transform: none; }
.ts-w .ts-v .ts-v-t em { font-style: normal; color: var(--ts-amarillo); }

.ts-w .ts-v-g { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; margin: 2px 0; }
.ts-w .ts-v-n { flex: none; font: 800 108px/.8 var(--ts-fuente); letter-spacing: -5px; color: var(--ts-amarillo); white-space: nowrap; }
.ts-w .ts-v-n.ts-v-txt { font-size: 68px; letter-spacing: -2.5px; line-height: .92; }
.ts-w .ts-v-d { display: grid; flex: 1 1 250px; gap: 4px; min-width: 0; padding-bottom: 2px; }
.ts-w .ts-v-d b { font: 700 21px/1.2 var(--ts-fuente); letter-spacing: .22em; text-transform: uppercase; color: #fff; }
.ts-w .ts-v-d span { font: 600 16px/1.3 var(--ts-fuente); color: var(--ts-crema); }
.ts-w .ts-v-d small { font: 500 12.5px/1.4 var(--ts-fuente); color: var(--ts-crema); opacity: .9; }

.ts-w .ts-v-etqs { display: flex; flex-wrap: wrap; gap: 8px; }
.ts-w .ts-v-etq { font: 700 12.5px/1.2 var(--ts-fuente); padding: 6px 12px; border-radius: 999px; border: 1.5px solid rgba(246, 237, 207, .7); color: var(--ts-crema); background: transparent; }
.ts-w .ts-v-etq.ts-v-escasez { background: var(--ts-amarillo); color: var(--ts-granate); border-color: var(--ts-amarillo); }
.ts-w .ts-v-etq.ts-v-conf { color: var(--ts-amarillo); border-color: var(--ts-amarillo); }
.ts-w .ts-v-etq.ts-v-cupon { color: var(--ts-amarillo); border: 1.5px dashed var(--ts-amarillo); letter-spacing: .05em; }

.ts-w .ts-v-lin { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin-top: 4px; }
.ts-w .ts-v-precio { font: 800 26px/1 var(--ts-fuente); color: #fff; }
.ts-w .ts-v-precio small { margin-left: 6px; font: 600 12.5px/1 var(--ts-fuente); color: var(--ts-crema); opacity: .85; }
.ts-w .ts-v .ts-v-cta { display: inline-block; padding: 14px 26px; border-radius: 999px; border: 0; background: var(--ts-amarillo); color: var(--ts-granate); font: 700 14px/1.2 var(--ts-fuente); letter-spacing: .01em; text-decoration: none; transition: background .15s, color .15s; }
.ts-w .ts-v .ts-v-cta:hover { background: #fff; color: var(--ts-granate); }
.ts-w .ts-v .ts-v-enlace,
.ts-w .ts-v .ts-v-todas { color: var(--ts-crema); font: 700 13.5px/1.3 var(--ts-fuente); text-decoration: underline; text-underline-offset: 4px; }
.ts-w .ts-v .ts-v-enlace:hover,
.ts-w .ts-v .ts-v-todas:hover { color: #fff; }

/* ---- barra inferior ---- */
.ts-w .ts-v-prog { height: 4px; background: rgba(246, 237, 207, .2); overflow: hidden; }
.ts-w .ts-v-prog i { display: block; height: 100%; background: var(--ts-amarillo); transform: scaleX(0); transform-origin: 0 50%; }
.ts-w .ts-v-prog.run i { animation: ts-v-prog var(--ts-v-seg, 6s) linear forwards; }
.ts-w .ts-v-dlg.ts-v-en-pausa .ts-v-prog i { animation-play-state: paused; }
@keyframes ts-v-prog { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.ts-w .ts-v-barra { display: flex; align-items: center; gap: 16px; padding: 14px 26px 8px; background: var(--ts-granate-osc); color: var(--ts-crema); }
.ts-w .ts-v-puntos { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ts-w .ts-v .ts-v-punto { position: relative; flex: none; width: 11px; height: 11px; border-radius: 50%; background: rgba(246, 237, 207, .4); transition: width .2s, background .2s; }
.ts-w .ts-v .ts-v-punto::after { content: ""; position: absolute; inset: -8px -4px; } /* zona de pulsación de 24 px */
.ts-w .ts-v .ts-v-punto[aria-current="true"] { width: 30px; border-radius: 6px; background: var(--ts-amarillo); }

.ts-w .ts-v .ts-v-flecha { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--ts-amarillo); background: rgba(255, 255, 0, .1); color: var(--ts-amarillo); transition: background .15s, color .15s, transform .12s; }
.ts-w .ts-v .ts-v-flecha svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.ts-w .ts-v .ts-v-flecha:hover { background: var(--ts-amarillo); color: var(--ts-granate); }
.ts-w .ts-v [data-v-ant]:hover svg { transform: translateX(-2px); }
.ts-w .ts-v [data-v-sig]:hover svg { transform: translateX(2px); }
.ts-w .ts-v .ts-v-flecha:active { transform: scale(.93); }

.ts-w .ts-v .ts-v-pausa { color: var(--ts-crema); font: 700 12.5px/1.3 var(--ts-fuente); text-decoration: underline; text-underline-offset: 3px; padding: 8px 4px; }
.ts-w .ts-v .ts-v-pausa:hover { color: #fff; }

.ts-w .ts-v-nomas { padding: 0 10px 12px; text-align: center; background: var(--ts-granate-osc); }
.ts-w .ts-v .ts-v-nomas button { padding: 8px 14px; color: var(--ts-crema); opacity: .85; font: 600 12.5px/1.3 var(--ts-fuente); text-decoration: underline; text-underline-offset: 3px; }
.ts-w .ts-v .ts-v-nomas button:hover { opacity: 1; }

/* una sola tarjeta: sin flechas, puntos, pausa ni progreso */
.ts-w .ts-v-uno .ts-v-prog,
.ts-w .ts-v-uno .ts-v-flecha,
.ts-w .ts-v-uno .ts-v-puntos,
.ts-w .ts-v-uno .ts-v-pausa { display: none; }
.ts-w .ts-v-uno .ts-v-barra { justify-content: center; }

/* ---- tableta (hasta 960 px): la foto pasa arriba y los datos debajo ---- */
@media (max-width: 960px) {
	.ts-w .ts-v-dlg { width: min(560px, 100%); }
	.ts-w .ts-v-diapo { min-height: 490px; }
	.ts-w .ts-v-foto { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 250px; }
	.ts-w .ts-v-foto::after { background: linear-gradient(180deg, rgba(91, 17, 23, .1) 0%, var(--ts-granate) 100%); }
	.ts-w .ts-v-info { width: 100%; max-width: none; padding: 182px 24px 20px; gap: 12px; justify-content: flex-start; }
	.ts-w .ts-v-sf .ts-v-info { padding-top: 64px; }
	.ts-w .ts-v .ts-v-t { font-size: 31px; }
	.ts-w .ts-v-n { font-size: 80px; letter-spacing: -3px; }
	.ts-w .ts-v-n.ts-v-txt { font-size: 56px; letter-spacing: -2px; }
	.ts-w .ts-v-d b { font-size: 17px; }
	.ts-w .ts-v-barra { flex-wrap: wrap; gap: 10px 12px; padding: 12px 16px 6px; }
	.ts-w .ts-v-puntos { flex: 1 1 100px; }
	.ts-w .ts-v-todas { order: 5; }
}

/* ---- tarjeta del Club con el sobre de café (módulo «sobres»): el recorte sin fondo sobre dos círculos, en lugar de la foto ----
   El sobre es amarillo de marca: va sobre granate y granate oscuro, nunca sobre el crema ni el amarillo. Dos círculos como las «o» del logotipo; sin degradado.
   No añade alto: la tarjeta ocupa lo mismo que las demás. Solo existe si tostao_sobre_img() devuelve algo (con los sobres apagados vuelve la foto). */
.ts-w .ts-v-con-sobre .ts-v-info { width: 54%; }
.ts-w .ts-v-foto--sobre { width: 46%; overflow: hidden; background: var(--ts-granate-osc); }
.ts-w .ts-v-foto--sobre::before { content: ""; position: absolute; right: -112px; top: 50%; width: 450px; height: 450px; margin-top: -225px; border-radius: 50%; background: var(--ts-granate); } /* revisión de diseño: el sobre es amarillo de marca y se fundía con el crema; sobre granate (panel granate oscuro) salta */
.ts-w .ts-v-foto--sobre::after { display: none; } /* sin el desvanecido de la foto */
.ts-w .ts-v-foto--sobre img.ts-sobre { position: absolute; z-index: 1; left: 50%; top: 50%; width: min(280px, 66%); height: auto; max-width: none; object-fit: contain; transform: translate(-30%, -50%) rotate(-7deg); }
.ts-w .ts-v .ts-v-con-sobre .ts-v-enlace { display: inline-flex; align-items: center; min-height: 44px; } /* revisión de integración: «Ver el café» con objetivo de 44 px (en la fila ya hay un botón de 45: no suma alto) */

@media (max-width: 960px) {
	.ts-w .ts-v-con-sobre .ts-v-info { width: 100%; padding-top: 212px; }
	.ts-w .ts-v-foto--sobre { width: auto; height: 198px; }
	.ts-w .ts-v-foto--sobre::before { right: auto; left: 50%; top: 10px; width: 180px; height: 180px; margin: 0 0 0 -90px; }
	.ts-w .ts-v-foto--sobre img.ts-sobre { top: 100px; width: 126px; transform: translate(-50%, -50%) rotate(-7deg); }
}
/* ---- móvil: la ventana no existe (la barra superior y el pie cumplen su función) ---- */
@media (max-width: 767px) {
	.ts-w .ts-v-raiz { display: none !important; }
}

@media print {
	.ts-w .ts-v-raiz { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
	.ts-w .ts-v,
	.ts-w .ts-v-dlg,
	.ts-w .ts-v-diapo,
	.ts-w .ts-v-diapo.on,
	.ts-w .ts-v .ts-v-flecha,
	.ts-w .ts-v .ts-v-flecha svg,
	.ts-w .ts-v .ts-v-punto { transition: none; }
	.ts-w .ts-v-dlg { transform: none; }
	.ts-w .ts-v .ts-v-flecha:active { transform: none; }
	.ts-w .ts-v [data-v-ant]:hover svg,
	.ts-w .ts-v [data-v-sig]:hover svg { transform: none; }
	.ts-w .ts-v-prog,
	.ts-w .ts-v-pausa { display: none; } /* sin rotación automática: nada que pausar */
}
