/* ==========================================================================
   Metálicas J3M – estilos del tema
   Colores y tipografías vienen de theme.json (variables --wp--preset--*).
   ========================================================================== */

:root {
	--j3m-radius: 14px;
	--j3m-shadow: 0 18px 40px -18px rgba(11, 18, 32, .35);
	--j3m-shadow-lg: 0 30px 60px -25px rgba(11, 18, 32, .5);
	--j3m-ease: cubic-bezier(.2, .7, .2, 1);
	--j3m-accent: var(--wp--preset--color--accent);
	--j3m-primary: var(--wp--preset--color--primary);
	--j3m-dark: var(--wp--preset--color--dark);
}

html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { height: auto; max-width: 100%; }
:focus-visible { outline: 3px solid var(--j3m-accent); outline-offset: 3px; }

/* ---------- Utilidades ---------- */
.j3m-section { padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--60); }
.j3m-main { margin-block-start: 0 !important; }
.j3m-main > .wp-block-post-content > *:first-child { margin-block-start: 0; }
.wp-block-post-content > .alignfull { margin-block-start: 0; }

.j3m-kicker {
	display: inline-flex; align-items: center; gap: .6rem;
	font-size: .8rem !important; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
	color: var(--j3m-accent);
	margin-bottom: .25rem !important;
}
.j3m-kicker::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: currentColor; }
.has-text-align-center.j3m-kicker { display: flex; justify-content: center; }
.j3m-intro { max-width: 640px; margin-inline: auto !important; color: var(--wp--preset--color--muted); }

/* ---------- Botones ---------- */
.wp-element-button, .wp-block-button__link {
	transition: transform .25s var(--j3m-ease), box-shadow .25s var(--j3m-ease), background-color .25s;
	box-shadow: 0 10px 24px -10px rgba(255, 122, 26, .65);
}
.wp-element-button:hover, .wp-block-button__link:hover { transform: translateY(-2px); }
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent; color: currentColor; border: 2px solid currentColor; box-shadow: none;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: rgba(255, 255, 255, .1); color: currentColor; }

