/*
 * Disaplint — estilos que theme.json no puede expresar:
 * cabecera fija, animaciones, listas con check, tarjetas, calculadora y botones flotantes.
 * Todos los colores, espacios y radios salen de los tokens del design system (theme.json).
 */

/* ---------------------------------------------------------- cabecera */

.dsp-header {
	position: sticky;
	top: 0;
	z-index: 60;
	background: rgba(255, 255, 255, 0.86);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid transparent;
	transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.dsp-header::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(
		90deg,
		var(--wp--preset--color--brand-dark),
		var(--wp--preset--color--action),
		var(--wp--preset--color--brand-light),
		var(--wp--preset--color--action),
		var(--wp--preset--color--brand-dark)
	);
	background-size: 200% 100%;
}

.dsp-header.is-scrolled {
	box-shadow: 0 6px 24px rgba(39, 30, 21, 0.1);
	border-color: rgba(39, 30, 21, 0.06);
}

.dsp-header .wp-block-site-logo img,
.dsp-header .dsp-logo img {
	height: 38px;
	width: auto;
}

.dsp-header .dsp-logo {
	margin: 0;
}

.dsp-header .wp-block-navigation a {
	position: relative;
	padding-block: 6px;
}

.dsp-header .wp-block-navigation .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	height: 2px;
	background: var(--wp--preset--color--action);
	transition: width 0.25s ease;
}

.dsp-header .wp-block-navigation .wp-block-navigation-item__content:hover::after,
.dsp-header .wp-block-navigation .current-menu-item .wp-block-navigation-item__content::after {
	width: 100%;
}

.dsp-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--surface);
}

.dsp-header .wp-block-navigation__responsive-container.is-menu-open a::after {
	display: none;
}

@media (prefers-reduced-motion: no-preference) {
	.dsp-header::before {
		animation: dsp-hairline 7s linear infinite;
	}
}

@keyframes dsp-hairline {
	from { background-position: 0% 0; }
	to { background-position: 200% 0; }
}

/* -------------------------------------------------- aparición al scroll */

.dsp-reveal {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 0.7s ease, transform 0.7s ease;
}

.dsp-reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* El editor nunca debe ocultar contenido. */
.editor-styles-wrapper .dsp-reveal {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.dsp-reveal {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}

	*,
	*::before,
	*::after {
		animation: none !important;
	}
}

/* ------------------------------------------------------------- héroe */

.dsp-hero .wp-block-cover__image-background {
	transform: scale(1.06);
}

@media (prefers-reduced-motion: no-preference) {
	.dsp-hero .wp-block-cover__image-background {
		animation: dsp-breathe 16s ease-in-out infinite alternate;
	}
}

@keyframes dsp-breathe {
	from { transform: scale(1.06); }
	to { transform: scale(1); }
}

.dsp-hero__title {
	max-width: 760px;
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.dsp-hero__card {
	max-width: 440px;
}

.dsp-hero {
	min-height: min(88vh, 720px);
}

/* ------------------------------------------------- listas con check */

.wp-block-list.is-style-dsp-check {
	list-style: none;
	padding-left: 0;
}

.wp-block-list.is-style-dsp-check li {
	position: relative;
	padding-left: 30px;
	margin-bottom: 8px;
	line-height: 1.5;
}

.wp-block-list.is-style-dsp-check li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.45em;
	width: 16px;
	height: 10px;
	border-left: 2.4px solid currentColor;
	border-bottom: 2.4px solid currentColor;
	transform: rotate(-45deg);
	opacity: 0.95;
}

/* En el panel negro el check va en verde de acción. */
.dsp-panel--dark .wp-block-list.is-style-dsp-check li::before {
	color: var(--wp--preset--color--action);
}

/* ------------------------------------------------- tarjetas y paneles */

.dsp-panel {
	border-radius: var(--wp--custom--radius--lg);
}

.is-style-dsp-card,
.dsp-card {
	background: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--md);
	box-shadow: var(--wp--preset--shadow--card);
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dsp-card:hover {
	transform: translateY(-8px);
	box-shadow: var(--wp--preset--shadow--lift);
}

