/* Calculadora de Tarjetas de Visita 3D */

.tvc-calc {
	--tvc-accent: #ffffff;      /* color de la tarjeta (configurable en Ajustes) */
	--tvc-ink: #16181d;
	--tvc-muted: #71757e;
	--tvc-border: #e8e9ed;
	--tvc-surface: #ffffff;
	--tvc-surface-soft: #f4f5f7;
	--tvc-brand: #2f6fed;

	display: flex;
	flex-wrap: wrap;
	gap: 36px;
	align-items: center;
	max-width: 820px;
	margin: 0 auto 24px;
	padding: 24px;
	background: var(--tvc-surface);
	border: 1px solid var(--tvc-border);
	border-radius: 20px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 16px 40px -20px rgba(16, 24, 40, 0.22);
	font-family: inherit;
	color: var(--tvc-ink);
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}
.tvc-calc *,
.tvc-calc *::before,
.tvc-calc *::after {
	box-sizing: border-box;
}

/* ---------- Columna de la vista 3D ---------- */
.tvc-visual {
	flex: 1 1 280px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}
.tvc-scene {
	position: relative;
	width: 100%;
	max-width: 320px;
	height: 200px;
	perspective: 1000px;
	perspective-origin: 50% 20%;
}
/* Sombra de suelo bajo el montón de tarjetas, para dar sensación de profundidad */
.tvc-scene::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 16px;
	width: 190px;
	height: 24px;
	background: radial-gradient(closest-side, rgba(16, 24, 40, 0.20), rgba(16, 24, 40, 0) 75%);
	transform: translateX(-50%);
	pointer-events: none;
}
.tvc-stack {
	position: relative;
	z-index: 1; /* por encima de la sombra de suelo */
	width: 220px;
	height: 130px;
	margin: 46px auto 0;
	transform-style: preserve-3d;
	transform: rotateX(58deg) rotateZ(-28deg);
}
.tvc-card {
	position: absolute;
	inset: 0;
	border-radius: 10px;
	background-color: var(--tvc-accent);
	/* Sombreado sutil independiente del color elegido: brillo arriba-izq., sombra abajo-der. */
	background-image:
		linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 45%),
		linear-gradient(315deg, rgba(16, 24, 40, 0.09), rgba(16, 24, 40, 0) 45%);
	border: 1px solid rgba(16, 24, 40, 0.10);
	box-shadow: 0 1px 1px rgba(16, 24, 40, 0.08);
	transition: background-image 0.2s ease;
}
/* Filo de color: indica "impreso a 2 caras" */
.tvc-stack--double .tvc-card::after {
	content: "";
	position: absolute;
	right: -2px;
	top: 6%;
	bottom: 6%;
	width: 3px;
	border-radius: 2px;
	background: #d4a537;
}
/* Marcador "logo" de ejemplo (solo si no hay imagen de diseño real) */
.tvc-card--placeholder::before {
	content: "";
	position: absolute;
	left: 14px;
	top: 14px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: rgba(16, 24, 40, 0.12);
}

/* ---------- Tarjeta superior con 2 caras ----------
   Se separa "posición dentro del montón" (nunca gira, así el montón
   de debajo siempre se ve, tenga 1 o 100 capas) de "giro cara 1 / cara 2"
   (solo gira esta pieza, de forma independiente al resto de capas). */
.tvc-card-flip-pos {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
}
.tvc-card-flip {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	transition: transform 0.5s ease;
}
.tvc-card-flip.is-flipped {
	transform: rotateY(180deg);
}
.tvc-card-face {
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}
.tvc-card-face--back {
	transform: rotateY(180deg);
}

.tvc-caption {
	font-size: 13px;
	font-weight: 500;
	color: var(--tvc-muted);
	margin: 0;
	text-align: center;
}
.tvc-flip-btn {
	border: none;
	background: var(--tvc-surface-soft);
	color: var(--tvc-ink);
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}
.tvc-flip-btn:hover {
	background: #eceef1;
}

/* ---------- Columna del formulario ---------- */
.tvc-form {
	flex: 1 1 240px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.tvc-field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tvc-muted);
	margin-bottom: 6px;
}

