/* =========================================================
   Academia EBAB — Cartas de producto (idéntico a Figma 82:18)
   ========================================================= */

/* =========================================================
   BLINDAJE anti Elementor Kit
   El kit (.elementor-kit-xxx) impone tipografía, colores y
   estilos de botón/enlace sobre elementos genéricos (h1-h6, p,
   a, button, ul, li, img…). Aquí se neutralizan esas herencias
   dentro de nuestros contenedores. Las reglas específicas de
   cada componente van DESPUÉS y también con !important, así
   ganan por orden de cascada.
   ========================================================= */

/* Raíces protegidas: cartas + los tres popups (van al <body>). */
.aebab-cards,
.aebab-cards *,
.aebab-cards *::before,
.aebab-cards *::after,
.aebab-wa-modal,
.aebab-wa-modal *,
.aebab-wa-modal *::before,
.aebab-wa-modal *::after,
.aebab-details-modal,
.aebab-details-modal *,
.aebab-details-modal *::before,
.aebab-details-modal *::after {
	box-sizing: border-box !important;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	font-style: normal;
}

/* Botones, enlaces y campos: quita el "chrome" que mete el tema
   (sombras, subrayados, contornos, mín-altura, fuentes raras).
   El aspecto real lo re-aplica cada clase de componente. */
.aebab-cards a,
.aebab-cards button,
.aebab-wa-modal a,
.aebab-wa-modal button,
.aebab-wa-modal textarea,
.aebab-details-modal a,
.aebab-details-modal button {
	font-family: inherit !important;
	text-decoration: none !important;
	box-shadow: none !important;
	outline: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

/* Imágenes: el tema a veces fuerza max-width/height/filtros. */
.aebab-cards img,
.aebab-details-modal img,
.aebab-wa-modal img {
	max-width: 100% !important;
	height: auto;
	filter: none !important;
}

.aebab-cards {
	display: grid;
	grid-template-columns: repeat( var( --aebab-cols, 4 ), minmax( 0, 1fr ) );
	gap: 24px;
	width: 100%;
	box-sizing: border-box;
}

.aebab-cards * {
	box-sizing: border-box;
}

/* ---------- Carta ---------- */
.aebab-card {
	display: flex !important;
	flex-direction: column !important;
	background: #ffffff !important;
	border: 1px solid #dae1ed !important;
	border-radius: 16px !important;
	padding: 8px !important;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.aebab-card:hover {
	border-color: #c3cede;
	box-shadow: 0 12px 28px rgba( 15, 17, 20, 0.1 );
	transform: translateY( -2px );
}

/* ---------- Imagen ---------- */
.aebab-card__media {
	display: block;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 8px;
	aspect-ratio: 306 / 198;
	background: #eef2f8;
}

.aebab-card__media .aebab-card__img,
.aebab-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.aebab-card:hover .aebab-card__media img {
	transform: scale( 1.04 );
}

/* ---------- Cuerpo ---------- */
.aebab-card__body {
	display: flex;
	flex-direction: column;
	padding: 8px;
	flex: 1 1 auto;
}

.aebab-card__title {
	margin: 0 0 4px;
	font-family: "Source Sans 3", "Source Sans Pro", -apple-system, sans-serif;
	font-size: 18px !important;
	font-weight: 500 !important;
	line-height: 22px !important;
	color: #0f1114;
}

.aebab-card__title a {
	color: inherit !important;
	text-decoration: none !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	line-height: inherit !important;
	transition: color 0.15s ease;
}

.aebab-card__title a:hover {
	color: #0070f9 !important;
}

.aebab-card__desc,
.aebab-card__desc p {
	font-family: "Source Sans 3", "Source Sans Pro", -apple-system, sans-serif;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 16px !important;
	color: #5b6780;
}

.aebab-card__desc {
	margin-bottom: 8px;
}

/* Recorte a 2 líneas */
.aebab-card__desc.is-clamped {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.aebab-card__desc p {
	margin: 0 0 6px;
}

.aebab-card__desc p:last-child {
	margin-bottom: 0;
}

.aebab-card__price,
.aebab-card__price .woocommerce-Price-amount,
.aebab-card__price ins,
.aebab-card__price del {
	font-family: "Source Sans 3", "Source Sans Pro", -apple-system, sans-serif;
	font-size: 14px !important;
	line-height: 20px !important;
}

.aebab-card__price {
	margin: 0 0 8px;
	font-weight: 700 !important;
	color: #0f1114 !important;
}

.aebab-card__price del {
	color: #9aa4b7;
	font-weight: 400;
	margin-right: 6px;
}

.aebab-card__price ins {
	text-decoration: none;
}

/* ---------- Acciones ---------- */
.aebab-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: auto;
	padding-top: 8px;
}

.aebab-card__btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 6px 12px !important;
	border-radius: 4px !important;
	font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 14px !important;
	color: #fffbeb !important;
	text-decoration: none !important;
	border: 0 !important;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.1s ease;
}

.aebab-card__btn:hover {
	filter: brightness( 1.08 );
}

.aebab-card__btn:active {
	transform: translateY( 1px );
}

.aebab-card__btn--details {
	background: #0070f9 !important;
}

.aebab-card__btn--wa {
	background: #25d366 !important;
}

.aebab-card__wa-ico {
	flex: 0 0 auto;
}

/* ---------- Responsive ---------- */
@media ( max-width: 1024px ) {
	.aebab-cards {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
		gap: 16px;
	}
}

@media ( max-width: 560px ) {
	.aebab-cards {
		grid-template-columns: 1fr;
	}
}

/* =========================================================
   Modal de WhatsApp (chat) — idéntico a Figma 38:2308
   ========================================================= */

.aebab-wa-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.aebab-wa-modal.is-open {
	display: flex;
}

.aebab-wa-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 8, 10, 14, 0.55 );
	backdrop-filter: blur( 2px );
	animation: aebab-wa-fade 0.2s ease;
}