.dsp-card figure,
.dsp-card .wp-block-image {
	margin: 0;
	overflow: hidden;
}

.dsp-card .wp-block-image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.dsp-card:hover .wp-block-image img {
	transform: scale(1.08);
}

/* Icono cuadrado de Características. */
.dsp-feature__icon {
	width: 64px;
	height: 64px;
	border-radius: var(--wp--custom--radius--md);
	background: var(--wp--preset--color--accent-brown);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-inline: auto;
	transition: transform 0.35s ease;
}

.dsp-feature:hover .dsp-feature__icon {
	transform: rotate(-6deg) scale(1.08);
}

.dsp-feature__icon svg {
	width: 26px;
	height: 26px;
}

/* Avatar con iniciales. */
.dsp-avatar {
	flex: none;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--wp--preset--color--action);
	color: var(--wp--preset--color--ink);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 15px;
}

.dsp-avatar--lg {
	width: 88px;
	height: 88px;
	font-size: 26px;
	transition: transform 0.3s ease;
}

.wp-block-column:hover .dsp-avatar--lg {
	transform: scale(1.08) rotate(-4deg);
}

/* Mosaicos de "Aplicaciones": la foto hace zoom al pasar el ratón. */
.dsp-app-tile .wp-block-cover__image-background {
	transition: transform 0.5s ease;
}

.dsp-app-tile:hover .wp-block-cover__image-background {
	transform: scale(1.08);
}

/* --------------------------------------------------------- contador */

.dsp-counter {
	font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------- calculadora */

.dsp-calc {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wp--preset--spacing--60);
	align-items: start;
}

.dsp-calc__form {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
}

.dsp-calc__field {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
}

.dsp-calc__field span {
	font-weight: 700;
	font-size: 14px;
}

.dsp-calc__field input,
.dsp-calc__field select {
	font-family: inherit;
	font-size: 15px;
	padding: 12px 14px;
	border-radius: var(--wp--custom--radius--sm);
	border: 1.5px solid var(--wp--preset--color--surface-muted);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	width: 100%;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dsp-calc__field input:focus,
.dsp-calc__field select:focus {
	outline: none;
	border-color: var(--wp--preset--color--action);
	box-shadow: 0 0 0 3px rgba(130, 197, 60, 0.25);
}

.dsp-calc__panel {
	background: var(--wp--preset--color--accent-brown);
	color: #fff;
	border-radius: var(--wp--custom--radius--lg);
	padding: var(--wp--preset--spacing--50);
	box-shadow: var(--wp--preset--shadow--card);
}

.dsp-calc__panel dl {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
}

.dsp-calc__panel dl > div {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--wp--preset--spacing--30);
	padding-bottom: var(--wp--preset--spacing--30);
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.dsp-calc__panel dt {
	font-size: 14px;
	line-height: 1.4;
}

.dsp-calc__panel dd {
	margin: 0;
	font-weight: 700;
	font-size: 17px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.dsp-calc__destaque {
	border-bottom: none !important;
	padding-bottom: 0 !important;
	padding-top: var(--wp--preset--spacing--20);
	align-items: center !important;
}

.dsp-calc__destaque dt {
	font-weight: 700;
	font-size: 15px;
}

.dsp-calc__destaque dd {
	font-size: clamp(32px, 5vw, 42px);
	font-weight: 800;
	line-height: 1;
}

.dsp-calc__aviso {
	margin-top: var(--wp--preset--spacing--40);
	font-size: 13px;
	line-height: 1.55;
}

.dsp-calc__cta {
	display: inline-flex;
	align-items: center;
	margin-top: var(--wp--preset--spacing--40);
	text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
	.dsp-calc__panel dd {
		transition: transform 0.25s ease;
	}

	.dsp-calc__panel dd.is-tick {
		transform: scale(1.06);
	}
}

@media (max-width: 820px) {
	.dsp-calc {
		grid-template-columns: 1fr;
	}
}

/* ------------------------------------ tarjetas de contacto y formulario */

.dsp-info-card {
	text-align: center;
	transition: transform 0.3s ease;
}

.dsp-info-card:hover {
	transform: translateY(-8px);
}

.dsp-info-card__icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--wp--preset--color--action);
	color: var(--wp--preset--color--ink);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto var(--wp--preset--spacing--20);
	transition: transform 0.3s ease;
}

