/* ═══════════════════════════════════════════════════════════
   FBT Comprados Juntos – Frontend Widget
   ═══════════════════════════════════════════════════════════ */

/* Widget container */
.fbt-w { margin: 2em 0; font-family: inherit; }

/* Título */
.fbt-title {
	font-size: 1.35em !important;
	font-weight: 700 !important;
	margin: 0 0 .9em !important;
	padding: 0 !important;
	border: none !important;
	background: none !important;
}

/* ── Layout principal ──────────────────────────────────── */
.fbt-layout {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 2em;
}

/* ── Columna de productos ──────────────────────────────── */
.fbt-products {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
}

/* Separador "+" */
.fbt-plus {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	font-size: 1.5em;
	font-weight: 300;
	color: #555;
	/* centrar verticalmente con la imagen (165px alto) */
	align-self: flex-start;
	margin-top: 58px;
	flex-shrink: 0;
}

/* ── Item individual ───────────────────────────────────── */
.fbt-item {
	display: flex;
	flex-direction: column;
	width: 170px;
}

.fbt-item--out .fbt-img,
.fbt-item--out .fbt-info {
	opacity: .5;
}

/* Imagen */
.fbt-img {
	position: relative;
	width: 160px;
	height: 160px;
	background: #f3f3f3;
	border: 1px solid #ddd;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin-bottom: 8px;
	flex-shrink: 0;
}

.fbt-img a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.fbt-img img {
	max-width: 90%;
	max-height: 90%;
	object-fit: contain;
	display: block;
}

/* ── Checkbox: perfectamente centrado ─────────────────── */
.fbt-cb {
	/* esquina superior derecha */
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	/* flex para centrar el tick dentro del cuadro */
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	cursor: pointer;
}

/* Ocultar el input nativo sin perder accesibilidad */
.fbt-cb input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

/* Cuadro visible */
.fbt-cb-box {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: 2px solid #0078c8;
	border-radius: 4px;
	background: #fff;
	transition: background .12s;
	flex-shrink: 0;
	box-sizing: border-box;
}

/* Checked: fondo azul */
.fbt-cb input:checked + .fbt-cb-box {
	background: #0078c8;
	border-color: #0078c8;
}

/* Tick centrado dentro del cuadro */
.fbt-cb input:checked + .fbt-cb-box::after {
	content: '';
	display: block;
	/* dimensiones del tick */
	width: 5px;
	height: 9px;
	border: 2px solid #fff;
	border-top: none;
	border-left: none;
	transform: rotate(45deg) translateY(-1px);
}

/* Disabled */
.fbt-cb input:disabled + .fbt-cb-box {
	border-color: #bbb;
	background: #eee;
	cursor: not-allowed;
}

/* Badge agotado */
.fbt-badge-out {
	position: absolute;
	bottom: 6px;
	left: 50%;
	transform: translateX(-50%);
	background: #b12704;
	color: #fff;
	font-size: .68em;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 2px;
	white-space: nowrap;
}

/* ── Info debajo de la imagen ──────────────────────────── */
.fbt-info { width: 160px; }

.fbt-name {
	font-size: .84em;
	line-height: 1.4;
	color: #111;
	margin: 0 0 5px;
}
.fbt-name strong { font-weight: 700; }
.fbt-name a { color: #0066c0; text-decoration: none; }
.fbt-name a:hover { color: #c45500; text-decoration: underline; }

/* Precio estilo Amazon: entero grande + decimales superíndice */
.fbt-price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px;
	font-size: .9em;
	margin: 0 0 4px;
	line-height: 1;
}
.fbt-price del {
	color: #767676;
	font-size: .88em;
	display: flex;
	align-items: baseline;
}
.fbt-int { font-size: 1.55em; font-weight: 400; }
.fbt-dec { font-size: .7em;   line-height: 0; vertical-align: super; }
.fbt-sym { font-size: .82em; }

.fbt-deliv {
	font-size: .78em;
	color: #111;
	margin: 0;
	line-height: 1.4;
}
.fbt-deliv strong { font-weight: 700; }

/* ── Columna CTA ───────────────────────────────────────── */
.fbt-cta {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 210px;
	max-width: 260px;
	align-self: flex-start;
	padding-top: 2px;
}

.fbt-total-row {
	display: flex;
	align-items: baseline;
	gap: 6px;
	flex-wrap: wrap;
	margin: 0;
}
.fbt-total-lbl { font-size: 1em; color: #111; }
.fbt-total-amt { display: inline-flex; align-items: baseline; }
.fbt-total-amt .fbt-int { font-size: 1.9em; }
.fbt-total-amt .fbt-dec { font-size: .75em; }

/* Botón estilo Amazon */
.fbt-btn-add {
	display: block;
	width: 100%;
	background: #FFD814;
	color: #0F1111;
	border: 1px solid #FCD200;
	border-radius: 20px;
	padding: 9px 16px;
	font-size: 1em;
	font-weight: 400;
	text-align: center;
	cursor: pointer;
	line-height: 1.4;
	transition: background .1s;
}
.fbt-btn-add:hover   { background: #F7CA00; }
.fbt-btn-add:active  { background: #E9BB00; }
.fbt-btn-add:disabled {
	opacity: .5;
	cursor: not-allowed;
}

/* Mensajes */
.fbt-msg {
	font-size: .84em;
	border-radius: 4px;
	padding: 7px 10px;
	line-height: 1.4;
}
.fbt-msg.ok  { background: #ddffdd; color: #007600; border: 1px solid #b3ddb3; }
.fbt-msg.err { background: #fff0f0; color: #b12704; border: 1px solid #f5c6c6; }
.fbt-msg a   { color: inherit; font-weight: 700; }

/* Aviso */
.fbt-notice {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	font-size: .84em;
	color: #111;
	line-height: 1.4;
}
.fbt-notice-svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: #0078c8;
	margin-top: 1px;
}

/* ── Items desmarcados: atenuar ────────────────────────── */
.fbt-item--unchecked .fbt-img,
.fbt-item--unchecked .fbt-info {
	opacity: .4;
}

/* ── Responsive ────────────────────────────────────────── */
@media ( max-width: 640px ) {
	.fbt-layout   { gap: 1em; }
	.fbt-products { flex-direction: column; align-items: flex-start; }

	/* + en horizontal, alineado con la imagen */
	.fbt-plus {
		width: 100%;
		margin-top: 0;
		justify-content: flex-start;
		padding-left: 72px;
		font-size: 1.3em;
	}

	/* Item en fila */
	.fbt-item {
		flex-direction: row;
		width: 100%;
		gap: 10px;
	}
	.fbt-img  { width: 70px; height: 70px; margin-bottom: 0; flex-shrink: 0; }
	.fbt-info { width: auto; flex: 1; }

	.fbt-cta  { width: 100%; max-width: 100%; }
}