.aebab-wa-chat {
	position: relative;
	width: 100%;
	max-width: 375px;
	background: #ffffff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba( 0, 0, 0, 0.32 );
	font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	transform: translateY( 12px ) scale( 0.98 );
	opacity: 0;
	animation: aebab-wa-pop 0.28s cubic-bezier( 0.22, 1, 0.36, 1 ) forwards;
}

/* ---- Cabecera ---- */
.aebab-wa-chat__head {
	display: flex;
	align-items: center;
	padding: 8px 16px;
	background: #ffffff;
}

.aebab-wa-chat__back {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 39px !important;
	height: 39px !important;
	min-width: 0 !important;
	padding: 0 !important;
	border: 1px solid #d8dadc !important;
	border-radius: 10px !important;
	background: #6551e6 !important;
	color: #f8f7ff !important;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.aebab-wa-chat__back:hover {
	filter: brightness( 1.08 );
}

/* Iconos como fondo CSS (el tema no puede ocultarlos) */
.aebab-ico {
	position: relative;
	font-size: 0 !important;
}

.aebab-ico::before {
	content: "" !important;
	position: absolute;
	inset: 0;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 18px 18px;
	pointer-events: none;
}

.aebab-ico--back::before {
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8f7ff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='19' y1='12' x2='5' y2='12'/%3E%3Cpolyline points='12 19 5 12 12 5'/%3E%3C/svg%3E" );
}

.aebab-ico--wa::before {
	background-size: 20px 20px;
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f8f7ff'%3E%3Cpath d='M3.4 20.4l17.45-7.48a1 1 0 0 0 0-1.84L3.4 3.6a.993.993 0 0 0-1.39.91L2 9.12c0 .5.37.93.87.99L17 12 2.87 13.88c-.5.07-.87.5-.87 1l.01 4.61c0 .71.73 1.2 1.39.91z'/%3E%3C/svg%3E" );
}

/* ---- Cuerpo del chat ---- */
.aebab-wa-chat__body {
	min-height: 150px;
	padding: 18px 16px;
	background-color: #e6ddd3;
	background-image: url( "../img/wa-bg.png" );
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.aebab-wa-bubble {
	position: relative;
	display: inline-block;
	max-width: 82%;
	background: #fafafa;
	border-radius: 4px 12px 12px 12px;
	padding: 8px 10px 6px;
	box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.14 );
}