.dsp-info-card:hover .dsp-info-card__icon {
	transform: scale(1.1) rotate(-6deg);
}

.dsp-legal {
	opacity: 0.75;
	line-height: 1.6;
}

/* Contact Form 7 con los estilos del design system. */
.wpcf7 form > p {
	margin-bottom: var(--wp--preset--spacing--40);
}

.wpcf7 label {
	display: block;
	font-weight: 700;
	font-size: 14px;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
	font-family: inherit;
	font-size: 15px;
	padding: 12px 14px;
	margin-top: var(--wp--preset--spacing--20);
	border-radius: var(--wp--custom--radius--sm);
	border: 1.5px solid var(--wp--preset--color--surface-muted);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	width: 100%;
	font-weight: 400;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpcf7 textarea {
	min-height: 140px;
	resize: vertical;
}

.wpcf7 input:focus,
.wpcf7 textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--action);
	box-shadow: 0 0 0 3px rgba(130, 197, 60, 0.25);
}

.wpcf7 .wpcf7-acceptance label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-weight: 400;
	font-size: 14px;
	line-height: 1.5;
}

.wpcf7 input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin-top: 2px;
	accent-color: var(--wp--preset--color--action);
	flex: none;
}

.wpcf7 input[type="submit"] {
	background: var(--wp--preset--color--action);
	color: var(--wp--preset--color--ink);
	border: none;
	border-radius: var(--wp--custom--radius--full);
	padding: 16px 32px;
	font-family: inherit;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
	transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.wpcf7 input[type="submit"]:hover {
	background: var(--wp--preset--color--brand-dark);
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 12px 26px rgba(66, 147, 33, 0.38);
}

.wpcf7 .wpcf7-response-output {
	border-radius: var(--wp--custom--radius--sm);
	border-width: 2px;
	padding: var(--wp--preset--spacing--30);
	margin: var(--wp--preset--spacing--30) 0 0;
	font-size: 15px;
}

.wpcf7 .wpcf7-not-valid-tip {
	color: #a8261c;
	font-size: 13px;
	font-weight: 700;
}

/* ----------------------------------------------- botones flotantes */

.dsp-fabs {
	position: fixed;
	right: var(--wp--preset--spacing--40);
	bottom: var(--wp--preset--spacing--40);
	z-index: 70;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.dsp-fab {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--wp--preset--color--action);
	color: var(--wp--preset--color--ink);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 20px rgba(39, 30, 21, 0.28);
	transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
	text-decoration: none;
}

.dsp-fab:hover,
.dsp-fab:focus-visible {
	transform: scale(1.1);
	background: var(--wp--preset--color--brand-dark);
	color: #fff;
}

@media (max-width: 600px) {
	.dsp-fabs {
		right: var(--wp--preset--spacing--30);
		bottom: var(--wp--preset--spacing--30);
	}

	.dsp-fab {
		width: 46px;
		height: 46px;
	}
}

/* --------------------------------------------------------- pie */

.dsp-footer a {
	text-decoration: none;
}

.dsp-footer a:hover {
	text-decoration: underline;
}

.dsp-social a {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #fff;
	color: var(--wp--preset--color--footer);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.25s ease, background-color 0.25s ease;
}

.dsp-social a:hover {
	transform: translateY(-3px);
	background: var(--wp--preset--color--brand-light);
}

/* ------------------------------------------------------- utilidades */

.dsp-eyebrow {
	font-weight: 800;
	font-size: 13px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* Foco visible en todo el sitio. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
	outline: 3px solid var(--wp--preset--color--brand-dark);
	outline-offset: 2px;
}
