/* ==========================================================================
   Thirty3D Cotizador 3D — estilos del cotizador (rol ux-ui)
   - Todo con prefijo .t3d- y colgado de .t3d-app para aislarlo del tema.
   - Móvil primero: una columna; dos columnas (visor | opciones) desde 900 px.
   - El acento lo aplica el JS desde T3D_CONFIG.viewer.accent:
     --t3d-accent, --t3d-accent-ink (texto sobre acento), --t3d-accent-strong
     (acento oscurecido con contraste AA sobre blanco) y --t3d-accent-soft (fondo suave).
   ========================================================================== */

/* ---------- 1. Variables y aislamiento del tema ---------- */
.t3d-app {
	--t3d-accent: #ff6a13;
	--t3d-accent-ink: #1a1a1a;
	--t3d-accent-strong: #b34700;
	--t3d-accent-soft: rgba(255, 106, 19, 0.09);
	--t3d-text: #1f2328;
	--t3d-muted: #57606a;         /* 6,4:1 sobre blanco */
	--t3d-bg: #ffffff;
	--t3d-surface: #f6f7f9;
	--t3d-border: #d0d7de;
	--t3d-border-strong: #8c959f;
	--t3d-error: #b42318;
	--t3d-error-bg: #fef3f2;
	--t3d-warning: #7a4b00;
	--t3d-warning-bg: #fff8e6;
	--t3d-info: #1d4ed8;
	--t3d-info-bg: #eff5ff;
	--t3d-success: #146c2e;
	--t3d-success-bg: #effaf2;
	--t3d-focus: 0 0 0 3px #ffffff, 0 0 0 6px #1f6feb;
	--t3d-radius: 14px;
	--t3d-radius-sm: 10px;
	--t3d-shadow: 0 1px 2px rgba(31, 35, 40, 0.06), 0 4px 14px rgba(31, 35, 40, 0.06);
	--t3d-gap: 16px;

	position: relative;
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	color: var(--t3d-text);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
	-webkit-text-size-adjust: 100%;
}

.t3d-app,
.t3d-app *,
.t3d-app *::before,
.t3d-app *::after {
	box-sizing: border-box;
}

/* Lo marcado como oculto se oculta aunque el tema diga otra cosa. */
.t3d-app [hidden] {
	display: none !important;
}

.t3d-app h2,
.t3d-app p,
.t3d-app ul,
.t3d-app ol,
.t3d-app dl,
.t3d-app dd,
.t3d-app figure {
	margin: 0;
	padding: 0;
}

.t3d-app ul,
.t3d-app ol {
	list-style: none;
}

.t3d-app img {
	max-width: 100%;
	height: auto;
	border: 0;
}

.t3d-app fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.t3d-app legend {
	padding: 0;
	float: none;
	width: auto;
}

/* Reinicio de botones y campos que los temas suelen decorar. */
.t3d-app button,
.t3d-app input,
.t3d-app select,
.t3d-app textarea {
	font: inherit;
	color: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	margin: 0;
}

.t3d-app button {
	cursor: pointer;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
	min-height: 0;
	line-height: 1.2;
	-webkit-appearance: none;
	appearance: none;
}

.t3d-app button:disabled {
	cursor: not-allowed;
}

/* Visualmente oculto pero accesible (radios de tarjetas, input de archivo, leyendas). */
.t3d-app .t3d-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	opacity: 0;
}

/* Foco visible único para todo el cotizador. */
.t3d-app :focus {
	outline: none;
}

.t3d-app :focus-visible {
	box-shadow: var(--t3d-focus);
}

/* ---------- 2. Indicador de pasos ---------- */
.t3d-app .t3d-steps {
	display: flex;
	gap: 8px;
	margin: 0 0 20px;
	counter-reset: none;
}

.t3d-app .t3d-steps__item {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 999px;
	background: var(--t3d-surface);
	color: var(--t3d-muted);
	font-size: 14px;
	font-weight: 600;
	min-width: 0;
}

.t3d-app .t3d-steps__num {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--t3d-bg);
	border: 2px solid var(--t3d-border-strong);
	font-size: 13px;
}

