/*
 * EMDH · refinamientos de diseño (nov 2026)
 * Capa final: escala tipográfica y espaciado coherentes en todo el sitio,
 * más ajustes puntuales de ficha de cuento, catálogo, carrito, checkout y páginas legales.
 */
:root {
	--emdh-t-h1: clamp(1.85rem, 2.7vw, 2.4rem);
	--emdh-t-h2: clamp(1.45rem, 2.05vw, 1.85rem);
	--emdh-t-h3: clamp(1.05rem, 1.35vw, 1.22rem);
	--emdh-gap-section: clamp(2.5rem, 4.6vw, 4.25rem);
}

/* ---------- 1. Escala de títulos ---------- */
.emdh-shop-hero h1,
.emdh-product-copy h1,
.emdh-blog-shell h1,
.emdh-single-title,
.emdh-pdf-home .emdh-about-hero h1,
.emdh-pdf-home .emdh-read h1,
body.woocommerce-cart h1.entry-title,
body.woocommerce-checkout h1.entry-title,
body.woocommerce-account h1.entry-title,
.page-header .entry-title {
	font-size: var(--emdh-t-h1) !important;
	line-height: 1.12 !important;
	letter-spacing: -.035em !important;
	max-width: 22ch;
}
.emdh-product-grid--training .emdh-product-copy h1 { max-width: 28ch; }
.emdh-shop-hero h1 { max-width: 16ch; }

.emdh-stories-heading h2,
.emdh-programs-heading h2,
.emdh-training-overview h2,
.emdh-training-detail > h2,
.emdh-training-includes h2,
.emdh-article-content h2,
.emdh-related > h2,
.emdh-section-heading h2,
.emdh-pdf-home h2,
.emdh-closing h2,
.emdh-product-details h2 {
	font-size: var(--emdh-t-h2) !important;
	line-height: 1.16 !important;
	letter-spacing: -.03em !important;
}
.emdh-article-content h3,
.emdh-training-module h3,
.emdh-training-overview__grid h3,
.emdh-plan h3,
.emdh-pdf-home h3,
.emdh-buy-box h3,
.emdh-related-card h3,
.emdh-blog-shell .emdh-card-copy h2 {
	font-size: var(--emdh-t-h3) !important;
	line-height: 1.25 !important;
	letter-spacing: -.02em !important;
}
.emdh-article-content h2 { margin-top: 2.2rem; }
.emdh-article-content p { font-size: 1.02rem; line-height: 1.7; }
/* Título grande suelto en bloques Elementor de la home (Valores) */
.elementor-element-b5f405a .elementor-heading-title { font-size: var(--emdh-t-h2) !important; line-height: 1.16 !important; }

/* ---------- 2. Espaciado entre bloques ---------- */
.emdh-home-section { padding-block: clamp(2.75rem, 5.2vw, 4.75rem) !important; }
.emdh-closing { padding-block: clamp(2.75rem, 5vw, 4.5rem) !important; }
.emdh-pdf-home .emdh-home-hero { padding-bottom: clamp(5rem, 9vw, 8rem) !important; }
.emdh-shop-hero { padding-top: clamp(2.25rem, 4.5vw, 3.75rem) !important; padding-bottom: clamp(2rem, 4vw, 3.25rem) !important; }
.emdh-stories-section { padding-bottom: var(--emdh-gap-section) !important; }
.emdh-stories-heading { margin-bottom: 1.6rem !important; }
.emdh-training-overview { padding-top: 0 !important; padding-bottom: var(--emdh-gap-section) !important; }
.emdh-programs { padding-bottom: var(--emdh-gap-section) !important; }
.emdh-shop-notice { padding-bottom: 2.5rem !important; }
.emdh-product-inner { padding-top: clamp(1.4rem, 3vw, 2.25rem) !important; padding-bottom: clamp(2.25rem, 4.5vw, 3.75rem) !important; }
.emdh-product-details { padding-top: clamp(2.25rem, 4.5vw, 3.75rem) !important; padding-bottom: clamp(2.5rem, 5vw, 4rem) !important; }
.emdh-product-details-grid { gap: clamp(1.75rem, 4.5vw, 4rem) !important; }
.emdh-product-resources { margin-top: clamp(1.5rem, 3vw, 2.5rem) !important; }
.emdh-blog-shell .emdh-blog-intro { padding-block: clamp(2rem, 4vw, 3.25rem) !important; }
.emdh-single-hero { padding-block: clamp(1.75rem, 3.5vw, 3rem) !important; }
.emdh-related { margin-top: clamp(2rem, 4vw, 3.25rem) !important; }
body.woocommerce-cart h1.entry-title, body.woocommerce-checkout h1.entry-title { margin-block: clamp(1.1rem, 2.2vw, 1.75rem) 1rem !important; }
.page-header { padding-block: clamp(1.5rem, 3vw, 2.25rem) .5rem; }
.page-content { padding-bottom: clamp(2rem, 4vw, 3.25rem); }

