/* DeFábrica Directo — base: reinicio, tipografía, contenedor, botones, campos y accesibilidad.
   Valores solo desde tokens.css (docs/15-sistema-de-diseno.md). */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--df-fuente);
	font-size: var(--df-t-cuerpo);
	line-height: 1.5;
	color: var(--df-texto);
	background: var(--df-blanco);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body.dfd-fondo-suave .contenido {
	background: var(--df-fondo-suave);
}

img,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 0.5em;
	color: var(--df-texto-fuerte);
	line-height: 1.2;
	font-weight: 700;
}

p {
	margin: 0 0 1em;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

/* :where() deja la especificidad en 0: así no anula los márgenes de .contenedor. */
:where(ul[class], ol[class]) {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Contenedor general. En las 4 referencias el contenido ocupa ≈ 90 % del ancho (89,4–90,4 %, medido); el máximo es
   el de la especificación §4 (≈ 1480 px). En tablet y móvil, margen fijo. */
.contenedor {
	width: min(var(--df-contenedor), 90%);
	margin-inline: auto;
}

@media (max-width: 1023px) {
	.contenedor {
		width: 100%;
		padding-inline: var(--df-margen);
	}
}

@media (max-width: 599px) {
	:root {
		--df-margen: 16px;
	}
}

.contenido:focus {
	outline: none;
}

/* Iconos de línea del sprite (tamaño fijo: sin max-width, que los anula dentro de contenedores ajustados) */
.icono {
	width: 24px;
	height: 24px;
	max-width: none;
	flex: none;
}

/* Accesibilidad */
.screen-reader-text {
	position: absolute !important; /* WordPress usa esta clase en su propio marcado; debe ganar siempre. */
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.saltar-contenido {
	position: absolute;
	left: var(--df-margen);
	top: -100px;
	z-index: 1000;
	padding: 12px 16px;
	background: var(--df-texto-fuerte);
	color: var(--df-blanco);
	border-radius: var(--df-radio);
	font-weight: 600;
}

.saltar-contenido:focus {
	top: 8px;
}

:focus-visible {
	outline: 2px solid var(--df-naranja-aa);
	outline-offset: 2px;
}

/* Botones (especificación §49: idénticos en toda la tienda) */
.boton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: var(--df-alto-boton);
	padding: 0 24px;
	border: 2px solid transparent;
	border-radius: var(--df-radio);
	font-weight: 700;
	font-size: 0.9375rem;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Botón principal con texto pequeño: naranja AA (4,8:1). */
.boton--principal {
	background: var(--df-naranja-aa);
	color: var(--df-blanco);
}

.boton--principal:hover {
	background: var(--df-naranja-aa-hover);
}

/* Botón principal grande (≥ 19 px en negrita): el naranja exacto de las referencias es AA para texto grande. */
.boton--grande {
	min-height: 52px;
	font-size: var(--df-t-boton);
	background: var(--df-naranja);
	color: var(--df-blanco);
}

.boton--grande:hover {
	background: var(--df-naranja-hover);
}

.boton--contorno {
	background: var(--df-blanco);
	border-color: var(--df-naranja);
	color: var(--df-naranja-aa);
}

.boton--contorno:hover {
	background: var(--df-naranja-suave);
}

.boton--blanco {
	background: var(--df-blanco);
	color: var(--df-texto-fuerte);
}

/* Campos */
.campo {
	width: 100%;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--df-borde);
	border-radius: var(--df-radio);
	background: var(--df-blanco);
	font-size: 0.875rem;
}

.campo::placeholder {
	color: var(--df-texto-2);
	opacity: 1;
}

.casilla {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.8125rem;
	color: var(--df-texto-2);
	cursor: pointer;
}

.casilla input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--df-naranja-aa);
}

/* Páginas de texto */
.pagina {
	padding-block: 40px 64px;
}

.pagina__titulo {
	font-size: var(--df-t-h1-categoria);
}

.contenido-texto {
	max-width: 80ch;
}

/* Migas de pan (listados y ficha de producto) */
.migas {
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--df-texto-2);
}

.migas__lista {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.migas__elemento {
	display: inline-flex;
	align-items: center;
}

.migas__elemento + .migas__elemento::before {
	content: "";
	width: 7px;
	height: 7px;
	margin: 0 10px 0 9px;
	border-top: 1.5px solid currentColor;
	border-right: 1.5px solid currentColor;
	transform: rotate(45deg);
	opacity: 0.8;
}

.migas a {
	color: inherit;
	text-decoration: none;
}

.migas a:hover {
	color: var(--df-texto-fuerte);
	text-decoration: underline;
}

.migas [aria-current="page"],
.migas--yoast .breadcrumb_last {
	color: var(--df-texto);
}

/* Avisos de WooCommerce (añadido al carrito, errores, información) en todas las páginas de la tienda */
.woocommerce-notices-wrapper:empty {
	display: none;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	margin: 16px 0 0;
	padding: 14px 18px;
	border: 1px solid var(--df-borde);
	border-left: 4px solid var(--df-verde);
	border-radius: var(--df-radio);
	background: var(--df-blanco);
	font-size: 0.9375rem;
	color: var(--df-texto);
	list-style: none;
}

.woocommerce-info {
	border-left-color: var(--df-naranja);
}

.woocommerce-error {
	display: block;
	border-left-color: var(--df-descuento-ficha);
}

.woocommerce-error li + li {
	margin-top: 6px;
}

.woocommerce-message .button,
.woocommerce-info .button {
	order: 2;
	margin-left: auto;
	padding: 8px 14px;
	border: 1px solid var(--df-naranja);
	border-radius: var(--df-radio);
	background: var(--df-blanco);
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--df-naranja-aa);
	text-decoration: none;
	white-space: nowrap;
}

.woocommerce-message .button:hover,
.woocommerce-info .button:hover {
	background: var(--df-naranja-suave);
}

.woocommerce-message:focus,
.woocommerce-error:focus,
.woocommerce-info:focus {
	outline: none;
}

/* Opciones elegidas de una línea de carrito o pedido (dl.variation de WooCommerce): una por línea, «Color: Roble».
   Carrito, minicarrito, checkout y pedidos. */
dl.variation {
	margin: 6px 0 0;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--df-texto-2);
}

dl.variation dt,
dl.variation dd {
	display: inline;
	margin: 0;
	font-weight: 400;
}

dl.variation dd {
	color: var(--df-texto);
}

dl.variation dd::after {
	content: "";
	display: block;
}

dl.variation p {
	display: inline;
	margin: 0;
}
