/* Calculadora de Flyers */

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

	display: flex;
	flex-wrap: wrap;
	gap: 36px;
	align-items: center;
	max-width: 860px;
	margin: 0 auto 24px;
	padding: 24px;
	background: var(--flc-surface);
	border: 1px solid var(--flc-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(--flc-ink);
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}
.flc-calc *,
.flc-calc *::before,
.flc-calc *::after {
	box-sizing: border-box;
}

/* ---------- Columna de la vista previa ---------- */
.flc-visual {
	flex: 1 1 280px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}
.flc-scene {
	position: relative;
	width: 100%;
	max-width: 320px;
	height: 230px;
	display: flex;
	align-items: center;
	justify-content: center;
	perspective: 1000px;
	perspective-origin: 50% 30%;
}
/* Sombra de suelo bajo el montón de flyers, para dar sensación de profundidad */
.flc-scene::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 10px;
	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;
}
.flc-stack {
	position: relative;
	z-index: 1; /* por encima de la sombra de suelo */
	width: 160px;
	height: 200px;
	transform-style: preserve-3d;
	transform: rotateX(55deg) rotateZ(-26deg);
	transition: width 0.25s ease, height 0.25s ease;
}
.flc-sheet {
	position: absolute;
	inset: 0;
	border-radius: 6px;
	background-color: var(--flc-accent);
	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%);
	background-size: cover;
	background-position: center;
	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;
}
/* Marcador de ejemplo (solo si no hay imagen de diseño real) */
.flc-sheet--placeholder::before {
	content: "";
	position: absolute;
	left: 14px;
	top: 14px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: rgba(16, 24, 40, 0.12);
}
/* Filo de color en función del acabado seleccionado */
.flc-stack--brillo .flc-sheet-face--front::after {
	content: "";
	position: absolute;
	right: -2px;
	top: 6%;
	bottom: 6%;
	width: 3px;
	border-radius: 2px;
	background: #2f6fed;
}

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

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

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

/* Selector de formato */
.flc-types {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
}
.flc-type-btn {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	padding: 10px 12px;
	border-radius: 12px;
	border: 1px solid var(--flc-border);
	background: var(--flc-surface-soft);
	cursor: pointer;
	text-align: left;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.flc-type-btn:hover {
	border-color: var(--flc-brand);
}
.flc-type-btn.is-active {
	background: #fff;
	border-color: var(--flc-brand);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10);
}
.flc-type-btn__name {
	font-size: 13px;
	font-weight: 700;
	color: var(--flc-ink);
}
.flc-type-btn__dims {
	font-size: 11px;
	color: var(--flc-muted);
}
.flc-type-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Selector de acabado, estilo "segmented control" */
.flc-finish {
	display: inline-flex;
	gap: 4px;
	background: var(--flc-surface-soft);
	border-radius: 12px;
	padding: 4px;
}
.flc-finish 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(--flc-muted);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.flc-finish label.is-active {
	background: #fff;
	color: var(--flc-ink);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10);
}
.flc-finish label:focus-within {
	outline: 2px solid var(--flc-brand);
	outline-offset: 2px;
}
.flc-finish input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

/* Selector de cantidad (tramos de precio) */
.flc-qty-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.flc-qty-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 8px 12px;
	border-radius: 10px;
	border: 1px solid var(--flc-border);
	background: var(--flc-surface-soft);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.flc-qty-btn:hover {
	border-color: var(--flc-brand);
}
.flc-qty-btn.is-active {
	background: #fff;
	border-color: var(--flc-brand);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10);
}
.flc-qty-btn__qty {
	font-size: 13px;
	font-weight: 700;
	color: var(--flc-ink);
}
.flc-qty-btn__price {
	font-size: 11px;
	color: var(--flc-muted);
}
.flc-qty-empty {
	font-size: 12px;
	color: var(--flc-muted);
}

/* ---------- Subida del diseño del cliente ---------- */
.flc-uploads {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 14px;
}
.flc-upload {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}
.flc-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;
}
.flc-upload__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--flc-surface-soft);
	color: var(--flc-ink);
	border: 1px dashed var(--flc-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;
}
.flc-upload__btn:hover {
	background: #eceef1;
	border-color: var(--flc-brand);
}
.flc-upload__input:focus-visible + .flc-upload__btn {
	outline: 2px solid var(--flc-brand);
	outline-offset: 2px;
}
.flc-upload__remove {
	border: none;
	background: none;
	color: var(--flc-brand);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
}
.flc-upload__filename {
	font-size: 11px;
	color: var(--flc-muted);
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.flc-upload__hint {
	font-size: 12px;
	color: var(--flc-muted);
	margin: 6px 0 0;
}

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

/* ---------- Añadir al carrito ---------- */
.flc-cart-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.flc-add-to-cart-btn {
	border: none;
	background: var(--flc-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;
}
.flc-add-to-cart-btn:hover {
	background: #2559c4;
}
.flc-add-to-cart-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
.flc-cart-msg {
	font-size: 12px;
	color: var(--flc-muted);
	margin: 0;
	min-height: 14px;
}
.flc-cart-msg--error {
	color: #c0392b;
}
.flc-cart-msg--success {
	color: #1a7f37;
}
.flc-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) {
	.flc-calc {
		flex-direction: column;
		gap: 18px;
		padding: 18px;
		border-radius: 16px;
		margin-left: 16px;
		margin-right: 16px;
	}
	.flc-visual {
		gap: 8px;
	}
	.flc-scene {
		height: 190px;
	}
	.flc-types {
		grid-template-columns: repeat(2, 1fr);
	}
	.flc-form {
		width: 100%;
		gap: 10px;
	}
}
