/* Clyck · Precios y WhatsApp — los colores y tipografías vienen de los ajustes (variables --clp-*) */

/* ---------- Precio de la ficha [mi_precios] ---------- */
.clp-oculta-precio-wc .woocommerce-variation-price,
.clp-oculta-precio-wc .elementor-widget-woocommerce-product-price,
.clp-oculta-precio-wc .product-type-simple .summary .price:not(.custom-price) {
	display: none !important;
}
.clp-precio__monto {
	margin: 0;
	font-family: var(--clp-single-font, inherit);
	font-size: var(--clp-single-size, 40px);
	font-weight: var(--clp-single-weight, 600);
	color: var(--clp-precio, inherit);
	line-height: 1.15;
}
.clp-badges {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 15px;
	font-family: var(--clp-cuotas-font, inherit);
	font-size: var(--clp-cuotas-size, 14px);
	font-weight: var(--clp-cuotas-weight, 600);
}
.clp-badge {
	display: block;
	margin: 0;
	padding: 10px 12px;
	line-height: 1.35;
}
.clp-badge--cuota { background: var(--clp-cuota-bg, #cca459); color: var(--clp-cuota-txt, #fff); }
.clp-badge--transf { background: var(--clp-transf-bg, #28a745); color: var(--clp-transf-txt, #fff); }
.clp-fija { margin: 0; font-weight: 400; }

/* ---------- Grillas [mi_precio_loop] ---------- */
.clp-loop__precio {
	margin: 0 !important;
	font-family: var(--clp-loop-font, inherit);
	font-size: var(--clp-loop-size, 20px);
	font-weight: var(--clp-loop-weight, 600);
	color: var(--clp-precio, inherit);
}
.clp-loop__desde {
	font-size: .7em;
	font-weight: 400;
}
.clp-loop__cuota,
.clp-loop__transf {
	margin: 4px 0 0 !important;
	padding: 0;
	font-family: var(--clp-cuotas-font, inherit);
	font-size: var(--clp-cuotas-size, 14px);
	font-weight: var(--clp-cuotas-weight, 600);
	line-height: 1.3;
}
.clp-loop__cuota { color: var(--clp-loop-cuota, #cca459); }
.clp-loop__transf { color: var(--clp-loop-transf, #28a745); }
.clp-resumen {
	margin: 2px 0 2px;
	font-size: 13px;
	color: #55595c;
}

/* ---------- Tabla por medida y material ---------- */
.clp-tabla {
	margin: 22px 0 24px;
	color: var(--clp-tabla-txt, #11191f);
	font-family: var(--clp-cuotas-font, inherit);
}
.clp-tabla__titulo {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	margin-bottom: 10px;
}
.clp-tabla__grid { display: grid; gap: 6px; }
.clp-tabla__fila {
	display: grid;
	grid-template-columns: minmax(84px, .7fr) repeat(var(--clp-cols, 1), minmax(0, 1fr));
	gap: 6px;
	align-items: stretch;
}
.clp-tabla__fila--head > div {
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #55595c;
	align-self: end;
}
.clp-tabla__rot {
	display: flex;
	flex-direction: column;
	justify-content: center;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	min-width: 0;
}
.clp-tabla__rot small {
	font-size: 11.5px;
	font-weight: 400;
	color: #55595c;
	margin-top: 2px;
}
.clp-tabla .clp-celda {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 3px;
	min-width: 0;
	padding: 10px 12px;
	background: var(--clp-tabla-bg, #e5e1dd);
	color: var(--clp-tabla-txt, #11191f);
	line-height: 1.25;
	cursor: pointer;
	user-select: none;
	transition: background-color .15s ease, color .15s ease;
}
.clp-tabla .clp-celda:hover { background: var(--clp-tabla-hover, #cbc8be); }
.clp-tabla .clp-celda:focus-visible { outline: 2px solid var(--clp-tabla-txt, #11191f); outline-offset: 2px; }
.clp-tabla .clp-celda.is-active { background: var(--clp-tabla-act-bg, #11191f); color: var(--clp-tabla-act-txt, #fff); }
.clp-tabla .clp-celda.is-active .clp-celda__nota { color: inherit; opacity: .85; }
.clp-tabla .clp-celda--vacia { cursor: default; background: transparent; }
.clp-tabla .clp-celda--vacia:hover { background: transparent; }
.clp-celda__mat { display: none; }
.clp-celda__precio {
	font-size: 16px;
	font-weight: 600;
	letter-spacing: -.01em;
	white-space: nowrap;
}
.clp-celda__nota {
	font-size: 12px;
	font-weight: 400;
	opacity: .78;
}
.clp-celda__nota--transf { opacity: .9; }
.clp-tabla__pie {
	margin-top: 10px;
	font-size: 12.5px;
	color: #55595c;
}

/* Ocultar los selectores cuando se elige desde la tabla */
.clp-oculta-selectores form.variations_form table.variations tr.clp-ctrl { display: none; }
.clp-tabla__nota {
	margin-top: 10px;
	font-size: 13px;
	font-weight: 600;
}

/* Móvil: cada medida con sus materiales en renglones */
@media (max-width: 640px) {
	.clp-tabla__fila--head { display: none; }
	.clp-tabla__fila { grid-template-columns: 1fr; gap: 4px; margin-bottom: 8px; }
	.clp-tabla__rot { flex-direction: row; align-items: baseline; gap: 8px; padding-top: 2px; }
	.clp-tabla__rot--muestra { align-items: center; }
	.clp-tabla .clp-celda {
		display: grid;
		grid-template-columns: 1fr auto;
		align-items: baseline;
		column-gap: 12px;
		row-gap: 2px;
	}
	.clp-celda__mat { display: block; grid-column: 1; font-size: 13.5px; font-weight: 600; }
	.clp-celda__precio { grid-column: 2; grid-row: 1; text-align: right; }
	.clp-celda__nota { grid-column: 1 / -1; }
	.clp-tabla[data-cols="1"] .clp-celda__mat { display: none; }
	.clp-tabla[data-cols="1"] .clp-celda__precio { grid-column: 1 / -1; text-align: left; }
	.clp-tabla .clp-celda--vacia { display: none; }
}

/* ---------- WhatsApp ---------- */
.clp-wa-wrap { margin: 14px 0 6px; }
a.clp-wa,
a.clp-wa:visited {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 52px;
	padding: 14px 20px;
	background: var(--clp-wa-bg, #000);
	color: var(--clp-wa-txt, #e5e1dd);
	border: 0;
	border-radius: 0;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
	transition: opacity .15s ease;
}
a.clp-wa:hover,
a.clp-wa:focus-visible { color: var(--clp-wa-txt, #e5e1dd); opacity: .88; }
a.clp-wa:focus-visible { outline: 2px solid var(--clp-wa-bg, #000); outline-offset: 2px; }
.clp-wa__icon { width: 22px; height: 22px; flex: 0 0 22px; }
.clp-wa-nota {
	margin-top: 8px;
	font-size: 13px;
	color: #55595c;
	text-align: center;
}

/* ---------- "Añadir al carrito" secundario ---------- */
body.clp-carrito-secundario form.cart .single_add_to_cart_button,
body.clp-carrito-secundario form.cart button.single_add_to_cart_button.button {
	background: var(--clp-carrito-bg, #e5e1dd) !important;
	color: var(--clp-carrito-txt, #000) !important;
	border-color: var(--clp-carrito-bg, #e5e1dd) !important;
}
body.clp-carrito-secundario form.cart .single_add_to_cart_button:hover { opacity: .85; }

/* ---------- Muestras de material ---------- */
.clp-tabla__colhead {
	display: flex;
	align-items: center;
	gap: 8px;
}
.clp-tabla__swatch {
	width: 28px;
	height: 28px;
	object-fit: cover;
	flex: 0 0 28px;
	border-radius: 0;
}
.clp-tabla__rot--muestra {
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
}
.clp-muestra {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 6px 0 16px;
}
.clp-muestra[hidden] { display: none; }
a.clp-muestra__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 14px 8px 8px;
	background: var(--clp-tabla-bg, #e5e1dd);
	color: var(--clp-tabla-txt, #11191f);
	text-decoration: none;
	line-height: 1.2;
}
a.clp-muestra__item img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	display: block;
}
a.clp-muestra__item span {
	display: flex;
	flex-direction: column;
	font-size: 15px;
	font-weight: 600;
}
a.clp-muestra__item small {
	font-size: 11.5px;
	font-weight: 400;
	letter-spacing: .04em;
	text-transform: uppercase;
	opacity: .75;
	margin-bottom: 2px;
}

/* ---------- Plazo de entrega ---------- */
.clp-plazo {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 600;
	color: var(--clp-tabla-txt, #11191f);
}

/* ---------- Madera <-> melamina ---------- */
a.clp-cruce,
a.clp-cruce:visited {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 12px 0 4px;
	padding: 12px 14px;
	border: 1px solid var(--clp-tabla-bg, #e5e1dd);
	color: var(--clp-tabla-txt, #11191f);
	font-size: 14px;
	text-decoration: none;
	line-height: 1.3;
}
a.clp-cruce:hover { background: var(--clp-tabla-bg, #e5e1dd); }
.clp-cruce__flecha { font-size: 18px; }

/* ---------- Celular: selector de material y medida ---------- */
.clp-chooser { display: none; }
@media (max-width: 640px) {
	body.clp-movil-selector .clp-tabla.has-chooser .clp-chooser { display: block; }
	body.clp-movil-selector .clp-tabla.has-chooser:not(.is-open) .clp-tabla__grid { display: none; }
	body.clp-movil-selector .clp-tabla.has-chooser .clp-tabla__titulo { display: none; }
	.clp-chooser__grupo { margin-bottom: 14px; }
	.clp-chooser__label {
		font-size: 12px;
		font-weight: 600;
		letter-spacing: .05em;
		text-transform: uppercase;
		color: #55595c;
		margin-bottom: 8px;
	}
	.clp-chooser__chips { display: flex; flex-wrap: wrap; gap: 8px; }
	.clp-tabla button.clp-chip {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		min-height: 44px;
		margin: 0;
		padding: 6px 14px;
		background: #fff;
		color: var(--clp-tabla-txt, #11191f);
		border: 1px solid #cbc8be;
		border-radius: 0;
		font: inherit;
		font-size: 14px;
		font-weight: 600;
		line-height: 1.2;
		text-transform: none;
		letter-spacing: 0;
		cursor: pointer;
	}
	.clp-tabla button.clp-chip--muestra { padding-left: 6px; }
	.clp-tabla button.clp-chip img { width: 32px; height: 32px; object-fit: cover; display: block; }
	.clp-tabla button.clp-chip.is-active {
		border-color: var(--clp-tabla-act-bg, #11191f);
		box-shadow: inset 0 0 0 1px var(--clp-tabla-act-bg, #11191f);
		background: var(--clp-tabla-bg, #e5e1dd);
	}
	.clp-tabla button.clp-chip.is-na { opacity: .45; }
	.clp-tabla button.clp-chip:focus-visible { outline: 2px solid var(--clp-tabla-txt, #11191f); outline-offset: 2px; }
	.clp-chooser__precio {
		padding: 12px 14px;
		background: var(--clp-tabla-bg, #e5e1dd);
		color: var(--clp-tabla-txt, #11191f);
	}
	.clp-chooser__monto { font-size: 24px; font-weight: 600; line-height: 1.2; }
	.clp-chooser__monto small { font-size: 13px; font-weight: 400; }
	.clp-chooser__nota { font-size: 13px; margin-top: 2px; opacity: .85; }
	.clp-tabla button.clp-chooser__toggle {
		display: block;
		margin: 10px 0 0;
		padding: 4px 0;
		background: none;
		border: 0;
		color: var(--clp-tabla-txt, #11191f);
		font: inherit;
		font-size: 13px;
		font-weight: 600;
		text-decoration: underline;
		text-transform: none;
		letter-spacing: 0;
		cursor: pointer;
	}
	.clp-tabla.is-open .clp-tabla__grid { margin-top: 12px; }
}

/* ---------- Celular: miniaturas de la galería en una fila ---------- */
@media (max-width: 767px) {
	body.clp-movil-galeria .woocommerce-product-gallery .flex-control-thumbs {
		display: flex !important;
		flex-wrap: nowrap !important;
		gap: 6px;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch;
		margin: 6px 0 0 !important;
		padding: 0 !important;
		scrollbar-width: none;
	}
	body.clp-movil-galeria .woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar { display: none; }
	body.clp-movil-galeria .woocommerce-product-gallery .flex-control-thumbs li {
		flex: 0 0 64px !important;
		width: 64px !important;
		max-width: 64px !important;
		margin: 0 !important;
		float: none !important;
		scroll-snap-align: start;
	}
	body.clp-movil-galeria .woocommerce-product-gallery .flex-control-thumbs li img {
		width: 64px !important;
		height: 64px !important;
		object-fit: cover;
	}
}

/* ---------- Celular: barra fija de WhatsApp ---------- */
.clp-wa-fija { display: none; }
@media (max-width: 767px) {
	.clp-wa-fija {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9990;
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
		background: #fff;
		box-shadow: 0 -2px 12px rgba(0, 0, 0, .12);
		transform: translateY(110%);
		transition: transform .2s ease;
	}
	.clp-wa-fija.is-visible { transform: none; }
	.clp-wa-fija__precio { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
	.clp-wa-fija__precio small { font-size: 11px; color: #55595c; }
	.clp-wa-fija__precio small:empty { display: none; }
	.clp-wa-fija__precio strong { font-size: 18px; color: var(--clp-precio, #000); white-space: nowrap; }
	.clp-wa-fija a.clp-wa--fija,
	.clp-wa-fija a.clp-wa--fija:visited {
		flex: 1 1 auto;
		width: auto;
		min-height: 46px;
		padding: 10px 14px;
		font-size: 15px;
	}
	/* En la ficha, la barra reemplaza al botón flotante verde. */
	body.clp-wa-fija-activa .elementor-widget-icon:has(a[href*="api.whatsapp.com"]),
	body.clp-wa-fija-activa .elementor-widget-icon:has(a[href*="wa.me/"]) { display: none !important; }
	body.clp-wa-fija-activa { padding-bottom: 72px; }
}
@media (prefers-reduced-motion: reduce) { .clp-wa-fija { transition: none; } }

/* ---------- Celular: grillas a 2 columnas ---------- */
@media (max-width: 640px) {
	.clp-loop__precio { font-size: min(var(--clp-loop-size, 20px), 16px) !important; white-space: nowrap; }
	.clp-loop__desde { font-size: 12px; }
	.clp-loop__cuota,
	.clp-loop__transf { font-size: min(var(--clp-cuotas-size, 14px), 12.5px); }
	.clp-resumen { font-size: 12px; }
}