.t3d-app .t3d-steps__item.is-current {
	background: var(--t3d-accent-soft);
	color: var(--t3d-text);
}

.t3d-app .t3d-steps__item.is-current .t3d-steps__num {
	background: var(--t3d-accent);
	border-color: var(--t3d-accent);
	color: var(--t3d-accent-ink);
}

.t3d-app .t3d-steps__item.is-done .t3d-steps__num {
	background: var(--t3d-success);
	border-color: var(--t3d-success);
	color: #ffffff;
}

/* ---------- 3. Estructura ---------- */
.t3d-app .t3d-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
}

.t3d-app .t3d-col {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.t3d-app[data-state="empty"] .t3d-layout,
.t3d-app[data-state="uploading"] .t3d-layout,
.t3d-app[data-state="analyzing"] .t3d-layout {
	max-width: 680px;
	margin: 0 auto;
}

.t3d-app .t3d-section {
	background: var(--t3d-bg);
	border: 1px solid var(--t3d-border);
	border-radius: var(--t3d-radius);
	padding: 18px;
	box-shadow: var(--t3d-shadow);
}

.t3d-app .t3d-h2 {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
	font-size: 20px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--t3d-text);
	letter-spacing: normal;
	text-transform: none;
}

.t3d-app .t3d-h2__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--t3d-accent);
	color: var(--t3d-accent-ink);
	font-size: 15px;
}

.t3d-app .t3d-field {
	margin: 0 0 22px;
}

.t3d-app .t3d-field:last-child {
	margin-bottom: 0;
}

.t3d-app .t3d-legend,
.t3d-app .t3d-label {
	display: block;
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 700;
	color: var(--t3d-text);
}

.t3d-app .t3d-label {
	font-weight: 600;
	margin-bottom: 6px;
}

.t3d-app .t3d-optional {
	font-weight: 400;
	color: var(--t3d-muted);
}

.t3d-app .t3d-help,
.t3d-app .t3d-hint {
	font-size: 14px;
	color: var(--t3d-muted);
	margin: 0 0 10px;
}

.t3d-app .t3d-hint {
	margin: 8px 0 0;
}

.t3d-app .t3d-help:empty {
	display: none;
}

.t3d-app .t3d-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 16px;
	margin: 0 0 22px;
}

.t3d-app .t3d-row .t3d-field {
	margin: 0;
}

/* ---------- 4. Botones ---------- */
.t3d-app .t3d-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 20px;
	border: 2px solid transparent;
	border-radius: 999px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	text-align: center;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.t3d-app .t3d-btn--primary {
	background: var(--t3d-accent);
	border-color: var(--t3d-accent);
	color: var(--t3d-accent-ink);
}

.t3d-app .t3d-btn--primary:hover:not(:disabled) {
	filter: brightness(0.95);
}

.t3d-app .t3d-btn--ghost {
	background: var(--t3d-bg);
	border-color: var(--t3d-accent-strong);
	color: var(--t3d-accent-strong);
}

.t3d-app .t3d-btn--ghost:hover:not(:disabled) {
	background: var(--t3d-accent-soft);
}

.t3d-app .t3d-btn--link {
	min-height: 44px;
	padding: 8px 4px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--t3d-accent-strong);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.t3d-app .t3d-btn--sm {
	min-height: 40px;
	padding: 8px 16px;
	font-size: 15px;
}

.t3d-app .t3d-btn--lg {
	min-height: 54px;
	font-size: 18px;
	padding: 14px 24px;
}

.t3d-app .t3d-btn--block {
	display: flex;
	width: 100%;
}

.t3d-app .t3d-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.t3d-app .t3d-btn:disabled {
	background: #e7eaee;
	border-color: #e7eaee;
	color: #57606a;
	filter: none;
}

.t3d-app .t3d-btn.is-busy::before {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: t3d-spin 0.8s linear infinite;
}

/* ---------- 5. Paso 1: zona de soltar, progreso, archivo ---------- */
.t3d-app .t3d-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 240px;
	padding: 28px 16px;
	border: 2px dashed var(--t3d-border-strong);
	border-radius: var(--t3d-radius);
	background: var(--t3d-surface);
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

