/* ==========================================================================
   Compra Rápida COD — modal, tarjetas de promoción y barra fija.
   Hereda los colores del tema (--accent, --ink, --bg, --surface, --radius);
   si el tema no los define usa los valores de respaldo.
   Mobile-first: en móvil es una hoja que sube desde abajo.
   ========================================================================== */

.tbq-dialog,
.tbq-widget,
.tbq-sticky,
.tbq-gal,
.tbq-hero {
	--tbq-accent: var(--accent, #d9381e);
	--tbq-accent-ink: var(--accent-ink, #fff);
	--tbq-ink: var(--ink, #151515);
	--tbq-bg: var(--bg, #fff);
	--tbq-surface: var(--surface, #f4f1ec);
	--tbq-radius: var(--radius, 8px);
	--tbq-muted: color-mix(in srgb, var(--tbq-ink) 62%, var(--tbq-bg));
	--tbq-line: color-mix(in srgb, var(--tbq-ink) 16%, var(--tbq-bg));
	--tbq-ok: #168a4a;
	font-family: inherit;
	color: var(--tbq-ink);
}
.tbq-dialog *, .tbq-widget *, .tbq-sticky *, .tbq-gal *, .tbq-hero * { box-sizing: border-box; }

html.tbq-lock { overflow: hidden; }
.tbq-note { padding: 10px 14px; border: 1px dashed #b32d2e; color: #b32d2e; border-radius: 6px; font-size: 14px; }

/* ---------- Botón ---------- */
.tbq-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 54px; padding: 0 24px;
	border: 0; border-radius: var(--tbq-radius);
	background: var(--tbq-accent); color: var(--tbq-accent-ink);
	font-family: inherit; font-weight: 700; font-size: 1rem; line-height: 1.1; text-decoration: none; cursor: pointer;
	transition: transform 0.15s ease, filter 0.2s ease;
}
.tbq-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.tbq-btn:active { transform: translateY(1px) scale(0.985); }
.tbq-btn--block { width: 100%; }
.tbq-btn:disabled { opacity: 0.7; cursor: progress; }

/* ---------- Diálogo: hoja inferior en móvil ---------- */
.tbq-dialog {
	width: 100%; max-width: 100%;
	max-height: 94dvh; height: auto;
	margin: auto 0 0; padding: 0; border: 0;
	background: var(--tbq-bg);
	border-radius: 20px 20px 0 0;
	overflow: hidden;
}
.tbq-dialog[open] { display: flex; flex-direction: column; animation: tbq-up 0.3s cubic-bezier(0.2, 0.7, 0.2, 1); }
.tbq-dialog:focus { outline: none; }
.tbq-dialog::backdrop { background: rgb(0 0 0 / 0.55); }
@keyframes tbq-up { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }

@media (min-width: 720px) {
	.tbq-dialog { width: min(580px, 94vw); max-height: 92dvh; margin: auto; border-radius: calc(var(--tbq-radius) * 2); }
	.tbq-dialog[open] { animation-name: tbq-pop; }
	@keyframes tbq-pop { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
}

.tbq-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.tbq-head {
	position: relative; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px;
	padding: 16px 12px 12px 20px; border-bottom: 1px solid var(--tbq-line);
}
.tbq-title { margin: 0; font-family: inherit; font-weight: 800; font-size: 1.0625rem; line-height: 1.2; letter-spacing: 0.02em; text-transform: uppercase; }
.tbq-x { display: grid; place-items: center; width: 44px; height: 44px; margin: -6px 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.tbq-x:hover { background: var(--tbq-surface); }
.tbq-head__timer { order: 3; flex-basis: 100%; margin: 0; font-size: 0.8125rem; color: var(--tbq-accent); font-weight: 600; }
.tbq-head__timer strong { font-variant-numeric: tabular-nums; }

.tbq-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 8px; -webkit-overflow-scrolling: touch; }

/* Chips de beneficios */
.tbq-chips { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 0 0 14px; padding: 0; font-size: 0.8125rem; color: var(--tbq-muted); }
.tbq-chips li { display: inline-flex; align-items: center; gap: 4px; }
.tbq-chips svg { color: var(--tbq-ok); }

/* ---------- Promociones (tramos) ---------- */
.tbq-tiers, .tbq-widget__tiers { display: grid; gap: 10px; }
.tbq-tier, .tbq-wtier { position: relative; display: block; cursor: pointer; }
.tbq-tier input[type="radio"], .tbq-wtier input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.tbq-tier { padding: 12px; border: 1.5px solid var(--tbq-line); border-radius: var(--tbq-radius); background: var(--tbq-bg); transition: border-color 0.2s, background-color 0.2s; }
.tbq-tier:hover { border-color: color-mix(in srgb, var(--tbq-accent) 50%, var(--tbq-line)); }
.tbq-tier.is-selected { border-color: var(--tbq-accent); background: color-mix(in srgb, var(--tbq-accent) 6%, var(--tbq-bg)); }
.tbq-tier:has(input:focus-visible) { outline: 2px solid var(--tbq-ink); outline-offset: 2px; }
.tbq-tier__main { display: flex; align-items: center; gap: 12px; }
.tbq-tier__main img, .tbq-wtier__box img { flex: none; width: 56px; height: 56px; object-fit: cover; border-radius: calc(var(--tbq-radius) - 2px); background: var(--tbq-surface); }
.tbq-tier__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tbq-tier__txt strong { font-size: 0.9375rem; line-height: 1.25; }
.tbq-tier__txt small, .tbq-wtier__txt small { color: var(--tbq-ok); font-weight: 600; font-size: 0.75rem; }
.tbq-tier__price { text-align: right; line-height: 1.2; white-space: nowrap; }
.tbq-tier__price del, .tbq-wtier__price del { display: block; font-size: 0.8125rem; color: var(--tbq-muted); }
.tbq-tier__price strong, .tbq-wtier__price strong { font-size: 1.0625rem; }
.tbq-chip { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--tbq-accent); color: var(--tbq-accent-ink); font-family: inherit; font-weight: 700; font-size: 0.6875rem; line-height: 1.2; font-style: normal; }
.tbq-badge {
	position: absolute; top: -10px; right: 12px; padding: 3px 10px; border-radius: 999px;
	background: var(--tbq-ink); color: var(--tbq-bg); font-family: inherit; font-weight: 700; font-size: 0.6875rem; line-height: 1.3; letter-spacing: 0.02em;
}

/* Selectores de talla por unidad */
.tbq-units { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--tbq-line); }
.tbq-unit-row { display: flex; align-items: center; gap: 10px; }
.tbq-unit-n { min-width: 22px; font-weight: 800; }
.tbq-unit, .tbq-f select, .tbq-f input, .tbq-f textarea {
	width: 100%; min-height: 50px; padding: 0 14px;
	border: 1.5px solid var(--tbq-line); border-radius: var(--tbq-radius);
	background: var(--tbq-bg); color: var(--tbq-ink); font-family: inherit; font-weight: 400; font-size: 16px; line-height: 1.3; /* 16px evita el zoom de iOS */
}
.tbq-unit { flex: 1; appearance: none; background: var(--tbq-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 40px; font-weight: 600; }
.tbq-unit.has-error, .tbq-f .has-error { border-color: #d63638; background-color: #fff6f6; }

/* ---------- Resumen ---------- */
.tbq-summary { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--tbq-radius); background: var(--tbq-surface); }
.tbq-summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 0.9375rem; }
.tbq-summary dt, .tbq-summary dd { margin: 0; }
.tbq-summary dd { font-weight: 600; text-align: right; }
.tbq-sum--save dd { color: var(--tbq-ok); }
.tbq-sum--free dd { color: var(--tbq-ok); }
.tbq-sum--total { margin-top: 4px; padding-top: 10px !important; border-top: 1px solid var(--tbq-line); font-size: 1.0625rem !important; }
.tbq-sum--total dt, .tbq-sum--total dd { font-weight: 800; }

/* ---------- Envío ---------- */
.tbq-ship { margin: 16px 0 0; padding: 0; border: 0; }
.tbq-ship legend, .tbq-h3 { padding: 0; margin: 0 0 10px; font-family: inherit; font-weight: 800; font-size: 1rem; line-height: 1.2; }
.tbq-ship__err { margin: 0; padding: 10px 12px; border-radius: var(--tbq-radius); background: #fff6f6; color: #b32d2e; font-size: 0.875rem; }
.tbq-rate { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--tbq-line); border-radius: var(--tbq-radius); margin-bottom: 8px; cursor: pointer; }
.tbq-rate:has(input:checked) { border-color: var(--tbq-accent); }
.tbq-rate input { accent-color: var(--tbq-accent); width: 20px; height: 20px; margin: 0; }
.tbq-rate__l { flex: 1; }

/* ---------- Campos ---------- */
.tbq-fields { margin-top: 20px; display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.tbq-fields .tbq-h3, .tbq-cityhost, .tbq-fields .tbq-f--full, .tbq-fields .tbq-error { grid-column: 1 / -1; }
.tbq-cityhost { display: contents; }
.tbq-f { display: block; margin: 0 0 14px; }
.tbq-f__l { display: block; margin-bottom: 6px; font-size: 0.875rem; font-weight: 700; }
.tbq-f__w { position: relative; display: block; }
.tbq-f__i { position: absolute; left: 0; top: 0; bottom: 0; width: 46px; display: grid; place-items: center; color: var(--tbq-muted); pointer-events: none; font-style: normal; }
/* Espacio para el ícono. Va con .tbq-dialog delante para ganarle a los estilos de campos del tema
   (input[type="text"], etc.), que tienen la misma especificidad y se cargan después. */
.tbq-dialog .tbq-f__w input,
.tbq-dialog .tbq-f__w select,
.tbq-dialog .tbq-f__w textarea { padding-left: 46px; padding-right: 14px; }
.tbq-dialog .tbq-f__w select { padding-right: 40px; }
.tbq-dialog .tbq-f__w textarea { padding-top: 12px; min-height: 80px; }
.tbq-f select { appearance: none; background: var(--tbq-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 40px; }
.tbq-f select:disabled { background-color: var(--tbq-surface); color: var(--tbq-muted); }
.tbq-f input:focus, .tbq-f select:focus, .tbq-f textarea:focus, .tbq-unit:focus { outline: none; border-color: var(--tbq-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tbq-ink) 14%, transparent); }
.tbq-f__e { display: block; margin-top: 4px; color: #d63638; font-size: 0.8125rem; }
.tbq-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tbq-error { margin: 0 0 6px; padding: 10px 12px; border-radius: var(--tbq-radius); background: #fff6f6; color: #b32d2e; font-size: 0.9375rem; font-weight: 600; }
.tbq-error[hidden], .tbq-f__e[hidden], .tbq-ship[hidden], .tbq-head__timer[hidden] { display: none; }

@media (min-width: 720px) {
	.tbq-fields { grid-template-columns: 1fr 1fr; }
	.tbq-fields .tbq-cityhost { display: contents; }
	.tbq-body { padding: 18px 22px 8px; }
}

/* ---------- Pie con botón ---------- */
.tbq-foot { flex: none; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--tbq-line); background: var(--tbq-bg); }
.tbq-submit { min-height: 58px; justify-content: space-between; padding: 0 20px; font-size: 1.0625rem; }
.tbq-submit b { font-weight: 800; }
.tbq-submit.is-busy { justify-content: center; }
.tbq-foot__note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 0; font-size: 0.8125rem; color: var(--tbq-muted); }

/* ---------- Widget en la landing ---------- */
.tbq-widget { display: grid; gap: 12px; margin: 16px 0; }
.tbq-wtier__box {
	position: relative; display: flex; align-items: center; gap: 12px; padding: 12px;
	border: 1.5px solid var(--tbq-line); border-radius: var(--tbq-radius); background: var(--tbq-bg);
	transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}
.tbq-wtier:hover .tbq-wtier__box { transform: translateY(-2px); }
.tbq-wtier input:checked + .tbq-wtier__box { border-color: var(--tbq-accent); background: color-mix(in srgb, var(--tbq-accent) 6%, var(--tbq-bg)); }
.tbq-wtier input:focus-visible + .tbq-wtier__box { outline: 2px solid var(--tbq-ink); outline-offset: 2px; }
.tbq-wtier__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tbq-wtier__txt strong { font-size: 0.9375rem; line-height: 1.25; }
.tbq-wtier__price { text-align: right; line-height: 1.2; white-space: nowrap; }
.tbq-timer { margin: 0; padding: 10px 14px; border-radius: var(--tbq-radius); background: var(--tbq-surface); font-size: 0.875rem; text-align: center; }
.tbq-timer strong { color: var(--tbq-accent); font-variant-numeric: tabular-nums; }
.tbq-widget .tbq-btn { min-height: 58px; font-size: 1.0625rem; }

/* ---------- Barra fija (móvil) ---------- */
.tbq-sticky {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
	display: flex; align-items: center; gap: 12px;
	padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
	background: var(--tbq-bg); border-top: 1px solid var(--tbq-line);
	box-shadow: 0 -4px 18px rgb(0 0 0 / 0.08);
}
.tbq-sticky[hidden] { display: none; }
.tbq-sticky__info { flex: 1; min-width: 0; line-height: 1.25; }
.tbq-sticky__info strong { display: block; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbq-sticky__info span { font-size: 0.8125rem; color: var(--tbq-muted); }
.tbq-sticky .tbq-btn { flex: none; min-height: 48px; }
@media (min-width: 900px) { .tbq-sticky { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
	.tbq-dialog[open], .tbq-btn, .tbq-wtier__box { animation: none !important; transition: none !important; }
}


/* ==========================================================================
   Carrusel de fotos y portada (galería a un lado + compra al otro)
   ========================================================================== */
.tbq-gal { --tbq-g-ratio: 4 / 5; min-width: 0; }
.tbq-gal__viewport { position: relative; border-radius: calc(var(--tbq-radius) * 1.5); overflow: hidden; background: var(--tbq-surface); }
.tbq-gal__viewport:focus-visible { outline: 2px solid var(--tbq-ink); outline-offset: 2px; }
.tbq-gal__track {
	display: flex; margin: 0; padding: 0; list-style: none;
	overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
	scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tbq-gal__track::-webkit-scrollbar { display: none; }
.tbq-gal__slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; aspect-ratio: var(--tbq-g-ratio); }
.tbq-gal__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tbq-gal__arrow {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
	display: none; place-items: center; width: 44px; height: 44px; padding: 0 0 3px;
	border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.92); color: #151515;
	font-size: 28px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgb(0 0 0 / 0.18);
	transition: transform 0.15s ease, background-color 0.2s;
}
.tbq-gal__arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.tbq-gal__arrow--prev { left: 12px; }
.tbq-gal__arrow--next { right: 12px; }
.tbq-gal__count {
	position: absolute; right: 12px; bottom: 12px; z-index: 2;
	padding: 4px 10px; border-radius: 999px; background: rgb(0 0 0 / 0.6); color: #fff;
	font-size: 0.75rem; font-variant-numeric: tabular-nums;
}
.tbq-gal__thumbs { display: flex; gap: 8px; margin: 10px 0 0; padding: 2px 0 4px; list-style: none; overflow-x: auto; scrollbar-width: none; }
.tbq-gal__thumbs::-webkit-scrollbar { display: none; }
.tbq-gal__thumbs li { flex: 0 0 auto; margin: 0; }
.tbq-gal__thumb {
	display: block; width: 62px; aspect-ratio: var(--tbq-g-ratio); padding: 0;
	border: 2px solid transparent; border-radius: calc(var(--tbq-radius) - 1px);
	background: var(--tbq-surface); overflow: hidden; cursor: pointer; opacity: 0.65;
	transition: opacity 0.2s, border-color 0.2s;
}
.tbq-gal__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tbq-gal__thumb:hover { opacity: 1; }
.tbq-gal__thumb.is-active { opacity: 1; border-color: var(--tbq-ink); }
@media (min-width: 900px) { .tbq-gal__arrow { display: grid; } .tbq-gal__count { display: none; } .tbq-gal__thumb { width: 72px; } }

/* Portada: móvil = galería arriba y compra debajo; escritorio = lado a lado */
.tbq-hero {
	width: min(100% - 32px, 1120px); margin: 16px auto 8px;
	display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 40px; align-items: start;
}
.tbq-hero__media { min-width: 0; }
.tbq-hero__panel { min-width: 0; }
.tbq-hero__title { margin: 0 0 8px; font-family: inherit; font-size: clamp(1.5rem, 1.1rem + 2vw, 2.1rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; text-transform: none; }
.tbq-hero__rating { margin: 0 0 8px; font-size: 0.9375rem; color: var(--tbq-muted); }
.tbq-hero__rating span[aria-hidden] { color: #e0a100; }
.tbq-hero__rating strong { color: var(--tbq-ink); }
.tbq-hero__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 10px; }
.tbq-hero__price strong { font-size: 1.75rem; font-weight: 800; line-height: 1.1; }
.tbq-hero__price del { font-size: 1.0625rem; color: var(--tbq-muted); }
.tbq-hero__lead { margin: 0 0 14px; color: var(--tbq-muted); font-size: 0.9375rem; line-height: 1.5; }
.tbq-hero .tbq-widget { margin: 14px 0; }
.tbq-hero__trust { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 0.875rem; color: var(--tbq-muted); }
.tbq-hero__trust li { display: flex; align-items: center; gap: 8px; }
.tbq-hero__trust li::before { content: "✓"; color: var(--tbq-ok); font-weight: 800; }

@media (min-width: 900px) {
	.tbq-hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); margin-top: 32px; }
	.tbq-hero__panel { position: sticky; top: 24px; }
}
@media (max-width: 899px) { .tbq-hero { margin-top: 8px; } }