.aebab-wa-bubble::before {
	content: "";
	position: absolute;
	top: 0;
	left: -7px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 0 8px 8px 0;
	border-color: transparent #fafafa transparent transparent;
}

.aebab-wa-bubble__text {
	display: block;
	font-size: 15px;
	font-weight: 400 !important;
	line-height: 20px;
	color: #111111;
	white-space: pre-wrap;
	word-break: break-word;
	overflow-wrap: anywhere;
}

.aebab-wa-bubble__time {
	display: block;
	margin-top: 2px;
	text-align: right;
	font-size: 11px;
	line-height: 13px;
	color: #667781;
}

/* ---- Barra de entrada ---- */
.aebab-wa-chat__input {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	padding: 12px 16px 16px;
	background: #f6f6f6;
}

.aebab-wa-field {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 40px;
	max-height: 140px;
	height: 40px;
	padding: 9px 16px;
	background: #ffffff !important;
	border: 0.5px solid #8e8e93 !important;
	border-radius: 16px !important;
	font-family: inherit;
	font-size: 15px !important;
	line-height: 20px !important;
	color: #000000 !important;
	box-shadow: none !important;
	outline: none;
	resize: none;
	overflow-y: auto;
	white-space: pre-wrap;
	word-break: break-word;
	box-sizing: border-box;
}

.aebab-wa-field::placeholder {
	color: #8e8e93;
}

.aebab-wa-send {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 40px !important;
	height: 40px !important;
	min-width: 0 !important;
	padding: 0 !important;
	border: 1px solid #d8dadc !important;
	border-radius: 10px !important;
	background: #6551e6 !important;
	color: #f8f7ff !important;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.1s ease;
}

.aebab-wa-send:hover {
	filter: brightness( 1.08 );
}

.aebab-wa-send:active {
	transform: translateY( 1px );
}

body.aebab-wa-open {
	overflow: hidden;
}

@keyframes aebab-wa-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes aebab-wa-pop {
	to {
		opacity: 1;
		transform: translateY( 0 ) scale( 1 );
	}
}

/* =========================================================
   Popup de DETALLES — galería masonry + descripción
   ========================================================= */

.aebab-details-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
}

.aebab-details-modal.is-open {
	display: flex;
}

.aebab-details__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 8, 10, 14, 0.6 );
	backdrop-filter: blur( 2px );
	animation: aebab-wa-fade 0.2s ease;
}

.aebab-details__panel {
	position: relative;
	width: 100%;
	max-width: 640px;
	max-height: 90vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #ffffff;
	border-radius: 20px;
	padding: 32px;
	box-shadow: 0 10px 40px rgba( 15, 17, 20, 0.16 );
	font-family: "Source Sans 3", "Source Sans Pro", -apple-system, sans-serif;
	transform: translateY( 12px ) scale( 0.98 );
	opacity: 0;
	animation: aebab-wa-pop 0.28s cubic-bezier( 0.22, 1, 0.36, 1 ) forwards;
}

.aebab-details__close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 32px !important;
	height: 32px !important;
	min-width: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	cursor: pointer;
	opacity: 0.55;
	transition: opacity 0.15s ease, background 0.15s ease;
	z-index: 2;
}

.aebab-details__close:hover {
	opacity: 1;
	background: #f2f4f7 !important;
}

.aebab-ico--close::before {
	background-size: 16px 16px;
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f1114' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='5' y1='5' x2='19' y2='19'/%3E%3Cline x1='19' y1='5' x2='5' y2='19'/%3E%3C/svg%3E" );
}

.aebab-details__title {
	margin: 0 44px 20px 0 !important;
	font-size: 20px !important;
	font-weight: 600 !important;
	line-height: 26px !important;
	letter-spacing: -0.01em !important;
	color: #0f1114 !important;
}

/* Cap de tamaño: ningún encabezado de la descripción pasa de 20px */
.aebab-details__desc h1,
.aebab-details__desc h2,
.aebab-details__desc h3,
.aebab-details__desc h4,
.aebab-details__desc h5,
.aebab-details__desc h6 {
	font-size: 16px !important;
	line-height: 1.35 !important;
	font-weight: 700 !important;
	margin: 18px 0 8px !important;
	color: #0f1114 !important;
	font-family: "Source Sans 3", "Source Sans Pro", -apple-system, sans-serif !important;
	letter-spacing: normal !important;
	word-spacing: normal !important;
}