/* ---------- Barra superior y cabecera ---------- */
.j3m-topbar { background: var(--j3m-dark); color: #c9d3e3; font-size: .82rem; padding-block: .45rem; }
.j3m-topbar p { margin: 0; }
.j3m-topbar a { color: #fff; text-decoration: none; }
.j3m-topbar a:hover { color: var(--j3m-accent); }

.j3m-site-header { position: sticky; top: 0; z-index: 50; }
.admin-bar .j3m-site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .j3m-site-header { top: 46px; } .j3m-topbar { display: none; } }
.j3m-header {
	background: rgba(255, 255, 255, .92);
	backdrop-filter: saturate(160%) blur(12px);
	-webkit-backdrop-filter: saturate(160%) blur(12px);
	padding-block: .8rem;
	border-bottom: 1px solid rgba(11, 18, 32, .06);
	transition: padding .3s var(--j3m-ease), box-shadow .3s;
}
.is-scrolled .j3m-header { padding-block: .4rem; box-shadow: 0 10px 30px -20px rgba(11, 18, 32, .45); }
.j3m-header .wp-block-site-logo img { transition: width .3s var(--j3m-ease); }
.is-scrolled .j3m-header .wp-block-site-logo img { width: 135px !important; }
.j3m-header .wp-block-navigation-item__content { position: relative; padding-block: .35rem; color: var(--j3m-dark); }
.j3m-header .wp-block-navigation-item__content::after {
	content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
	background: var(--j3m-accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--j3m-ease);
}
.j3m-header .wp-block-navigation-item__content:hover::after,
.j3m-header .current-menu-item > .wp-block-navigation-item__content::after { transform: scaleX(1); }
.j3m-header__cta .wp-block-button__link { padding: .6rem 1.3rem; font-size: .9rem; }
@media (max-width: 600px) { .j3m-header__cta { display: none; } }

/* ---------- Hero ---------- */
.j3m-hero, .j3m-page-hero { color: #fff; overflow: hidden; }
.j3m-hero .wp-block-cover__inner-container { max-width: var(--wp--style--global--wide-size); }
.j3m-hero h1 { font-size: clamp(2.6rem, 6.5vw, 5.2rem); line-height: 1; margin-block: .5rem 1rem; }
.j3m-hl {
	background: linear-gradient(90deg, #FF7A1A, #FFC46B);
	-webkit-background-clip: text; background-clip: text; color: transparent;
}
.j3m-lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); max-width: 640px; color: #dbe4f3; }
.j3m-ctas { margin-top: 1.75rem; gap: .9rem; }
.j3m-hero .wp-block-cover__image-background, .j3m-page-hero .wp-block-cover__image-background {
	animation: j3m-kenburns 22s ease-in-out infinite alternate;
}
@keyframes j3m-kenburns { from { transform: scale(1); } to { transform: scale(1.12) translate(-1.5%, -1%); } }

.j3m-hero__checks { list-style: none; padding: 0; margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; font-size: .95rem; color: #dbe4f3; }
.j3m-hero__checks li, .j3m-checklist li { position: relative; padding-left: 1.7rem; }
.j3m-hero__checks li::before, .j3m-checklist li::before {
	content: ""; position: absolute; left: 0; top: .3em; width: 1.1rem; height: 1.1rem; border-radius: 50%;
	background: var(--j3m-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 70% no-repeat;
}
.j3m-checklist { list-style: none; padding: 0; display: grid; gap: .55rem; }

/* Chispas animadas en la portada (decorativas, sin imágenes). */
.j3m-hero::after {
	content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: .7;
	background-image:
		radial-gradient(2px 2px at 20% 80%, #ffb347, transparent),
		radial-gradient(2px 2px at 35% 60%, #ff7a1a, transparent),
		radial-gradient(1.5px 1.5px at 55% 90%, #ffd08a, transparent),
		radial-gradient(2px 2px at 75% 70%, #ff7a1a, transparent),
		radial-gradient(1.5px 1.5px at 88% 85%, #ffb347, transparent);
	animation: j3m-sparks 6s linear infinite;
}
@keyframes j3m-sparks { from { transform: translateY(0); opacity: .8; } to { transform: translateY(-40vh); opacity: 0; } }

.j3m-page-hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
/* Alinea a la izquierda todos los elementos del encabezado de páginas internas. */
.j3m-page-hero .wp-block-cover__inner-container { max-width: 960px; width: 100%; margin-inline: auto; }
.j3m-page-hero .wp-block-cover__inner-container > * { max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
.j3m-page-hero .wp-block-cover__inner-container > .j3m-lead { max-width: 680px !important; }

/* ---------- Ventajas (superpuestas al hero) ---------- */
.j3m-features { position: relative; z-index: 3; margin-top: -90px !important; gap: 1.25rem; }
.j3m-feature {
	background: #fff; border-radius: var(--j3m-radius); padding: 1.75rem 1.5rem;
	box-shadow: var(--j3m-shadow-lg); border-top: 4px solid var(--j3m-primary);
	transition: transform .35s var(--j3m-ease), border-color .35s;
}
.j3m-feature:hover { transform: translateY(-6px); border-color: var(--j3m-accent); }
.j3m-feature h3 { margin-top: .25rem; }
.j3m-feature p { margin-bottom: 0; color: var(--wp--preset--color--muted); font-size: .97rem; }
.j3m-feature__num {
	font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 2.6rem !important; line-height: 1;
	color: transparent; -webkit-text-stroke: 1.5px var(--j3m-accent); margin: 0;
}
@media (max-width: 781px) { .j3m-features { margin-top: 1.5rem !important; } }

/* ---------- Quiénes somos ---------- */
.j3m-about { gap: clamp(2rem, 5vw, 4.5rem); }
.j3m-about__img { position: relative; }
.j3m-about__img img { border-radius: var(--j3m-radius); box-shadow: var(--j3m-shadow-lg); aspect-ratio: 4 / 3.4; object-fit: cover; width: 100%; }
.j3m-about__img::before {
	content: ""; position: absolute; inset: -14px 14px 14px -14px; border: 3px solid var(--j3m-accent); border-radius: var(--j3m-radius); z-index: -1;
}

/* ---------- Tarjetas de servicio ---------- */
.j3m-cards { gap: 1.5rem; margin-top: 2.5rem !important; }
.j3m-card {
	background: #fff; border-radius: var(--j3m-radius); overflow: hidden; padding: 0 0 1.5rem;
	box-shadow: var(--j3m-shadow); transition: transform .35s var(--j3m-ease), box-shadow .35s;
	display: flex; flex-direction: column;
}
.j3m-card > *:not(.j3m-card__img):not(.wp-block-post-featured-image) { padding-inline: 1.4rem; }
.j3m-card:hover { transform: translateY(-8px); box-shadow: var(--j3m-shadow-lg); }
.j3m-card__img, .j3m-card .wp-block-post-featured-image { margin: 0 !important; overflow: hidden; border-radius: 0; }
.j3m-card__img img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: 0; transition: transform .6s var(--j3m-ease); }
.j3m-card:hover .j3m-card__img img { transform: scale(1.07); }
.j3m-card p { color: var(--wp--preset--color--muted); font-size: .97rem; }
.j3m-card__link { margin-top: auto !important; }
.j3m-card__link a { font-weight: 700; text-decoration: none; display: inline-flex; gap: .4rem; align-items: center; }
.j3m-card__link a::after { content: "→"; transition: transform .25s var(--j3m-ease); }
.j3m-card__link a:hover::after { transform: translateX(5px); }

/* ---------- Secciones oscuras (proceso / beneficios) ---------- */
.j3m-dark {
	background:
		linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 40px 40px,
		linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 40px 40px,
		linear-gradient(135deg, #0B1220 0%, #1C2636 60%, #133F84 100%);
	color: #c9d3e3;
}
.j3m-steps { gap: 1.25rem; margin-top: 2.5rem !important; counter-reset: j3m-step; }
.j3m-step {
	counter-increment: j3m-step; position: relative;
	background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
	border-radius: var(--j3m-radius); padding: 2rem 1.5rem 1.5rem;
	transition: background .3s, transform .35s var(--j3m-ease), border-color .3s;
}
.j3m-step::before {
	content: counter(j3m-step, decimal-leading-zero);
	font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1rem;
	display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
	background: linear-gradient(135deg, #FF7A1A, #FFB347); color: #fff; margin-bottom: .8rem;
	box-shadow: 0 0 0 6px rgba(255, 122, 26, .15);
}
.j3m-step:hover { background: rgba(255, 255, 255, .09); transform: translateY(-6px); border-color: rgba(255, 122, 26, .5); }
.j3m-step p { margin-bottom: 0; font-size: .97rem; }

/* ---------- Galería + visor ---------- */
.j3m-gallery { gap: 1rem; margin-top: 2.5rem !important; }
.j3m-gallery__item { margin: 0 !important; position: relative; overflow: hidden; border-radius: var(--j3m-radius); cursor: zoom-in; }
.j3m-gallery__item img { aspect-ratio: 1; object-fit: cover; width: 100%; transition: transform .6s var(--j3m-ease), filter .4s; }
.j3m-gallery__item::after {
	content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
	background: linear-gradient(180deg, transparent 50%, rgba(11, 18, 32, .75));
	opacity: 0; transition: opacity .35s;
}
.j3m-gallery__item:hover img { transform: scale(1.08); }
.j3m-gallery__item:hover::after { opacity: 1; }

.j3m-lightbox {
	position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 2rem;
	background: rgba(6, 10, 18, .92); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.j3m-lightbox.is-open { opacity: 1; visibility: visible; }
.j3m-lightbox img { max-height: 82vh; max-width: min(1100px, 92vw); border-radius: 10px; box-shadow: var(--j3m-shadow-lg); }
.j3m-lightbox figcaption { color: #dbe4f3; text-align: center; margin-top: .8rem; font-size: .95rem; }
.j3m-lightbox button {
	position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 50%;
	width: 48px; height: 48px; font-size: 1.5rem; cursor: pointer; transition: background .2s;
}
.j3m-lightbox button:hover { background: var(--j3m-accent); }
.j3m-lightbox__close { top: 1.25rem; right: 1.25rem; }
.j3m-lightbox__prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.j3m-lightbox__next { right: 1.25rem; top: 50%; transform: translateY(-50%); }

/* ---------- Filas de servicios ---------- */
.j3m-row { gap: clamp(2rem, 5vw, 4.5rem); margin-block: 0 var(--wp--preset--spacing--60) !important; scroll-margin-top: 110px; }
.j3m-row:last-child { margin-bottom: 0 !important; }
.j3m-row__img img { aspect-ratio: 16 / 11; object-fit: cover; width: 100%; box-shadow: var(--j3m-shadow-lg); }
@media (min-width: 782px) { .j3m-row--rev { flex-direction: row-reverse; } }

/* ---------- Preguntas frecuentes ---------- */
.j3m-faq { max-width: 820px; margin-inline: auto !important; margin-top: 2rem !important; display: grid; gap: .8rem; }
.j3m-faq .wp-block-details { background: #fff; box-shadow: 0 6px 18px -12px rgba(11, 18, 32, .3); transition: box-shadow .3s; }
.j3m-faq .wp-block-details[open] { box-shadow: var(--j3m-shadow); }
.j3m-faq summary {
	font-weight: 700; color: var(--j3m-dark); cursor: pointer; list-style: none; position: relative; padding-right: 2.2rem;
}
.j3m-faq summary::-webkit-details-marker { display: none; }
.j3m-faq summary::after {
	content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
	width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%;
	background: var(--wp--preset--color--light); color: var(--j3m-accent); font-size: 1.25rem; transition: transform .3s var(--j3m-ease);
}
.j3m-faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.j3m-faq details p { margin: .8rem 0 0; color: var(--wp--preset--color--muted); }

/* ---------- Llamada a la acción ---------- */
.j3m-cta { padding-block: var(--wp--preset--spacing--50); }
.j3m-cta__box {
	position: relative; overflow: hidden; border-radius: calc(var(--j3m-radius) * 1.5);
	padding: clamp(2rem, 5vw, 3.5rem) !important; color: #e8eef8;
	background: linear-gradient(120deg, #133F84 0%, #1F5FBF 55%, #0B1220 100%);
	box-shadow: var(--j3m-shadow-lg); gap: 1.5rem;
}
.j3m-cta__box::before {
	content: ""; position: absolute; width: 380px; height: 380px; right: -120px; top: -160px; border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 122, 26, .55), transparent 65%);
}
.j3m-cta__box > * { position: relative; }
.j3m-cta__box h2 { margin: 0 0 .4rem; }
.j3m-cta__box .j3m-ctas { margin-top: 0; color: #fff; }

/* ---------- Contacto y cotizador ---------- */
.j3m-contact { gap: clamp(2rem, 5vw, 4rem); }
.j3m-contact__list { list-style: none; padding: 0; display: grid; gap: .7rem; }
.j3m-contact__list li { padding: .9rem 1.1rem; background: var(--wp--preset--color--light); border-radius: 10px; border-left: 4px solid var(--j3m-accent); }
.j3m-map { width: 100%; height: 320px; border-radius: var(--j3m-radius); box-shadow: var(--j3m-shadow); margin-top: 1rem; }

.j3m-quote {
	background: #fff; border-radius: calc(var(--j3m-radius) * 1.3); padding: clamp(1.5rem, 4vw, 2.4rem);
	box-shadow: var(--j3m-shadow-lg); border-top: 5px solid var(--j3m-accent); display: grid; gap: 1rem;
}
.j3m-quote h3 { margin: 0; }
.j3m-quote__note { margin: 0; font-size: .92rem; color: var(--wp--preset--color--muted); }
.j3m-quote label { display: grid; gap: .35rem; font-weight: 600; font-size: .92rem; color: var(--j3m-dark); }
.j3m-quote input, .j3m-quote select, .j3m-quote textarea {
	font: inherit; font-weight: 400; padding: .8rem 1rem; border: 1.5px solid #d6deea; border-radius: 10px; background: #fbfcfe;
	transition: border-color .2s, box-shadow .2s;
}
.j3m-quote input:focus, .j3m-quote select:focus, .j3m-quote textarea:focus {
	outline: none; border-color: var(--j3m-primary); box-shadow: 0 0 0 4px rgba(31, 95, 191, .15);
}
.j3m-quote button { border: 0; cursor: pointer; justify-self: start; background: var(--j3m-accent); color: #fff; border-radius: 999px; padding: .95rem 1.9rem; font-weight: 700; }
.j3m-quote__error { color: #c62828; margin: 0; font-size: .9rem; }

/* ---------- Pie de página ---------- */
.j3m-footer { background: var(--j3m-dark); color: #9fb0c8; padding-top: var(--wp--preset--spacing--60); padding-bottom: 1.5rem; font-size: .95rem; }
.j3m-footer a { color: #dbe4f3; text-decoration: none; }
.j3m-footer a:hover { color: var(--j3m-accent); }
.j3m-footer__brand { font-family: var(--wp--preset--font-family--heading); font-size: 1.8rem !important; font-weight: 700; color: #fff; text-transform: uppercase; }
.j3m-footer__links { list-style: none; padding: 0; display: grid; gap: .45rem; }
.j3m-footer__copy { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 1.25rem; margin-top: 2.5rem !important; font-size: .85rem; }

/* ---------- Botón flotante de WhatsApp ---------- */
.j3m-wa {
	position: fixed; right: 18px; bottom: 18px; z-index: 60; display: inline-flex; align-items: center; gap: .55rem;
	background: #25D366; color: #fff !important; text-decoration: none; font-weight: 700; font-size: .95rem;
	padding: .8rem 1.1rem .8rem .9rem; border-radius: 999px; box-shadow: 0 12px 28px -10px rgba(37, 211, 102, .8);
	transition: transform .25s var(--j3m-ease);
}
.j3m-wa::before {
	content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid #25D366;
	animation: j3m-pulse 2.2s ease-out infinite;
}
.j3m-wa:hover { transform: translateY(-3px) scale(1.03); }
@keyframes j3m-pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
@media (max-width: 600px) { .j3m-wa span { display: none; } .j3m-wa { padding: .85rem; } }

/* ---------- Animaciones al hacer scroll (solo con JS) ---------- */
.js .j3m-reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--j3m-ease), transform .8s var(--j3m-ease); }
.js .j3m-reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
	.js .j3m-reveal { opacity: 1; transform: none; }
}

/* En el editor todo debe verse siempre. */
.editor-styles-wrapper .j3m-reveal { opacity: 1 !important; transform: none !important; }
