/*
Theme Name: Xan Cerámica
Theme URI: https://xanceramicamx.sbs
Author: Xan Cerámica
Author URI: https://xanceramicamx.sbs
Description: Tema de Xan Cerámica. Diseño claro y atemporal: fondo color barro, tipografía clásica (Libre Caslon + Instrument Sans, incluidas en el tema) y los diez colores del logo como único acento. Integrado con WooCommerce (catálogo, producto, carrito, checkout y mi cuenta), compatible con el plugin Xan Kits y Colores y con Correos Xan. Textos de portada, contacto y redes editables en Apariencia > Personalizar > Xan Cerámica.
Version: 3.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: xan-ceramica
Tags: e-commerce, custom-logo, custom-menu, featured-images, woocommerce
*/

/* ═════════════════════════════════════════
   Tokens
   ═════════════════════════════════════════ */
:root {
	--bg: #F4EFE7;          /* barro bizcochado */
	--surface: #FBF8F3;     /* esmalte blanco */
	--clay: #E8E0D3;        /* fondo de fotos */
	--ink: #2F2D2D;         /* el gris del logo */
	--ink-2: #5F5954;       /* texto secundario */
	--ink-3: #8A827A;       /* notas */
	--line: #DCD3C6;
	--line-2: #CBC0B1;
	--ok: #3E6B4F;
	--err: #A3344B;

	--serif-d: "Caslon Display", "Libre Caslon Display", Georgia, "Times New Roman", serif;
	--serif: "Caslon Text", "Libre Caslon Text", Georgia, "Times New Roman", serif;
	--sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

	--wrap: 1320px;
	--gut: clamp(20px, 4vw, 48px);
	--sp: clamp(64px, 9vw, 128px); /* separación entre bloques */
	--r: 2px;
	--ease: cubic-bezier(.2, .7, .2, 1);
	--ease-out: cubic-bezier(.16, 1, .3, 1);
	--ease-io: cubic-bezier(.77, 0, .18, 1);
}

/* ═════════════════════════════════════════
   Base
   ═════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
body.xan-lock { overflow: hidden; }
img, video, svg { max-width: 100%; height: auto; }
img { display: block; }
figure { margin: 0; }
picture { display: contents; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--ink); }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
::selection { background: #F3E592; color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .5em;
	font-family: var(--serif-d);
	font-weight: 400;
	line-height: 1.12;
	letter-spacing: -.005em;
	color: var(--ink);
}
h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.45rem; }
h4, h5, h6 { font-family: var(--sans); font-weight: 600; font-size: 1rem; letter-spacing: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut); }
.wrap--narrow { max-width: 820px; }
.muted { color: var(--ink-3); }

.kicker {
	margin: 0 0 1.1em;
	font-family: var(--serif);
	font-style: italic;
	font-size: 1.02rem;
	color: var(--ink-2);
}

/* Muestras de color: fichas de prueba con el orificio para colgar en el horno */
.chip {
	display: inline-block;
	flex: none;
	width: 12px;
	height: 12px;
	border-radius: 1px;
	background: var(--c, var(--clay));
	box-shadow: inset 0 0 0 1px rgba(47, 45, 45, .08);
	vertical-align: -1px;
}
.swatches { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.swatches i {
	display: block;
	width: 18px;
	height: 26px;
	border-radius: 1px;
	background: radial-gradient(circle at 50% 6px, var(--bg) 0 2.2px, transparent 2.8px), var(--c);
	box-shadow: inset 0 0 0 1px rgba(47, 45, 45, .06);
}
.swatches--sm i { width: 12px; height: 17px; background: radial-gradient(circle at 50% 4px, var(--bg) 0 1.5px, transparent 2px), var(--c); }

/* ═════════════════════════════════════════
   Botones y enlaces
   ═════════════════════════════════════════ */
.btn,
.button,
button.button,
input[type="submit"],
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	min-height: 48px;
	padding: 12px 24px;
	border: 1px solid var(--ink);
	border-radius: var(--r);
	background: var(--ink);
	color: var(--surface);
	font-family: var(--sans);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: .01em;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover,
.button:hover,
button.button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover { background: #141313; border-color: #141313; color: var(--surface); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--surface); }
.btn--block { width: 100%; }
.btn[disabled], .button.disabled, .button:disabled, .button[disabled] { opacity: .45; cursor: not-allowed; }

.link {
	display: inline-block;
	font-size: 15px;
	font-weight: 500;
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--line-2);
	text-underline-offset: .35em;
	transition: text-decoration-color .2s var(--ease);
}
.link:hover { text-decoration-color: var(--ink); }

/* ═════════════════════════════════════════
   Formularios
   ═════════════════════════════════════════ */
label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--ink); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"],
input[type="search"], input[type="url"], input[type="date"], select, textarea, .input-text {
	width: 100%;
	min-height: 48px;
	padding: 11px 14px;
	border: 1px solid var(--line-2);
	border-radius: var(--r);
	background: var(--surface);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.4;
	transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
	-webkit-appearance: none;
	appearance: none;
}
textarea { min-height: 150px; resize: vertical; }
select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232F2D2D' stroke-width='1.4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
}
input:focus, select:focus, textarea:focus, .input-text:focus {
	outline: none;
	border-color: var(--ink);
	box-shadow: 0 0 0 1px var(--ink);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); width: 17px; height: 17px; }