.t3d-app .t3d-drop:hover,
.t3d-app .t3d-drop.is-dragging {
	border-color: var(--t3d-accent-strong);
	background: var(--t3d-accent-soft);
}

.t3d-app .t3d-drop.is-dragging {
	border-style: solid;
}

/* El input está oculto: el foco se dibuja en la zona. */
.t3d-app .t3d-file-input:focus-visible + .t3d-drop,
.t3d-app .t3d-file-input:focus + .t3d-drop {
	box-shadow: var(--t3d-focus);
}

.t3d-app .t3d-drop__icon {
	color: var(--t3d-accent-strong);
}

.t3d-app .t3d-drop__title {
	font-size: 20px;
	font-weight: 700;
}

.t3d-app .t3d-drop__or {
	color: var(--t3d-muted);
	font-size: 14px;
}

.t3d-app .t3d-drop__btn {
	pointer-events: none; /* el clic lo recibe la etiqueta */
}

.t3d-app .t3d-drop__limits {
	font-size: 14px;
	color: var(--t3d-muted);
}

.t3d-app .t3d-progress-box {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px;
	border-radius: var(--t3d-radius-sm);
	background: var(--t3d-surface);
}

.t3d-app .t3d-progress-box__label {
	font-weight: 600;
}

.t3d-app .t3d-progress {
	position: relative;
	height: 12px;
	border-radius: 999px;
	background: #dde2e8;
	overflow: hidden;
}

.t3d-app .t3d-progress__bar {
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: var(--t3d-accent);
	transition: width 0.2s ease-out;
}

.t3d-app .t3d-progress.is-indeterminate .t3d-progress__bar {
	width: 40% !important;
	animation: t3d-indeterminate 1.3s ease-in-out infinite;
}

.t3d-app .t3d-progress-box .t3d-btn--link {
	align-self: flex-start;
}

.t3d-app .t3d-file {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: var(--t3d-radius-sm);
	background: var(--t3d-surface);
}

.t3d-app .t3d-file__icon {
	flex: none;
	color: var(--t3d-accent-strong);
}

