/* ═══════════════════════════════════════════════════════
   TRIBO DO AÇAÍ — Bowl Configurador Widget v0.8
   Todos los selectores usan el prefijo .tb- para evitar
   conflictos con el tema o con Elementor.
   ═══════════════════════════════════════════════════════ */

/* ── Contenedor principal ───────────────────────────── */
.tribo-bowl {
	font-family: inherit;
	background: #fff;
	border-radius: 20px;
	padding: 28px 24px 22px;
	display: flex;
	flex-direction: column;
	gap: 20px;
	box-sizing: border-box;
	width: 100%;
}

/* ── Bloques (cada paso) ────────────────────────────── */
.tb-block {
	display: flex;
	flex-direction: column;
	gap: 10px;
	transition: opacity .25s ease;
}

/* Paso bloqueado: grisado e inaccesible hasta que se completa el anterior */
.tb-block.tb-locked {
	opacity: .28;
	pointer-events: none;
	user-select: none;
}

/* Elementos ocultos hasta primera selección de tamaño */
.tb-start-hidden {
	display: none;
}

.tb-label {
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .07em;
	color: #B21E6F;
}

/* ── Paso 1: Bases ──────────────────────────────────── */
.tb-bases {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.tb-base-pill {
	flex: 1;
	min-width: 80px;
	padding: 10px 12px;
	border-radius: 50px;
	border: 1.5px solid #e0d0eb;
	background: #fff;
	color: #540070;
	font-size: .85rem;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	justify-content: center;
	transition: background .15s, border-color .15s, color .15s;
	line-height: 1;
}

/* !important en el estado activo: necesario porque Elementor puede tener cacheado
   CSS de versiones anteriores con la misma especificidad que anularía estos valores.
   El texto blanco sobre fondo de color es crítico para la accesibilidad. */
.tribo-bowl .tb-base-pill:hover,
.tribo-bowl .tb-base-pill.tb-sel {
	background: #B21E6F !important;
	border-color: #B21E6F !important;
	color: #fff !important;
}

/* ── Paso 2: Tamaños ────────────────────────────────── */
.tb-sizes {
	display: flex;
	gap: 6px;
}

.tb-size-pill {
	flex: 1;
	padding: 12px 6px 10px;
	border-radius: 14px;
	border: 1.5px solid #e0d0eb;
	background: #fff;
	font-size: .75rem;
	font-weight: 700;
	color: #540070;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	transition: background .15s, border-color .15s, color .15s;
	white-space: nowrap;
	line-height: 1;
}

.tribo-bowl .tb-size-pill:hover,
.tribo-bowl .tb-size-pill.tb-sel {
	background: #B21E6F !important;
	border-color: #B21E6F !important;
	color: #fff !important;
}

/* Línea de meta (precio + toppings) bajo la etiqueta del tamaño */
.tb-size-meta {
	display: block;
	font-size: .63rem;
	font-weight: 500;
	color: #aaa;
	line-height: 1.3;
	margin-top: 3px;
	/* El pill padre tiene white-space:nowrap para la etiqueta;
	   el meta puede romper línea en pantallas pequeñas */
	white-space: normal;
	text-align: center;
}

.tribo-bowl .tb-size-pill:hover .tb-size-meta,
.tribo-bowl .tb-size-pill.tb-sel .tb-size-meta {
	color: rgba(255,255,255,.72) !important;
}

/* ── Info row (resumen de selección) ────────────────── */
.tb-info-row {
	padding-top: 10px;
	border-top: 1px solid #f0e8f5;
}

/* Fila con todos los pills de resumen */
.tb-info-pills {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.tb-bowl-name {
	font-size: 1rem;
	font-weight: 700;
	color: #3a004e;
}

/* Badge compacto con icono de bowl + etiqueta del tamaño */
.tb-size-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #F3E9F7;
	color: #540070;
	border-radius: 50px;
	padding: 3px 10px 3px 6px;
	font-size: .75rem;
	font-weight: 700;
	line-height: 1;
}

.tb-size-badge svg {
	flex-shrink: 0;
}

.tb-inc-num,
.tb-max-num {
	font-weight: 700;
	color: #540070;
}

/* Pill: toppings incluidos */
.tb-inc-pill {
	display: inline-flex;
	align-items: center;
	background: #F3E9F7;
	color: #540070;
	border-radius: 50px;
	padding: 3px 9px;
	font-size: .70rem;
	font-weight: 700;
	line-height: 1;
}

/* Pill: extras estándar cobrados — visible solo cuando JS lo activa */
.tb-extra-pill {
	display: none;
	align-items: center;
	background: #fff8ec;
	color: #9a5a00;
	border: 1px solid #f5d280;
	border-radius: 50px;
	padding: 3px 9px;
	font-size: .70rem;
	font-weight: 700;
	line-height: 1;
}

/* Pill: premium cobrados — visible solo cuando JS lo activa */
.tb-prem-pill {
	display: none;
	align-items: center;
	background: #fef9e7;
	color: #7a5c00;
	border: 1px solid #f0de8a;
	border-radius: 50px;
	padding: 3px 9px;
	font-size: .70rem;
	font-weight: 700;
	line-height: 1;
}

.tb-price {
	font-size: 1.65rem;
	font-weight: 800;
	color: #540070;
	line-height: 1;
	white-space: nowrap;
	flex-shrink: 0;
}

.tb-desc {
	font-size: .78rem;
	color: #aaa;
	line-height: 1.5;
	margin: -10px 0 0;
	min-height: 1.2em;
}

/* ── Paso 3: Toppings ───────────────────────────────── */
.tb-toppings {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.tb-topping {
	padding: 7px 13px;
	border-radius: 50px;
	border: 1.5px solid transparent;
	font-size: .78rem;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	transition: background .15s, color .15s, border-color .15s;
	line-height: 1;
}

/* Estándar — lila. Mayor especificidad para el estado selected. */
.tb-std {
	background: #F3E9F7;
	color: #540070;
	border-color: #e0d0eb;
}

.tribo-bowl .tb-std.tb-sel {
	background: #540070 !important;
	color: #fff !important;
	border-color: #540070 !important;
}

/* Premium — dorado */
.tb-premium {
	background: #fef9e7;
	color: #7a5c00;
	border-color: #f0de8a;
}

.tribo-bowl .tb-premium.tb-sel {
	background: #c9a200 !important;
	color: #fff !important;
	border-color: #c9a200 !important;
}

.tb-topping-price {
	font-size: .7rem;
	opacity: .8;
}

/* Quitar outline por defecto; .tb-sel gestiona el estado activo visualmente */
.tb-base-pill:focus,
.tb-size-pill:focus,
.tb-topping:focus {
	outline: none;
}

/* Animación shake (reservada para uso futuro) */
@keyframes tb-shake {
	0%,  100% { transform: translateX(0); }
	20%        { transform: translateX(-6px); }
	50%        { transform: translateX(6px); }
	80%        { transform: translateX(-3px); }
}

.tb-shake {
	animation: tb-shake .35s ease;
}

/* ── Hint bajo los toppings ─────────────────────────── */
.tb-topping-hint {
	font-size: .73rem;
	color: #bbb;
	line-height: 1.5;
	margin: 0;
}

/* ── Footer: total + CTA ────────────────────────────── */
.tb-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 16px;
	border-top: 1px solid #f0e8f5;
	gap: 12px;
	flex-wrap: wrap;
}

.tb-total {
	font-size: .9rem;
	color: #3a004e;
}

.tb-total strong {
	font-size: 1.15rem;
}

/* CTA sin !important para que los controles de Elementor puedan sobreescribir */
.tb-cta {
	background: #3FA34D;
	color: #fff;
	border: none;
	border-radius: 50px;
	padding: 12px 24px;
	font-size: .88rem;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	transition: background .15s;
	white-space: nowrap;
	line-height: 1.3;
}

.tb-cta:hover {
	background: #348841;
	color: #fff;
}

/* ── Panel flotante de resumen (position:fixed, fuera del widget) ── */

.tb-float-panel {
	position: fixed;
	bottom: 28px;
	right: 28px;
	z-index: 9999;
	background: #fff;
	border-radius: 16px;
	padding: 14px 18px 16px;
	box-shadow: 0 6px 32px rgba(58, 0, 78, .18), 0 1px 4px rgba(0, 0, 0, .08);
	min-width: 210px;
	max-width: 280px;
	display: none;             /* JS lo muestra cuando hay selección */
	font-family: inherit;
	border-left: 4px solid #B21E6F;
	animation: tb-fp-in .2s ease;
}

@keyframes tb-fp-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

.tb-fp-label {
	font-size: .65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #B21E6F;
	margin-bottom: 6px;
}

.tb-fp-main {
	font-size: .92rem;
	font-weight: 700;
	color: #3a004e;
	margin-bottom: 4px;
	line-height: 1.3;
}

.tb-fp-tops-val {
	font-size: .72rem;
	color: #999;
	line-height: 1.5;
}

.tb-fp-price-val {
	font-size: 1.4rem;
	font-weight: 900;
	color: #B21E6F;
	margin-top: 8px;
	border-top: 1px solid #f0e8f5;
	padding-top: 8px;
	line-height: 1;
}

@media (max-width: 600px) {
	.tb-float-panel {
		left: 16px;
		right: 16px;
		bottom: 16px;
		max-width: unset;
		min-width: unset;
		border-left: none;
		border-top: 4px solid #B21E6F;
		border-radius: 14px;
		text-align: center;
	}
}

/* ── Pantalla de confirmación ───────────────────────── */

/* Oculto por defecto: el JS añade .tb-confirming a .tribo-bowl */
.tb-confirm {
	display: none;
}

/* Esconde todos los hijos directos excepto .tb-confirm */
.tribo-bowl.tb-confirming > *:not(.tb-confirm) {
	display: none !important;
}

.tribo-bowl.tb-confirming .tb-confirm {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	text-align: center;
	padding: 12px 4px 8px;
}

/* Foto del bowl */
.tb-confirm-img {
	width: 100%;
	max-width: 220px;
	aspect-ratio: 1 / 1;
	border-radius: 20px;
	object-fit: cover;
}

/* Encabezado: base + badge de tamaño */
.tb-confirm-heading {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: center;
}

.tb-confirm-base-name {
	font-size: 1.2rem;
	font-weight: 800;
	color: #3a004e;
}

.tb-confirm-size-name {
	background: #F3E9F7;
	color: #540070;
	border-radius: 50px;
	padding: 4px 12px;
	font-size: .82rem;
	font-weight: 700;
	line-height: 1;
}

/* Toppings incluidos — subtexto discreto */
.tb-confirm-inc-text {
	font-size: .75rem;
	color: #bbb;
	margin-top: -6px;
}

/* Lista de toppings seleccionados */
.tb-confirm-tops-text {
	font-size: .85rem;
	color: #540070;
	font-weight: 600;
	line-height: 1.7;
	max-width: 280px;
}

/* Precio grande: estilo "mostrador de caja / display TPV" */
.tb-confirm-big-price {
	font-size: 4.2rem;
	font-weight: 900;
	color: #B21E6F;
	line-height: 1;
	letter-spacing: -.03em;
}

/* Desglose de precio (base + extras + premium) */
.tb-confirm-breakdown {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 190px;
	border-top: 1px solid #f0e8f5;
	padding-top: 10px;
	margin-top: -6px;
}

.tb-bd-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 20px;
	font-size: .75rem;
	color: #ccc;
	line-height: 1.8;
}

.tb-bd-row span:last-child {
	font-weight: 700;
	white-space: nowrap;
}

.tb-bd-extra {
	color: #c07a00;
}

.tb-bd-prem {
	color: #9a7a00;
}

/* Botón volver */
.tb-back-btn {
	background: none;
	border: 1.5px solid #e0d0eb;
	color: #540070;
	border-radius: 50px;
	padding: 10px 24px;
	font-size: .82rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
	margin-top: 4px;
	font-family: inherit;
	line-height: 1;
}

.tb-back-btn:hover {
	background: #F3E9F7;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 520px) {
	.tribo-bowl {
		padding: 20px 16px;
		gap: 16px;
	}

	.tb-sizes {
		flex-wrap: wrap;
	}

	.tb-size-pill {
		flex: 1 1 calc(33.33% - 6px);
		min-width: 56px;
	}

	.tb-footer {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}

	.tb-cta {
		text-align: center;
	}
}
