/*
 * HCP · Web — estilos base.
 *
 * Complementan a theme.json: ritmo de página, utilidades de tarjeta/contenedor,
 * y una capa fina para que WooCommerce (botones, precios, avisos, formularios)
 * hable el mismo idioma que el tema. Los componentes grandes (hero de portada,
 * cabecera de archivo por revista, panel de soporte, ficha) llegan con sus
 * plantillas en fases posteriores.
 */

/* ------------------------------------------------------------------ *
 * Fundamentos
 * ------------------------------------------------------------------ */

:root {
	--hcp-wrap: var(--wp--custom--wrap, 1200px);
	--hcp-radius: var(--wp--custom--radius, 14px);
	--hcp-radius-pill: var(--wp--custom--radius-pill, 999px);
	--hcp-card-padding: var(--wp--custom--card-padding, clamp(12.5px, 4vw, 36px));
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

a {
	text-decoration: none;
}

a:hover,
a:focus-visible {
	text-decoration: underline;
}

:where(h1, h2, h3, h4) {
	text-wrap: balance;
}

:where(p, li) {
	text-wrap: pretty;
}

/* Foco visible y coherente en toda la tienda. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--custom--rev--accent, var(--wp--preset--color--red));
	outline-offset: 2px;
	border-radius: 2px;
}

/* ------------------------------------------------------------------ *
 * Utilidades del tema
 * ------------------------------------------------------------------ */

.hcp-wrap {
	max-width: var(--hcp-wrap);
	margin-inline: auto;
	padding-inline: clamp(1rem, 5vw, 2rem);
}

/* Tarjeta blanca: el contenedor recurrente de todo el sistema. */
.hcp-card,
.wp-block-group.is-style-hcp-card {
	background: var(--wp--preset--color--paper);
	border-radius: var(--hcp-radius);
	padding: var(--hcp-card-padding);
	box-sizing: border-box;
}

.hcp-card + .hcp-card {
	margin-top: 1rem;
}

/* Banda a sangre completa dentro de un layout «constrained». */
.hcp-bleed {
	margin-inline: calc(50% - 50vw);
	padding-inline: calc(50vw - 50%);
}

/* ------------------------------------------------------------------ *
 * Botones (núcleo + WooCommerce) → una sola apariencia
 * ------------------------------------------------------------------ */

.wp-block-button__link,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.wc-block-components-button {
	--wc-btn-bg: var(--wp--custom--rev--accent, var(--wp--preset--color--red));
	background-color: var(--wc-btn-bg);
	color: var(--wp--custom--rev--accent-contrast, #fff);
	border: none;
	border-radius: var(--hcp-radius);
	padding: 0.875rem 1.75rem;
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	font-size: 0.9375rem;
	line-height: 1.2;
	cursor: pointer;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.wp-block-button__link:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.wc-block-components-button:hover {
	opacity: 0.9;
	color: var(--wp--custom--rev--accent-contrast, #fff);
}

.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-hcp-ghost .wp-block-button__link {
	background: transparent;
	color: var(--wp--custom--rev--accent, var(--wp--preset--color--red));
	border: 1px solid currentColor;
}

/* ------------------------------------------------------------------ *
 * WooCommerce — coherencia mínima (la ficha y el escaparate se rehacen)
 * ------------------------------------------------------------------ */

.woocommerce {
	font-family: var(--wp--preset--font-family--body);
}

.woocommerce .price,
.woocommerce div.product p.price,
.woocommerce div.product span.price {
	color: var(--wp--preset--color--ink);
	font-weight: 700;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	background: var(--wp--preset--color--paper);
	border-radius: var(--hcp-radius);
	padding: 1rem;
	box-sizing: border-box;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-size: 1rem;
	font-weight: 700;
	padding-top: 0.5rem;
}

.woocommerce ul.products li.product img {
	border-radius: calc(var(--hcp-radius) - 4px);
}

/* Avisos de WooCommerce con la paleta del tema. */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner {
	border-radius: var(--hcp-radius);
	border-top: none;
	font-family: var(--wp--preset--font-family--body);
}

.woocommerce-message,
.wc-block-components-notice-banner.is-success {
	background: var(--wp--preset--color--success-bg);
	box-shadow: inset 4px 0 0 var(--wp--preset--color--success);
}

.woocommerce-message::before,
.woocommerce-info::before {
	color: var(--wp--custom--rev--accent, var(--wp--preset--color--red));
}

.woocommerce-error,
.wc-block-components-notice-banner.is-error {
	background: #ffebee;
	box-shadow: inset 4px 0 0 var(--wp--preset--color--red);
}

/* Campos de formulario (checkout, mi cuenta, comentarios). */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.wc-block-components-text-input input,
#comments textarea,
#comments input[type="text"],
#comments input[type="email"] {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 10px;
	background: var(--wp--preset--color--paper);
}

/* ------------------------------------------------------------------ *
 * Comentarios (usados en las entradas de vídeo Pixels)
 * ------------------------------------------------------------------ */

.wp-block-comments,
.comments-area {
	background: var(--wp--preset--color--paper);
	border-radius: var(--hcp-radius);
	padding: clamp(1rem, 4vw, 1.5rem);
	max-width: var(--hcp-wrap);
	margin-inline: auto;
}

.comment-reply-title,
.comments-title {
	color: var(--wp--custom--rev--accent-ink, var(--wp--preset--color--px));
}