/* ---------- 3. Ficha de cuento ---------- */
/* Datos del cuento: mismo ancho, ritmo y justificación que el texto corrido */
.emdh-story-specs { margin: 1.4rem 0 0 !important; padding: 0 !important; list-style: none; display: grid; gap: .85rem; }
.emdh-story-specs li { margin: 0; padding: 0; font-size: 1rem; line-height: 1.7; color: #423a4e; text-align: left; }
.emdh-story-specs li strong { color: var(--emdh-ink, #170d25); }
.emdh-product-description p, .emdh-product-lead p { text-align: left; }
/* El producto no muestra el "01" sobre las ilustraciones */
.emdh-product-illustration .emdh-story-chip { display: none !important; }
/* "Este cuento incluye": lista limpia en vez de pasos */
.emdh-what-includes li { font-weight: 600; }
/* Botones de compra con la misma forma que el resto del sitio */
.emdh-buy-box .button,
.emdh-buy-box a.button,
.emdh-buy-box button.button {
	display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 52px;
	padding: .85rem 1.4rem !important; border: 0 !important; border-radius: 999px !important;
	background: #ee9d1c !important; color: #fff !important; font-family: Montserrat, Arial, sans-serif;
	font-size: 1rem; font-weight: 800; line-height: 1.2; text-align: center; text-decoration: none;
	box-shadow: 0 14px 28px -16px rgba(238, 157, 28, .9); transition: transform .18s ease, background .18s ease;
}
.emdh-buy-box .button:hover, .emdh-buy-box .button:focus-visible { background: #d8890e !important; transform: translateY(-2px); }
.emdh-purchase-choice .button { margin-top: .85rem; }
.emdh-purchase-choice--recommended .button.alt { background: #ee9d1c !important; }
/* Botón "Quiero el cuento gratis": no queda en estado de foco al cerrar la ventana */
.emdh-free-story-trigger:focus, .emdh-free-story-trigger:active { background: #ee9d1c !important; color: #fff !important; }
.emdh-free-story-trigger:focus:not(:focus-visible) { outline: 0 !important; box-shadow: none !important; }
.emdh-free-story-trigger { background: #ee9d1c; color: #fff; }

/* Página de plan: la columna de compra acompaña mientras se baja */
.emdh-product-grid--training + * { margin: 0; }
.emdh-product-details-grid { align-items: start; }
.emdh-product-aside { position: sticky; top: 7.5rem; align-self: start; }
@media (max-width: 900px) { .emdh-product-aside { position: static; } }
.emdh-training-module__note { margin: 0 0 1rem !important; padding: .7rem .95rem; border-radius: .75rem; background: rgba(112, 79, 230, .09); color: #170d25; font-size: .92rem; font-weight: 600; line-height: 1.5; }
.emdh-training-detail { gap: 1rem; }
.emdh-training-module { padding: clamp(1.1rem, 2.4vw, 1.6rem); }

/* ---------- 4. Catálogo ---------- */
.emdh-stories-heading { align-items: center; }
.emdh-stories-includes {
	max-width: 26rem !important; margin: 0 !important; padding: .95rem 1.2rem; border-radius: 1.1rem;
	background: #704fe6; color: #fff !important; font-size: .98rem; font-weight: 600; line-height: 1.5 !important;
	box-shadow: 0 16px 30px -22px rgba(112, 79, 230, .9);
}
.emdh-stories-includes strong { display: block; margin-bottom: .1rem; color: #ffbd3b; font-size: .74rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.emdh-plan-total { margin: .3rem 0 .6rem !important; color: #704fe6 !important; font-size: .92rem !important; font-weight: 800 !important; }
.emdh-plan-detail-link { display: inline-block; margin: .85rem 0 0 1rem; color: #704fe6; font-size: .92rem; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.emdh-plan-detail-link:hover { color: #ed4c99; }
.emdh-training-overview__more { margin: .9rem 0 0; }
.emdh-training-overview__more .emdh-plan-detail-link { margin: 0; font-size: 1rem; }
.emdh-training-overview__grid h3 { margin-top: .25rem; }
@media (max-width: 620px) { .emdh-stories-includes { max-width: none !important; margin-top: 1rem !important; } }

/* ---------- 5. Carrito, carrito lateral y checkout ---------- */
/* Carrito de bloques */
.wp-block-woocommerce-cart { padding-inline: 0; }
.wc-block-cart .wc-block-cart__main { padding-right: clamp(.5rem, 2vw, 1.5rem); }
.wc-block-cart .wc-block-cart-items { border-radius: 24px; background: #fff; }
.wc-block-cart .wc-block-cart-items th:first-child, .wc-block-cart .wc-block-cart-items td:first-child { padding-left: clamp(16px, 2.2vw, 28px) !important; }
.wc-block-cart .wc-block-cart-items th:last-child, .wc-block-cart .wc-block-cart-items td:last-child { padding-right: clamp(16px, 2.2vw, 28px) !important; }
.wc-block-cart .wc-block-cart-item__image { padding-right: 16px !important; }
.wc-block-cart .wc-block-cart__sidebar { padding-inline: clamp(1rem, 2vw, 1.5rem); }
.wc-block-cart .wc-block-components-totals-coupon__form, .wc-block-cart .wc-block-components-totals-coupon { display: block; }
.wc-block-cart .wc-block-components-totals-coupon__form { display: flex; flex-direction: column; gap: .6rem; align-items: stretch; }
.wc-block-cart .wc-block-components-totals-coupon__input { flex: 1 1 auto; width: 100%; min-width: 0; }
.wc-block-cart .wc-block-components-totals-coupon__input input { height: 52px; padding: 1.35rem 1rem .5rem; font-size: .95rem; text-overflow: ellipsis; }
.wc-block-cart .wc-block-components-totals-coupon__input label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 1.5rem); }
.wc-block-cart .wc-block-components-totals-coupon__button { flex: 0 0 auto; width: 100%; min-height: 48px; padding-inline: 1.4rem; }
.wc-block-cart .wc-block-components-sidebar-layout { gap: 0; }

/* Carrito lateral (Elementor) */
.elementor-menu-cart__main { width: min(400px, 92vw) !important; padding: 1.25rem 1.25rem 1.5rem !important; overflow-x: hidden; box-sizing: border-box; }
.elementor-menu-cart__product { display: grid !important; grid-template-columns: 64px minmax(0, 1fr) auto; gap: .35rem .85rem; align-items: start; padding: .9rem 0; }
.elementor-menu-cart__product-image { width: 64px !important; padding: 0 !important; }
.elementor-menu-cart__product-image img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.elementor-menu-cart__product-name, .elementor-menu-cart__product-name a { min-width: 0; overflow-wrap: anywhere; font-size: .98rem !important; line-height: 1.3 !important; }
.elementor-menu-cart__product-price { grid-column: 2; font-size: .9rem !important; opacity: 1 !important; color: #635b70 !important; }
.elementor-menu-cart__product-remove { position: relative !important; top: auto !important; right: auto !important; grid-column: 3; grid-row: 1; width: 28px; height: 28px; margin: 0; }
.elementor-menu-cart__products { height: auto !important; max-height: calc(100vh - 290px) !important; overflow-y: auto; padding-right: 2px; }
.elementor-menu-cart__subtotal { padding: .9rem 0 !important; font-size: 1.05rem !important; }
.elementor-menu-cart__footer-buttons { display: grid !important; grid-template-columns: 1fr; gap: .6rem; }
.elementor-menu-cart__footer-buttons .elementor-button { width: 100%; padding: .8rem 1rem; border-radius: 999px; text-align: center; }
.elementor-menu-cart__close-button { top: .6rem !important; right: .8rem !important; }

/* Checkout: quitar un producto desde el resumen */
.emdh-checkout-remove {
	display: block; width: fit-content; margin: .35rem 0 0; padding: .2rem .7rem; border-radius: 999px; background: #f1ebff;
	color: #704fe6 !important; font-size: .78rem; font-weight: 800; line-height: 1.4; text-decoration: none !important;
	transition: background .15s ease, color .15s ease;
}
.emdh-checkout-remove:hover, .emdh-checkout-remove:focus-visible { background: #ed4c99; color: #fff !important; }

/* ---------- 6. Páginas legales ---------- */
body:has(.emdh-legal-page) { background: #fcfaff; }
body:has(.emdh-legal-page) .page-header { max-width: 860px; margin: 0 auto; padding: clamp(1.75rem, 4vw, 3rem) 1.25rem 0; }
body:has(.emdh-legal-page) .page-header .entry-title { max-width: none; margin: 0; color: #170d25; font-size: var(--emdh-t-h1) !important; }
body:has(.emdh-legal-page) .page-content { max-width: 860px; margin: 0 auto; padding: 1rem 1.25rem clamp(2.5rem, 5vw, 4rem); }
.emdh-legal-page {
	padding: clamp(1.4rem, 4vw, 2.75rem); border: 1px solid rgba(112, 79, 230, .14); border-radius: 1.5rem;
	background: #fff; box-shadow: 0 24px 50px -38px rgba(42, 19, 74, .55); color: #3b3347; font-size: 1rem; line-height: 1.75;
}
.emdh-legal-page__updated {
	display: inline-block; margin: 0 0 1.1rem !important; padding: .35rem .8rem; border-radius: 999px; background: #f1ebff;
	color: #5b3fc4; font-size: .78rem; font-weight: 800; letter-spacing: .02em;
}
.emdh-legal-page h1 { margin: 0 0 1.1rem; color: #170d25; font-size: var(--emdh-t-h2) !important; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.emdh-legal-page h2 {
	position: relative; margin: 2.1rem 0 .7rem; padding-top: 1.35rem; border-top: 1px solid #efe8ff; color: #170d25;
	font-size: clamp(1.1rem, 1.5vw, 1.3rem) !important; font-weight: 800; line-height: 1.3; letter-spacing: -.015em;
}
.emdh-legal-page h2::before { content: ''; position: absolute; top: -1px; left: 0; width: 3rem; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #ee9d1c, #ed4c99); }
.emdh-legal-page h3 { margin: 1.4rem 0 .4rem; color: #170d25; font-size: 1.02rem !important; font-weight: 800; line-height: 1.35; }
.emdh-legal-page p { margin: 0 0 .9rem; max-width: 70ch; }
.emdh-legal-page ul, .emdh-legal-page ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.emdh-legal-page li { margin-bottom: .35rem; }
.emdh-legal-page a { color: #704fe6; font-weight: 700; text-underline-offset: 3px; }
.emdh-legal-page strong { color: #170d25; }

.emdh-legal-page h1, .emdh-legal-page h2, .emdh-legal-page h3 { letter-spacing: -.01em !important; }

/* ---------- 7. Móvil ---------- */
@media (max-width: 620px) {
	:root { --emdh-t-h1: 1.75rem; --emdh-t-h2: 1.4rem; }
	.emdh-home-section { padding-block: 2.5rem !important; }
	.emdh-legal-page { padding: 1.25rem; border-radius: 1.15rem; }
}

/* Anclas: dejar espacio bajo el encabezado fijo */
#faqs, #cuentos, #capacitaciones, #planes { scroll-margin-top: 7.5rem; }
.elementor-menu-cart__product-remove { color: #704fe6; }

/* ---------- 8. Móvil (≤ 640 px): escala más compacta, botones medianos y ritmo ordenado ---------- */
@media (max-width: 640px) {
	:root { --emdh-t-h1: 1.6rem; --emdh-t-h2: 1.3rem; --emdh-t-h3: 1.05rem; --emdh-gap-section: 2rem; }
	html { -webkit-text-size-adjust: 100%; }

	/* Home */
	.emdh-shell { width: calc(100% - 36px); }
	.emdh-pdf-home .emdh-home-hero h1 { margin-bottom: 14px; font-size: 1.5rem !important; line-height: 1.22 !important; letter-spacing: -.02em !important; }
	.emdh-pdf-home .emdh-home-hero .emdh-lead { margin-bottom: 12px; font-size: 1.02rem; line-height: 1.5; }
	.emdh-pdf-home .emdh-home-hero p { margin: 0 0 12px; font-size: .94rem; line-height: 1.62; }
	.emdh-home-hero .emdh-kicker-home { margin-bottom: 16px !important; padding: 6px 12px; font-size: .64rem !important; letter-spacing: .05em; }
	.emdh-home-actions { display: grid; gap: 10px; margin-top: 22px; }
	.emdh-home-actions .emdh-home-button, .emdh-home-button { width: 100%; min-height: 48px; padding: 11px 18px; font-size: .95rem; }
	.emdh-home-hero .emdh-home-note { margin-top: 12px; font-size: .82rem; }
	.emdh-pdf-home h2 { margin-bottom: 12px !important; line-height: 1.2 !important; }
	.emdh-pdf-home h3 { line-height: 1.25 !important; }
	.emdh-pdf-home p { font-size: .95rem; line-height: 1.6; }
	.emdh-section-head { margin-bottom: 18px; }
	.emdh-home-section { padding-block: 2.25rem !important; }
	.emdh-faq-labels { gap: 8px; margin-bottom: 18px; }
	.emdh-faq-labels label { padding: 11px 16px; font-size: .9rem; }
	.emdh-faq-panel summary { min-height: 52px; padding: 13px 52px 13px 18px; font-size: .95rem; }

	/* Catálogo y ficha */
	.emdh-shop-hero { padding-top: 1.5rem !important; padding-bottom: 1.25rem !important; }
	.emdh-shop-hero > .emdh-shop-hero-media { width: min(60%, 14rem); margin-top: 1.25rem; }
	.emdh-shop-hero > p:not(.emdh-shop-kicker) { font-size: .98rem; line-height: 1.55; }
	.emdh-stories-section ul.products { gap: 1rem; }
	.emdh-product-inner { padding-inline: 1.1rem !important; }
	.emdh-product-details { padding-inline: 1.1rem !important; }
	.emdh-product-price strong, .emdh-single-price strong { font-size: 1.6rem; }
	.emdh-product-lead p { font-size: .98rem; line-height: 1.6; }
	.emdh-buy-box { padding: 1.15rem !important; }
	.emdh-buy-box .button, .emdh-buy-box a.button, .emdh-buy-box button.button { min-height: 46px; padding: .7rem 1.1rem !important; font-size: .95rem; }
	.emdh-buy-box h3 { font-size: 1.05rem !important; }
	.emdh-product-resources .emdh-what-includes, .emdh-product-resources .emdh-benefits { padding: 1.25rem; }
	.emdh-outline-button { min-height: 46px; font-size: .95rem; }
	.emdh-plan { padding: 1.25rem; }
	.emdh-plan-detail-link { display: block; margin: .9rem 0 0; }
	.emdh-training-module { padding: 1.1rem; }

	/* Carrito, checkout y legales */
	body.woocommerce-cart h1.entry-title, body.woocommerce-checkout h1.entry-title { margin-block: 1rem .75rem !important; }
	.wc-block-cart .wc-block-cart__main { padding-right: 0; }
	.wc-block-components-button:not(.is-link), .wc-block-cart .wc-block-cart__submit-button { min-height: 48px; font-size: .95rem; }
	.emdh-legal-page h2 { margin-top: 1.6rem; padding-top: 1.1rem; }

	/* Blog */
	.emdh-blog-shell .emdh-blog-intro { padding-block: 1.5rem !important; }
	.emdh-single-title { max-width: none; }
	.emdh-article-content p { font-size: 1rem; }

	/* Pie */
	.elementor-location-footer h2, .elementor-location-footer h3 { font-size: 1.05rem !important; }
}
@media (max-width: 640px) { .emdh-shop-hero > .emdh-shop-hero-media { margin-bottom: 1.5rem; } .emdh-stories-section { padding-top: .5rem; } }
