/* ================================
   🎨 VARIABLES CSS (Fallbacks)
   Se sobrescriben dinámicamente desde Config Tema
   ================================ */
:root {
	/* Colores - Fallbacks */
	--color-primary: #A65D57;
	--color-primary-light: #C17A74;
	--color-primary-dark: #8B4E49;
	--color-text: #1A1917;
	--color-text-light: #6B6560;
	--color-background: #FAF8F5;
	--color-white: #FDFCFA;

	/* Tipografías - Fallbacks */
	--font-heading: 'Afacad', system-ui, sans-serif;
	--font-body: 'DM Sans', system-ui, sans-serif;

	/* Tamaños Headings */
	--font-size-h1: clamp(3.8rem, 7.65vw, 6.1rem);
	--font-size-h2: clamp(2.5rem, 5vw, 4rem);
	--font-size-h3: clamp(1.5rem, 3vw, 2rem);
	--font-size-h4: clamp(1.25rem, 2vw, 1.5rem);
	--font-size-h5: 1.15rem;
	--font-size-h6: 1rem;

	/* Tamaños Body */
	--font-size-body: 1rem;
	--font-size-body-lg: 1.25rem;
	--font-size-body-sm: 0.875rem;
	--font-size-body-xs: 0.75rem;

	/* Espaciado - Fallbacks */
	--space-xs: 0.5rem;
	--space-sm: 1rem;
	--space-md: 2rem;
	--space-lg: 4rem;
	--space-xl: 6rem;

	/* Border Radius - Fallbacks */
	--radius-sm: 0.5rem;
	--radius-md: 1rem;
	--radius-lg: 1.5rem;
	--radius-full: 100px;

	/* Pesos (no editables) */
	--font-weight-normal: 400;
	--font-weight-medium: 500;
	--font-weight-semibold: 600;
	--font-weight-bold: 700;
	--font-weight-extrabold: 800;

	/* Line Heights (no editables) */
	--line-height-tight: 1.1;
	--line-height-heading: 1.2;
	--line-height-body: 1.6;

	/* Letter Spacing (no editables) */
	--letter-spacing-tight: -0.03em;
	--letter-spacing-normal: 0;
	--letter-spacing-wide: 0.05em;
	--letter-spacing-wider: 0.1em;

	/* Transiciones (no editables) */
	--transition-fast: 0.2s ease;
	--transition-normal: 0.4s ease;
	--transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

	/* Sombras (no editables) */
	--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
	--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
	--shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* ================================
   RESET
   ================================ */
*, *::before, *::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* ================================
   REM RESPONSIVE
   Desktop: 16px | Tablet: 14px | Móvil: 12px
   ================================ */
html {
	font-size: 16px;
	scroll-behavior: smooth;
}

@media (max-width: 1024px) {
	html {
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	html {
		font-size: 12px;
	}
}

body {
	font-family: var(--font-body);
	color: var(--color-text);
	background-color: var(--color-primary);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
	background-size: 200px 200px;
	line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	font-weight: var(--font-weight-semibold);
	line-height: var(--line-height-heading);
	letter-spacing: var(--letter-spacing-tight);
}

h1 { font-size: var(--font-size-h1); font-weight: var(--font-weight-extrabold); }
h2 { font-size: var(--font-size-h2); font-weight: var(--font-weight-extrabold); }
h3 { font-size: var(--font-size-h3); font-weight: var(--font-weight-bold); }
h4 { font-size: var(--font-size-h4); font-weight: var(--font-weight-bold); }
h5 { font-size: var(--font-size-h5); font-weight: var(--font-weight-semibold); }
h6 { font-size: var(--font-size-h6); font-weight: var(--font-weight-semibold); }

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

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

ul, ol {
	list-style: none;
}

/* ================================
   UTILIDADES
   ================================ */
.container {
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 var(--space-md);
}

/* ================================
   FLEX UTILITIES
   ================================ */
.flex {
	display: flex;
}

.flex-col {
	flex-direction: column;
}

.flex-wrap {
	flex-wrap: wrap;
}

.items-center {
	align-items: center;
}

.items-start {
	align-items: flex-start;
}

.items-end {
	align-items: flex-end;
}

.justify-center {
	justify-content: center;
}

.justify-between {
	justify-content: space-between;
}

.justify-start {
	justify-content: flex-start;
}

.justify-end {
	justify-content: flex-end;
}

.gap-xs {
	gap: var(--space-xs);
}

.gap-sm {
	gap: var(--space-sm);
}

.gap-md {
	gap: var(--space-md);
}

.gap-lg {
	gap: var(--space-lg);
}

.gap-xl {
	gap: var(--space-xl);
}

/* Flex children */
.flex-1 {
	flex: 1;
}

.flex-half {
	flex: 0 0 50%;
	max-width: 50%;
}

@media (max-width: 768px) {
	.flex-half {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

/* ================================
   SECTIONS (Tarjetas flotantes)
   ================================ */
.sections-wrapper {
	display: flex;
	flex-direction: column;
	gap: 4rem;
	padding-top: 6rem;
}

.stacking-group {
	display: flex;
	flex-direction: column;
	gap: 18rem;

	@media (max-width: 768px) {
		gap: 2rem;
	}
}

.section-card {
	background: var(--color-white);
	border-radius: var(--radius-lg);
	margin: 0 var(--space-md);
	box-shadow: var(--shadow-sm);
	width: calc(100% - var(--space-md) * 2);
	position: relative;
	overflow: hidden;
}

/* Cuando JS detecta que debe ser sticky */
@media (min-width: 769px) {
	.section-card.is-sticky {
		position: sticky;
	}
}

@media (max-width: 768px) {
	.section-card {
		margin: 0 1.5rem;
		width: calc(100% - 3rem);
	}
}

@media (min-width: 1432px) {
	.section-card {
		max-width: 1400px;
		margin-left: auto;
		margin-right: auto;
	}
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* ================================
   HEADER
   ================================ */
.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: var(--space-sm) var(--space-md);
	background: transparent;
	border-bottom: 1px solid transparent;
	transition:
		background var(--transition-normal),
		border-color var(--transition-normal),
		padding var(--transition-normal);
}

.site-header.scrolled {
	background: var(--color-primary);
	border-bottom: 1px solid var(--color-primary-dark);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.logo-link {
	display: block;
}

.logo {
	height: 3.6rem;
	width: auto;
	transition: height var(--transition-normal);
}

.site-header.scrolled .logo {
	height: 2.5rem;
}

@media (max-width: 768px) {
	.logo {
		height: 2.9rem;
	}

	.site-header.scrolled .logo {
		height: 2rem;
	}
}

/* ================================
   FOOTER
   ================================ */
.site-footer {
	background: var(--color-text);
	color: var(--color-white);
	padding: 3rem 2rem;
	margin-top: var(--space-xl);
}

.footer-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
	text-align: center;
}

.footer-top {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
}

.footer-logo {
	display: block;
	margin-bottom: 0.5rem;
}

.footer-logo-img {
	height: 2.5rem;
	width: auto;
	filter: brightness(0) invert(1);
}

.footer-copy {
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.6);

	a {
		color: var(--color-white);
		text-decoration: underline;
		text-underline-offset: 2px;

		&:hover {
			text-decoration: none;
		}
	}
}

.footer-legal {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 1.5rem;

	a {
		font-size: 0.8rem;
		color: rgba(255, 255, 255, 0.5);
		text-decoration: none;
		transition: color var(--transition-fast);

		&:hover {
			color: var(--color-white);
		}
	}
}

/* ================================
   REVEAL ANIMATIONS
   ================================ */
[data-reveal] {
	opacity: 0;
	transform: translateY(30px);
	transition:
		opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
		transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal="fade"] {
	transform: none;
}

[data-reveal="left"] {
	transform: translateX(-30px);
}

[data-reveal="right"] {
	transform: translateX(30px);
}

[data-reveal="scale"] {
	transform: scale(0.95);
}

[data-reveal].is-visible {
	opacity: 1;
	transform: none;
}

/* Delays escalonados */
[data-reveal][data-delay="1"] { transition-delay: 0.1s; }
[data-reveal][data-delay="2"] { transition-delay: 0.2s; }
[data-reveal][data-delay="3"] { transition-delay: 0.3s; }
[data-reveal][data-delay="4"] { transition-delay: 0.4s; }
[data-reveal][data-delay="5"] { transition-delay: 0.5s; }
[data-reveal][data-delay="6"] { transition-delay: 0.6s; }
[data-reveal][data-delay="7"] { transition-delay: 0.7s; }
[data-reveal][data-delay="8"] { transition-delay: 0.8s; }
[data-reveal][data-delay="9"] { transition-delay: 0.9s; }
[data-reveal][data-delay="10"] { transition-delay: 1s; }

/* Sin animaciones en móvil si prefiere reduced motion */
@media (prefers-reduced-motion: reduce) {
	[data-reveal] {
		opacity: 1;
		transform: none;
		transition: none;
	}
}