.t3d-app .t3d-file__txt {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.t3d-app .t3d-file__name {
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.t3d-app .t3d-file__meta {
	font-size: 14px;
	color: var(--t3d-muted);
}

.t3d-app[data-state="ready"] .t3d-upload .t3d-h2 {
	margin-bottom: 12px;
}

/* Tras subir el archivo, el consejo sobra; al arrastrar sobre un archivo cargado se marca. */
.t3d-app:not([data-state="empty"]) .t3d-upload__tip {
	display: none;
}

.t3d-app .t3d-file.is-dragging {
	outline: 2px dashed var(--t3d-accent-strong);
	outline-offset: 2px;
	background: var(--t3d-accent-soft);
}

/* ---------- 6. Visor ---------- */
.t3d-app .t3d-stage {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.t3d-app .t3d-viewer {
	position: relative;
	width: 100%;
	height: 62vw;
	min-height: 260px;
	max-height: 420px;
	border-radius: var(--t3d-radius);
	background: var(--t3d-surface);
	overflow: hidden;
	touch-action: none;
}

.t3d-app .t3d-viewer canvas {
	display: block;
	width: 100% !important;
	height: 100% !important;
}

.t3d-app .t3d-viewer.is-loading {
	background: linear-gradient(100deg, #eef0f3 30%, #f8f9fa 50%, #eef0f3 70%);
	background-size: 300% 100%;
	animation: t3d-shimmer 1.4s linear infinite;
}

/* Sin visor (sin WebGL o el archivo no se pudo dibujar): se oculta la caja vacía. */
.t3d-app .t3d-stage.is-noviewer .t3d-viewer,
.t3d-app .t3d-stage.is-noviewer .t3d-stage__hint {
	display: none;
}

.t3d-app .t3d-viewer__loading {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--t3d-muted);
}

.t3d-app .t3d-viewer__notice {
	font-size: 14px;
	color: var(--t3d-warning);
	background: var(--t3d-warning-bg);
	border-radius: var(--t3d-radius-sm);
	padding: 8px 12px;
}

.t3d-app .t3d-stage__hint {
	margin: 0;
	font-size: 13px;
	text-align: center;
}

.t3d-app .t3d-plates {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.t3d-app .t3d-plates__btn {
	min-height: 40px;
	padding: 6px 14px;
	border: 2px solid var(--t3d-border);
	border-radius: 999px;
	background: var(--t3d-bg);
	font-size: 14px;
	font-weight: 600;
}

.t3d-app .t3d-plates__btn[aria-pressed="true"] {
	border-color: var(--t3d-accent-strong);
	background: var(--t3d-accent-soft);
	color: var(--t3d-text);
}

.t3d-app .t3d-fit__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

/* ---------- 7. Tarjetas seleccionables ---------- */
.t3d-app .t3d-cards {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
}

.t3d-app .t3d-cards--4 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Calidad: lista vertical (las descripciones se leen completas, sin columnas estrechas). */
.t3d-app .t3d-cards--3 {
	grid-template-columns: minmax(0, 1fr);
	gap: 8px;
}

.t3d-app .t3d-card {
	position: relative;
	display: block;
	margin: 0;
	cursor: pointer;
	font-weight: 400;
}

.t3d-app .t3d-card__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 100%;
	min-height: 64px;
	padding: 14px 16px;
	padding-right: 40px; /* espacio para la marca */
	border: 2px solid var(--t3d-border);
	border-radius: var(--t3d-radius-sm);
	background: var(--t3d-bg);
	transition: border-color 0.15s, background-color 0.15s;
}

.t3d-app .t3d-card--row .t3d-card__body {
	flex-direction: row;
	align-items: center;
	gap: 12px;
}

.t3d-app .t3d-card__photo {
	flex: none;
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 8px;
	background: var(--t3d-surface);
}

.t3d-app .t3d-card__main {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.t3d-app .t3d-card__title {
	font-weight: 700;
	font-size: 16px;
	line-height: 1.3;
	color: var(--t3d-text);
}

.t3d-app .t3d-card__desc {
	font-size: 14px;
	color: var(--t3d-muted);
	line-height: 1.4;
}

.t3d-app .t3d-card__meta {
	font-size: 13px;
	color: var(--t3d-muted);
	font-variant-numeric: tabular-nums;
}

.t3d-app .t3d-card__meta:empty {
	display: none;
}

.t3d-app .t3d-badge {
	align-self: flex-start;
	display: inline-block;
	margin-top: 2px;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--t3d-surface);
	border: 1px solid var(--t3d-border);
	font-size: 12px;
	font-weight: 700;
	color: var(--t3d-text);
}

.t3d-app .t3d-badge--multi {
	background: var(--t3d-accent-soft);
	border-color: var(--t3d-accent-strong);
	color: var(--t3d-accent-strong);
}

/* Marca circular de selección (no depende solo del color). */
.t3d-app .t3d-card__body::after {
	content: "";
	position: absolute;
	top: 14px;
	right: 14px;
	width: 20px;
	height: 20px;
	border: 2px solid var(--t3d-border-strong);
	border-radius: 50%;
	background: var(--t3d-bg);
}

.t3d-app .t3d-card:hover .t3d-card__body {
	border-color: var(--t3d-border-strong);
}

.t3d-app .t3d-card input:checked + .t3d-card__body {
	border-color: var(--t3d-accent-strong);
	background: var(--t3d-accent-soft);
}

.t3d-app .t3d-card input:checked + .t3d-card__body::after {
	border-color: var(--t3d-accent-strong);
	background: var(--t3d-accent-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.t3d-app .t3d-card input:focus-visible + .t3d-card__body {
	box-shadow: var(--t3d-focus);
}

.t3d-app .t3d-card input:disabled + .t3d-card__body {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ---------- 8. Interruptor Multicolor / Un color ---------- */
.t3d-app .t3d-switch {
	display: inline-flex;
	padding: 4px;
	margin: 0 0 8px;
	border-radius: 999px;
	background: var(--t3d-surface);
	border: 1px solid var(--t3d-border);
}

.t3d-app .t3d-switch__opt {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.t3d-app .t3d-switch__txt {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 8px 18px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 15px;
	color: var(--t3d-muted);
	transition: background-color 0.15s, color 0.15s;
}

.t3d-app .t3d-switch input:checked + .t3d-switch__txt {
	background: var(--t3d-accent);
	color: var(--t3d-accent-ink);
}

.t3d-app .t3d-switch input:focus-visible + .t3d-switch__txt {
	box-shadow: var(--t3d-focus);
}

.t3d-app .t3d-switch.is-disabled {
	opacity: 0.6;
}

.t3d-app .t3d-switch.is-disabled .t3d-switch__opt {
	cursor: not-allowed;
}

/* ---------- 9. Colores ---------- */
.t3d-app .t3d-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.t3d-app .t3d-swatch {
	position: relative;
	display: inline-flex;
	margin: 0;
	cursor: pointer;
}

.t3d-app .t3d-swatch__dot {
	position: relative;
	display: block;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	/* borde interior siempre visible: los blancos no se pierden en el fondo */
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
	transition: transform 0.1s;
}

.t3d-app .t3d-swatch:hover .t3d-swatch__dot {
	transform: scale(1.06);
}

.t3d-app .t3d-swatch input:checked + .t3d-swatch__dot {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28), 0 0 0 3px var(--t3d-bg), 0 0 0 5px var(--t3d-accent-strong);
}

/* Marca de verificación sobre la muestra elegida (claro u oscuro según el color). */
.t3d-app .t3d-swatch input:checked + .t3d-swatch__dot::after {
	content: "";
	position: absolute;
	inset: 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.t3d-app .t3d-swatch.is-light input:checked + .t3d-swatch__dot::after {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%231f2328' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.t3d-app .t3d-swatch input:focus-visible + .t3d-swatch__dot {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28), var(--t3d-focus);
}

.t3d-app .t3d-swatches__name {
	width: 100%;
	font-size: 14px;
	color: var(--t3d-muted);
}

.t3d-app .t3d-filecolors {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.t3d-app .t3d-filecolor {
	padding: 12px;
	border: 1px solid var(--t3d-border);
	border-radius: var(--t3d-radius-sm);
	background: var(--t3d-bg);
}

.t3d-app .t3d-filecolor__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 10px;
}

.t3d-app .t3d-filecolor__orig {
	flex: none;
	width: 24px;
	height: 24px;
	border-radius: 6px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.t3d-app .t3d-filecolor__label {
	font-weight: 700;
}

.t3d-app .t3d-filecolor__pct {
	margin-left: auto;
	font-size: 14px;
	color: var(--t3d-muted);
	font-variant-numeric: tabular-nums;
}

.t3d-app .t3d-filecolor__bar {
	display: block;
	height: 4px;
	margin: -4px 0 10px;
	border-radius: 999px;
	background: var(--t3d-surface);
	overflow: hidden;
}

.t3d-app .t3d-filecolor__fill {
	display: block;
	height: 100%;
	background: var(--t3d-border-strong);
}

/* ---------- 10. Campos: escala, cantidad, formulario ---------- */
.t3d-app .t3d-input {
	display: block;
	width: 100%;
	min-height: 46px;
	padding: 10px 12px;
	border: 2px solid var(--t3d-border);
	border-radius: var(--t3d-radius-sm);
	background: var(--t3d-bg);
	color: var(--t3d-text);
	font-size: 16px; /* evita el zoom automático en iOS */
	line-height: 1.3;
	box-shadow: none;
}

.t3d-app .t3d-input:hover {
	border-color: var(--t3d-border-strong);
}

.t3d-app .t3d-input:focus {
	border-color: var(--t3d-accent-strong);
}

.t3d-app .t3d-input:focus-visible {
	box-shadow: var(--t3d-focus);
	border-radius: var(--t3d-radius-sm);
}

.t3d-app .t3d-textarea {
	resize: vertical;
	min-height: 90px;
}

.t3d-app .t3d-input-group {
	position: relative;
	display: flex;
	align-items: center;
}

.t3d-app .t3d-input-group .t3d-input {
	padding-right: 36px;
	font-variant-numeric: tabular-nums;
}

.t3d-app .t3d-input-group__suffix {
	position: absolute;
	right: 14px;
	color: var(--t3d-muted);
	font-weight: 600;
	pointer-events: none;
}

.t3d-app .t3d-input-group + .t3d-help {
	margin: 6px 0 0;
}

.t3d-app .t3d-stepper {
	display: flex;
	align-items: stretch;
	border: 2px solid var(--t3d-border);
	border-radius: var(--t3d-radius-sm);
	background: var(--t3d-bg);
	overflow: hidden;
}

.t3d-app .t3d-stepper:focus-within {
	border-color: var(--t3d-accent-strong);
}

.t3d-app .t3d-stepper__btn {
	flex: none;
	width: 46px;
	min-height: 44px;
	font-size: 22px;
	font-weight: 700;
	color: var(--t3d-accent-strong);
	background: var(--t3d-surface);
}

.t3d-app .t3d-stepper__btn:hover:not(:disabled) {
	background: var(--t3d-accent-soft);
}

.t3d-app .t3d-stepper__btn:disabled {
	color: #8c959f;
}

.t3d-app .t3d-stepper__btn:focus-visible {
	border-radius: 0;
	box-shadow: inset 0 0 0 3px #1f6feb;
}

.t3d-app .t3d-stepper__input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	border-radius: 0;
	text-align: center;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	-moz-appearance: textfield;
}

.t3d-app .t3d-stepper__input::-webkit-inner-spin-button,
.t3d-app .t3d-stepper__input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.t3d-app .t3d-stepper__input:focus-visible {
	box-shadow: inset 0 0 0 3px #1f6feb;
	border-radius: 0;
}

.t3d-app .t3d-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--t3d-border);
}

.t3d-app .t3d-form__row {
	display: flex;
	flex-direction: column;
}

/* Honeypot: fuera de pantalla, nunca display:none (algunos bots lo detectan). */
.t3d-app .t3d-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

/* ---------- 11. Paso 3: precio ---------- */
.t3d-app .t3d-price-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.t3d-app .t3d-price__label {
	font-size: 14px;
	font-weight: 700;
	color: var(--t3d-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.t3d-app .t3d-price {
	font-size: 40px;
	line-height: 1.1;
	font-weight: 800;
	color: var(--t3d-text);
	font-variant-numeric: tabular-nums;
	transition: opacity 0.15s;
	word-break: break-word;
}

.t3d-app .t3d-price.is-stale {
	opacity: 0.45;
}

.t3d-app .t3d-price__unit {
	font-size: 15px;
	color: var(--t3d-muted);
	margin-top: -6px;
}

.t3d-app .t3d-price__status {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--t3d-muted);
}

.t3d-app .t3d-summary {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}

.t3d-app .t3d-summary:empty {
	display: none;
}

.t3d-app .t3d-summary__item {
	padding: 10px 12px;
	border-radius: var(--t3d-radius-sm);
	background: var(--t3d-surface);
}

.t3d-app .t3d-summary dt {
	font-size: 13px;
	color: var(--t3d-muted);
	font-weight: 600;
}

.t3d-app .t3d-summary dd {
	margin: 2px 0 0;
	font-size: 16px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.t3d-app .t3d-summary__sub {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: var(--t3d-muted);
}

.t3d-app .t3d-breakdown {
	border: 1px solid var(--t3d-border);
	border-radius: var(--t3d-radius-sm);
	background: var(--t3d-bg);
}

.t3d-app .t3d-breakdown__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 46px;
	padding: 10px 14px;
	cursor: pointer;
	font-weight: 700;
	color: var(--t3d-accent-strong);
	list-style: none;
}

.t3d-app .t3d-breakdown__toggle::-webkit-details-marker {
	display: none;
}

.t3d-app .t3d-breakdown__toggle::after {
	content: "";
	width: 10px;
	height: 10px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-3px);
	transition: transform 0.15s;
}

.t3d-app .t3d-breakdown[open] .t3d-breakdown__toggle::after {
	transform: rotate(-135deg) translateY(-3px);
}

.t3d-app .t3d-breakdown__list {
	padding: 0 14px 12px;
}

.t3d-app .t3d-breakdown__row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	border-top: 1px solid var(--t3d-surface);
	font-size: 15px;
}

.t3d-app .t3d-breakdown__row span:last-child {
	flex: none;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.t3d-app .t3d-breakdown__row--total {
	border-top: 2px solid var(--t3d-border);
	font-weight: 800;
}

.t3d-app .t3d-terms {
	font-size: 13px;
	color: var(--t3d-muted);
	white-space: pre-line;
}

.t3d-app .t3d-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 18px;
}

.t3d-app .t3d-actions__hint {
	font-size: 14px;
	color: var(--t3d-muted);
}

/* ---------- 12. Alertas y avisos ---------- */
.t3d-app .t3d-alert {
	padding: 12px 14px;
	border-radius: var(--t3d-radius-sm);
	border-left: 4px solid currentColor;
	font-size: 15px;
}

.t3d-app .t3d-alert--error {
	color: var(--t3d-error);
	background: var(--t3d-error-bg);
}

.t3d-app .t3d-alert--warning {
	color: var(--t3d-warning);
	background: var(--t3d-warning-bg);
}

.t3d-app .t3d-alert--info {
	color: var(--t3d-info);
	background: var(--t3d-info-bg);
}

.t3d-app .t3d-alert--success {
	color: var(--t3d-success);
	background: var(--t3d-success-bg);
}

.t3d-app .t3d-alert__title {
	font-weight: 800;
}

.t3d-app .t3d-alert__text {
	color: var(--t3d-text);
}

.t3d-app .t3d-alert .t3d-btn {
	margin-top: 8px;
}

.t3d-app .t3d-alert a {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
}

.t3d-app .t3d-notices {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.t3d-app .t3d-notices .t3d-alert {
	font-size: 14px;
}

/* ---------- 13. Spinner ---------- */
.t3d-app .t3d-spinner {
	flex: none;
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid #c6ccd3;
	border-top-color: var(--t3d-accent-strong);
	border-radius: 50%;
	animation: t3d-spin 0.8s linear infinite;
}

/* ---------- 14. Barra de precio móvil ---------- */
.t3d-app .t3d-minibar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 16px;
	padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	background: var(--t3d-bg);
	border-top: 1px solid var(--t3d-border);
	box-shadow: 0 -4px 16px rgba(31, 35, 40, 0.1);
}

.t3d-app .t3d-minibar__txt {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.t3d-app .t3d-minibar__label {
	font-size: 12px;
	color: var(--t3d-muted);
}

.t3d-app .t3d-minibar__price {
	font-size: 20px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

/* ---------- 15. Tamaños intermedios y escritorio ---------- */
@media (min-width: 560px) {
	.t3d-app .t3d-section {
		padding: 22px;
	}

	.t3d-app .t3d-cards--2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.t3d-app .t3d-cards--4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.t3d-app .t3d-summary {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 380px) {
	.t3d-app .t3d-row {
		grid-template-columns: minmax(0, 1fr);
	}

	.t3d-app .t3d-steps__txt {
		font-size: 13px;
	}
}

@media (min-width: 900px) {
	.t3d-app[data-state="ready"] .t3d-layout {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
		gap: 28px;
		align-items: start;
	}

	/* Visor fijo mientras se recorren las opciones. */
	.t3d-app[data-state="ready"] .t3d-col--view {
		position: sticky;
		top: 24px;
	}

	.t3d-app .t3d-viewer {
		height: 440px;
		max-height: none;
	}

	.t3d-app .t3d-price {
		font-size: 46px;
	}

	/* En escritorio el precio siempre está a la vista: no hace falta la barra. */
	.t3d-app .t3d-minibar {
		display: none !important;
	}

}

/* ---------- 16. Animaciones ---------- */
@keyframes t3d-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes t3d-indeterminate {
	0% {
		transform: translateX(-100%);
	}
	100% {
		transform: translateX(250%);
	}
}

@keyframes t3d-shimmer {
	0% {
		background-position: 100% 0;
	}
	100% {
		background-position: 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.t3d-app *,
	.t3d-app *::before,
	.t3d-app *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}

	/* La barra indeterminada queda quieta a lo ancho (sigue indicando actividad con el texto). */
	.t3d-app .t3d-progress.is-indeterminate .t3d-progress__bar {
		width: 100% !important;
		transform: none;
		opacity: 0.6;
	}
}