::placeholder { color: var(--ink-3); opacity: 1; }

/* ═════════════════════════════════════════
   Accesibilidad y clases del núcleo de WordPress
   ═════════════════════════════════════════ */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
.skip-link {
	position: absolute;
	top: -60px;
	left: 12px;
	z-index: 1000;
	padding: 10px 16px;
	background: var(--ink);
	color: var(--surface);
	text-decoration: none;
	border-radius: var(--r);
}
.skip-link:focus { top: 12px; }
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { font-family: var(--serif); font-style: italic; font-size: .92rem; color: var(--ink-2); }
.sticky, .bypostauthor, .gallery-caption { }

/* ═════════════════════════════════════════
   Movimiento
   - Todo anima solo transform / opacity / clip-path.
   - Los elementos se ocultan para animarse solo si hay JavaScript
     (clase .js en <html>); si el script no carga en 3 s, se muestran.
   - "Reducir movimiento" del sistema desactiva todo.
   ═════════════════════════════════════════ */
.js [data-reveal] {
	opacity: 0;
	transform: translate3d(0, 28px, 0);
	transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out);
	transition-delay: calc(var(--d, 0) * 70ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
[data-split] .w__i { display: inline-block; transform: translate3d(0, 108%, 0); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms + 120ms); }
[data-split].is-in .w__i { transform: none; }

.js.no-motion [data-reveal] { opacity: 1; transform: none; }

@keyframes xan-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes xan-fade-up { from { opacity: 0; transform: translate3d(0, 16px, 0); } to { opacity: 1; transform: none; } }
@keyframes xan-zoom-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes xan-wipe-up { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes xan-paint { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes xan-progress { from { width: 0; } to { width: 100%; } }
@keyframes xan-drop { 0% { opacity: 0; transform: translate3d(0, -18px, 0) rotate(-10deg); } 60% { opacity: 1; transform: translate3d(0, 2px, 0) rotate(4deg); } 100% { transform: none; } }
@keyframes xan-swing { 0% { transform: rotate(0); } 18% { transform: rotate(6deg); } 40% { transform: rotate(-4deg); } 60% { transform: rotate(2.2deg); } 80% { transform: rotate(-1deg); } 100% { transform: rotate(0); } }

/* Transición suave entre páginas (navegadores compatibles) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .22s var(--ease) both xan-vt-out; }
::view-transition-new(root) { animation: .38s var(--ease-out) both xan-vt-in; }
@keyframes xan-vt-out { to { opacity: 0; } }
@keyframes xan-vt-in { from { opacity: 0; transform: translate3d(0, 10px, 0); } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
	.js [data-reveal] { opacity: 1; transform: none; }
	[data-split] .w__i { transform: none; }
	@view-transition { navigation: none; }
}