/* El primer encabezado no arrastra margen superior. */
.aebab-details__desc > :first-child {
	margin-top: 0 !important;
}

/* ---- Galería masonry (CSS columns) ---- */
.aebab-details__gallery {
	column-count: 2;
	column-gap: 10px;
	margin-bottom: 24px;
}

.aebab-details__item {
	break-inside: avoid;
	margin: 0 0 10px;
	padding: 0;
	border-radius: 12px;
	overflow: hidden;
	background: #f4f6fa;
}

.aebab-details__item img {
	display: block;
	width: 100%;
	height: auto;
}

/* ---- Descripción: minimalista, limpia y aireada ---- */
.aebab-details__desc {
	display: block !important;
	margin: 0 0 24px !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	font-family: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont,
		"Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
	font-size: 15px !important;
	line-height: 1.7 !important;
	letter-spacing: normal !important;
	color: #4a5568 !important;
	-webkit-font-smoothing: antialiased !important;
}

/* Párrafos: ritmo tranquilo, sin adornos. */
.aebab-details__desc p {
	margin: 0 0 14px !important;
	font-size: 15px !important;
	line-height: 1.7 !important;
	color: #4a5568 !important;
}

.aebab-details__desc > p:last-child {
	margin-bottom: 0 !important;
}

/* Negritas: solo un tono más oscuro, sin gritar. */
.aebab-details__desc strong,
.aebab-details__desc b {
	font-weight: 600 !important;
	color: #0f1114 !important;
}

/* Listas: marcador mínimo (guion sutil), sin viñeta nativa. */
.aebab-details__desc ul {
	margin: 14px 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.aebab-details__desc li {
	position: relative !important;
	margin: 0 0 8px !important;
	padding-left: 20px !important;
	font-size: 15px !important;
	line-height: 1.6 !important;
	color: #4a5568 !important;
}

.aebab-details__desc li:last-child {
	margin-bottom: 0 !important;
}

.aebab-details__desc li::before {
	content: "" !important;
	position: absolute !important;
	left: 2px !important;
	top: 0.75em !important;
	width: 6px !important;
	height: 1px !important;
	background: #b8c0cf !important;
}

/* Enlaces: azul discreto, subrayado solo en hover. */
.aebab-details__desc a {
	color: #0070f9 !important;
	font-weight: 500 !important;
	text-decoration: none !important;
	border-bottom: 1px solid transparent !important;
	transition: border-color 0.18s ease !important;
}

.aebab-details__desc a:hover {
	border-bottom-color: currentColor !important;
}

/* ---- Acciones ---- */
.aebab-details__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	position: sticky;
	bottom: 0;
	background: #ffffff;
	margin-top: 4px;
	padding-top: 20px;
	border-top: 1px solid #eef0f4;   /* divisor fino minimalista */
}

.aebab-details__btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	min-height: 46px !important;
	padding: 10px 18px !important;
	border: 1px solid transparent !important;
	border-radius: 10px !important;
	font-family: "Source Sans 3", "Inter", -apple-system, sans-serif;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Primario: sólido verde WhatsApp (la acción principal). */
.aebab-details__btn--wa {
	background: #25d366 !important;
	border-color: #25d366 !important;
	color: #ffffff !important;
}

.aebab-details__btn--wa:hover {
	background: #1fbe5b !important;
	border-color: #1fbe5b !important;
}

/* Secundario: ghost con borde fino. */
.aebab-details__btn--go {
	background: transparent !important;
	border-color: #d7dce5 !important;
	color: #0f1114 !important;
}

.aebab-details__btn--go:hover {
	background: #f6f8fb !important;
	border-color: #c3cbd8 !important;
}

@media ( max-width: 600px ) {
	.aebab-details__panel {
		padding: 24px 20px;
		border-radius: 18px;
	}
	.aebab-details__actions {
		flex-direction: column;
	}
}
