/* WooCommerce WhatsApp Assistant — estilos frontend (prefijo waw- para evitar conflictos) */

.waw-root,
.waw-root * {
	box-sizing: border-box;
}

/* ---------- Botón "Preguntar por WhatsApp" en producto ---------- */

.waw-product-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	margin-top: 12px;
	padding: 14px 20px;
	background: #ffffff;
	color: #111111;
	border: 1px solid #111111;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, transform .15s ease;
	-webkit-tap-highlight-color: transparent;
}

.waw-product-btn:hover,
.waw-product-btn:focus-visible {
	background: #111111;
	color: #ffffff;
	text-decoration: none;
}

.waw-product-btn:active {
	transform: scale(0.99);
}

.waw-product-btn .waw-icon-whatsapp {
	flex-shrink: 0;
	color: currentColor;
}

.waw-product-btn .waw-btn-text {
	white-space: nowrap;
}

@media (max-width: 480px) {
	.waw-product-btn {
		font-size: 14px;
		padding: 13px 14px;
		gap: 8px;
	}
}

/* ---------- Botón flotante ---------- */

.waw-root {
	--waw-z-index: 999999;
	--waw-offset-desktop: 32px;
	--waw-offset-mobile: 100px;
	position: fixed;
	bottom: var(--waw-offset-desktop);
	z-index: var(--waw-z-index);
}

.waw-root.waw-pos-right {
	right: 24px;
}

.waw-root.waw-pos-left {
	left: 24px;
}

.waw-fab {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #ffffff;
	color: #111111;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	padding: 0;
	transition: transform .2s ease, box-shadow .2s ease;
}

.waw-fab:hover,
.waw-fab:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.waw-fab .waw-icon-whatsapp {
	width: 30px;
	height: 30px;
}

@media (max-width: 480px) {
	.waw-root.waw-pos-right { right: 16px; }
	.waw-root.waw-pos-left { left: 16px; }
	/* Se eleva sobre la barra de navegación inferior fija que usan muchos temas móviles. */
	.waw-root { bottom: calc(var(--waw-offset-mobile) + env(safe-area-inset-bottom)); }
	.waw-fab {
		width: 52px;
		height: 52px;
	}
	.waw-fab .waw-icon-whatsapp {
		width: 26px;
		height: 26px;
	}
}

.waw-hide-desktop {
	display: none;
}
.waw-hide-mobile {
	display: block;
}
@media (max-width: 782px) {
	.waw-hide-desktop { display: block; }
	.waw-hide-mobile { display: none; }
}

/* ---------- Globo de aviso ("¿Necesitas asesoría?") ---------- */

.waw-teaser {
	position: fixed;
	right: 24px;
	bottom: calc(var(--waw-offset-desktop) + 78px);
	max-width: 280px;
	z-index: calc(var(--waw-z-index) + 100);
	opacity: 0;
	pointer-events: none;
	transform: translateY(8px) scale(0.98);
	transition: opacity .25s ease, transform .25s ease;
}

.waw-teaser.waw-visible {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.waw-root.waw-pos-left .waw-teaser {
	right: auto;
	left: 24px;
}

@media (max-width: 480px) {
	.waw-teaser {
		right: 16px;
		bottom: calc(var(--waw-offset-mobile) + 70px);
		max-width: min(280px, calc(100vw - 32px));
	}
	.waw-root.waw-pos-left .waw-teaser {
		right: auto;
		left: 16px;
	}
}

.waw-teaser-body {
	display: block;
	width: 100%;
	background: #ffffff;
	color: #111111;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 14px;
	padding: 14px 18px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0;

	text-align: left;
	position: relative;
	z-index: 0;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease;
}

/* Pequeña punta visual hacia el botón flotante, inspirada en el globo de referencia. */
.waw-teaser-body::after {
	content: "";
	position: absolute;
	right: 24px;
	bottom: -7px;
	width: 14px;
	height: 14px;
	background: #ffffff;
	border-right: 1px solid rgba(0, 0, 0, 0.08);
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	transform: rotate(45deg);
}

.waw-teaser-body:hover,
.waw-teaser-body:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.waw-teaser-close {
	position: absolute;
	z-index: 10000;
	top: -9px;
	right: -9px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #ffffff;
	color: #111111;
	border: 1px solid rgba(0, 0, 0, 0.1);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
}

.waw-teaser-close .waw-icon-close {
	width: 12px;
	height: 12px;
}

/* ---------- Overlay + Modal ---------- */

.waw-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 20, 20, 0.35);
	z-index: calc(var(--waw-z-index) - 1);
	opacity: 0;
	transition: opacity .25s ease;
}

.waw-modal-overlay.waw-visible {
	opacity: 1;
}

.waw-modal {
	position: fixed;
	right: 24px;
	bottom: calc(var(--waw-offset-desktop) + 78px);
	left: auto;
	width: 380px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 140px);
	overflow-y: auto;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
	padding: 28px 24px 24px;
	z-index: var(--waw-z-index);
	opacity: 0;
	transform: translateY(16px) scale(0.98);
	transition: opacity .22s ease, transform .22s ease;
}

.waw-root.waw-pos-left .waw-modal {
	right: auto;
	left: 24px;
}

.waw-modal.waw-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
}

@media (max-width: 480px) {
	.waw-modal {
		right: 16px;
		left: 16px;
		width: auto;
		bottom: calc(var(--waw-offset-mobile) + 70px);
		max-height: calc(100vh - 190px);
		padding: 24px 18px 18px;
	}
	.waw-root.waw-pos-left .waw-modal {
		left: 16px;
	}
}

.waw-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: transparent;
	border: 1px solid rgba(0, 0, 0, 0.1);
	color: #111111;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background-color .15s ease;
}

.waw-modal-close:hover,
.waw-modal-close:focus-visible {
	background: #f2f2f2;
}

.waw-modal-title {
	margin: 0 40px 20px 0;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-align: center;
	color: #111111;
}

.waw-modal-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.waw-option-card {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
	transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.waw-option-card:hover,
.waw-option-card:focus-visible {
	border-color: rgba(0, 0, 0, 0.35);
	background: #fafafa;
	text-decoration: none;
	color: inherit;
	transform: translateY(-1px);
}

.waw-option-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #111111;
	margin-top: 2px;
}

.waw-option-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.waw-option-title {
	font-size: 15px;
	font-weight: 700;
	color: #111111;
}

.waw-option-text {
	font-size: 13px;
	line-height: 1.45;
	color: #555555;
}

/* Bloquea el scroll del body cuando el modal está abierto (clase añadida vía JS) */
body.waw-modal-open {
	overflow: hidden;
}
