/**
 * Componentes atómicos — botones, badge, cards, barra de confianza.
 * Portado de techsalud-theme/assets/css/components.css (líneas exactas:
 * 259-301 barra de confianza, 303-364 botones/badge, 475-509 cards),
 * verbatim, sin cambios — ya es código correcto y probado en producción.
 */

@keyframes techsalud-fade-up {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	/* stylelint-disable declaration-no-important -- excepción documentada (docs/ESTANDARES.md §2): debe ganarle a cualquier animación/transición inline o de componente, sin importar su especificidad. */
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
	/* stylelint-enable declaration-no-important */
}

/* -------------------- Barra de confianza -------------------- */

.techsalud-trust-bar {
	background: var(--color-primary);
}

.techsalud-trust-bar ul {
	list-style: none;
	margin: 0;
	padding: 0.5rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.techsalud-trust-bar li {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	color: #fff;
	font-size: var(--font-size-xs);
	font-weight: var(--font-weight-medium);
	text-align: center;
}

.techsalud-trust-bar .ts-icon {
	flex-shrink: 0;
	opacity: 0.9;
}

@media (min-width: 768px) {
	.techsalud-trust-bar ul {
		flex-direction: row;
		justify-content: center;
		gap: 2rem;
		padding: 0.6rem 1rem;
	}

	.techsalud-trust-bar li {
		font-size: var(--font-size-sm);
	}
}

/* -------------------- Botones -------------------- */

/*
 * color se redeclara en :hover/:active de cada botón a propósito, no
 * solo en el estado base — bug real reportado por el cliente: la regla
 * global `a:hover{color:var(--color-secondary-hover)}` (base.css) gana
 * por especificidad (0,1,1) contra el color base del botón (0,1,0), y
 * como estos botones solo cambiaban el `background` en :hover, el texto
 * quedaba azul sobre un fondo también azul — contraste inexistente.
 * Todo botón con fondo de color debe fijar su propio `color` en cada
 * estado (base, :hover, :active), nunca depender del fallback del `a`
 * genérico — mismo criterio para cualquier botón nuevo que se agregue.
 */
.button-primary,
.button.alt,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt {
	background: var(--color-cta);
	color: #fff;
	border: none;
	border-radius: var(--radius-pill);
	font-weight: var(--font-weight-semibold);
	box-shadow: var(--shadow-sm);
	padding: 0.75rem 1.5rem;
	transition: background 160ms ease-out, transform 160ms ease-out;
}

.button-primary:hover,
.button.alt:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
	background: var(--color-cta-hover);
	color: #fff;
}

.button-primary:active,
.button.alt:active,
.woocommerce #respond input#submit:active,
.woocommerce a.button.alt:active,
.woocommerce button.button.alt:active {
	background: var(--color-cta-active);
	color: #fff;
	transform: scale(0.97);
}

.button-secondary,
.woocommerce a.button,
.woocommerce button.button {
	background: #fff;
	color: var(--color-primary);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-pill);
	font-weight: var(--font-weight-semibold);
	padding: 0.75rem 1.5rem;
	transition: background 160ms ease-out, transform 160ms ease-out;
}

.button-secondary:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
	background: var(--color-primary-light);
	color: var(--color-primary);
}

.button-secondary:active,
.woocommerce a.button:active,
.woocommerce button.button:active {
	color: var(--color-primary);
	transform: scale(0.97);
}

/* -------------------- Badges -------------------- */

.techsalud-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	border-radius: var(--radius-pill);
	padding: 0.3rem 0.85rem;
	font-size: var(--font-size-xs);
	font-weight: var(--font-weight-medium);
	background: var(--color-info-light);
	color: var(--color-primary);
}

/* -------------------- Cards -------------------- */

.techsalud-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
	margin: 2rem 0;
}

@media (min-width: 768px) {
	.techsalud-cards {
		grid-template-columns: repeat(3, 1fr);
	}
}

.techsalud-card {
	background: var(--color-card);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	padding: 1.5rem;
	animation: techsalud-fade-up 450ms ease-out both;
	transition: box-shadow 200ms ease-out, transform 200ms ease-out;
}

.techsalud-cards > *:nth-child(1) { animation-delay: 0ms; }
.techsalud-cards > *:nth-child(2) { animation-delay: 60ms; }
.techsalud-cards > *:nth-child(3) { animation-delay: 120ms; }
.techsalud-cards > *:nth-child(4) { animation-delay: 180ms; }
.techsalud-cards > *:nth-child(n+5) { animation-delay: 220ms; }

.techsalud-card:hover {
	box-shadow: var(--shadow-md);
	transform: translateY(-2px);
}