/* Selector de cantidad, estilo "píldora" */
.tvc-qty {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: var(--tvc-surface-soft);
	border-radius: 12px;
	padding: 4px;
}
.tvc-qty__btn {
	width: 34px;
	height: 34px;
	border-radius: 9px;
	border: none;
	background: #fff;
	color: var(--tvc-ink);
	font-size: 16px;
	line-height: 1;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10);
	cursor: pointer;
	transition: box-shadow 0.15s ease, transform 0.1s ease;
}
.tvc-qty__btn:hover {
	box-shadow: 0 2px 6px rgba(16, 24, 40, 0.16);
}
.tvc-qty__btn:active {
	transform: scale(0.94);
}
.tvc-qty__input {
	width: 64px;
	height: 34px;
	text-align: center;
	border: none;
	background: transparent;
	font-size: 15px;
	font-weight: 700;
	color: var(--tvc-ink);
}
.tvc-qty__input:focus {
	outline: none;
}
.tvc-qty__input::-webkit-outer-spin-button,
.tvc-qty__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.tvc-qty__input[type="number"] {
	-moz-appearance: textfield;
	appearance: textfield;
}

/* Selector de caras, estilo "segmented control" */
.tvc-sides {
	display: inline-flex;
	gap: 4px;
	background: var(--tvc-surface-soft);
	border-radius: 12px;
	padding: 4px;
}
.tvc-sides label {
	position: relative;
	display: inline-flex;
	align-items: center;
	padding: 9px 18px;
	border-radius: 9px;
	font-size: 13px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: normal;
	color: var(--tvc-muted);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.tvc-sides label.is-active {
	background: #fff;
	color: var(--tvc-ink);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10);
}
.tvc-sides label:focus-within {
	outline: 2px solid var(--tvc-brand);
	outline-offset: 2px;
}
.tvc-sides input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

/* ---------- Subida del diseño del cliente ---------- */
.tvc-uploads {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 14px;
}
.tvc-upload {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}
/* Anula el display:flex de arriba cuando la cara 2 está oculta (impresión a 1 cara). */
.tvc-upload--back[hidden] {
	display: none;
}
.tvc-upload__input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.tvc-upload__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--tvc-surface-soft);
	color: var(--tvc-ink);
	border: 1px dashed var(--tvc-border);
	border-radius: 10px;
	padding: 9px 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.tvc-upload__btn:hover {
	background: #eceef1;
	border-color: var(--tvc-brand);
}
.tvc-upload__input:focus-visible + .tvc-upload__btn {
	outline: 2px solid var(--tvc-brand);
	outline-offset: 2px;
}
.tvc-upload__remove {
	border: none;
	background: none;
	color: var(--tvc-brand);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
}
.tvc-upload__filename {
	font-size: 11px;
	color: var(--tvc-muted);
	max-width: 150px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tvc-upload__hint {
	font-size: 12px;
	color: var(--tvc-muted);
	margin: 6px 0 0;
}

.tvc-total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--tvc-surface-soft);
	border-radius: 14px;
	padding: 10px 16px;
}
.tvc-total__label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tvc-muted);
}
.tvc-total__value {
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--tvc-ink);
}
.tvc-hint {
	font-size: 12px;
	color: #c0392b;
	margin: 0;
	min-height: 14px;
}

/* ---------- Añadir al carrito ---------- */
.tvc-cart-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.tvc-add-to-cart-btn {
	border: none;
	background: var(--tvc-brand);
	color: #fff;
	border-radius: 12px;
	padding: 12px 20px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}
.tvc-add-to-cart-btn:hover {
	background: #2559c4;
}
.tvc-add-to-cart-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
.tvc-cart-msg {
	font-size: 12px;
	color: var(--tvc-muted);
	margin: 0;
	min-height: 14px;
}
.tvc-cart-msg--error {
	color: #c0392b;
}
.tvc-cart-msg--success {
	color: #1a7f37;
}
.tvc-cart-msg--warning {
	font-size: 13px;
	color: #9a6700;
	background: #fff8e6;
	border: 1px solid #f2dfa1;
	border-radius: 10px;
	padding: 10px 14px;
	margin: 0;
}

@media (max-width: 560px) {
	.tvc-calc {
		flex-direction: column;
		gap: 18px;
		padding: 18px;
		border-radius: 16px;
		margin-left: 16px;
		margin-right: 16px;
	}
	.tvc-visual {
		gap: 8px;
	}
	.tvc-scene {
		height: 160px;
	}
	.tvc-stack {
		margin-top: 20px;
	}
	.tvc-form {
		width: 100%;
		gap: 10px;
	}
}
