/* ═══════════════════════════════════════
   HEADER.CSS — Soria Casas Layout
   ═══════════════════════════════════════ */

/* ═══ CSS VARIABLES (shared by header + footer) ═══ */
:root {
	--azul: #4a8fcc;
	--azul-hover: #3a7fb8;
	--azul-light: rgba(74, 143, 204, 0.08);
	--beige: #fbf5e9;
	--beige-dark: #f0e8d5;
	--blanco: #ffffff;
	--gris-texto: #54585e;
	--negro: #333333;
	--borde: #e5e5e5;
	--sombra: 0 2px 16px rgba(0, 0, 0, 0.08);
	--radio: 12px;
	--radio-sm: 8px;
	--max-width: 1200px;
	--transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══ UTILITIES (used by header + footer templates) ═══ */
.scl-container {
	width: 100%;
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 24px;
}

.scl-skip-link {
	position: absolute;
	top: -100%;
	left: 16px;
	background: var(--azul);
	color: #fff;
	padding: 8px 16px;
	border-radius: var(--radio-sm);
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	font-weight: 600;
	z-index: 10000;
	transition: top 0.2s;
	text-decoration: none;
}

.scl-skip-link:focus {
	top: 8px;
}

/* ═══ HEADER WRAPPER ═══ */
.scl-header {
	position: sticky;
	top: 0;
	z-index: 9999;
	width: 100%;
	transition: box-shadow var(--transition);
}

.scl-header--sticky {
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

/* ═══ MAIN BAR ═══ */
.scl-mainbar {
	background: #ffffff;
	border-bottom: 1px solid #e5e5e5;
	height: 72px;
	transition: background var(--transition);
	position: relative;
	z-index: 9999;
}

.scl-header--sticky .scl-mainbar {
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom-color: transparent;
}

.scl-mainbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	max-width: 1320px;
	padding: 0 32px;
}

/* ═══ LOGO ═══ */
.scl-logo {
	flex-shrink: 0;
}

.scl-logo img {
	max-height: 50px;
	width: auto;
}

/* ═══ NAV DESKTOP (centrado) ═══ */
.scl-nav {
	margin: 0 auto;
}

.scl-nav__list {
	display: flex;
	align-items: center;
	gap: 6px;
	list-style: none;
}

.scl-nav__link {
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	font-weight: 500;
	color: var(--gris-texto);
	padding: 8px 14px;
	border-radius: var(--radio-sm);
	transition: color var(--transition), background var(--transition);
	white-space: nowrap;
}

.scl-nav__link:hover {
	color: var(--negro);
	background: var(--gris-50, #f9fafb);
}

.scl-nav__link--active {
	color: var(--azul);
	font-weight: 600;
	background: var(--azul-light);
}

/* ═══ NAV CTA — hidden on desktop (shown as .scl-cta-val instead) ═══ */
.scl-nav__item--cta {
	display: none;
}

/* ═══ RIGHT SECTION ═══ */
.scl-mainbar__right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	position: relative;
	z-index: 2;
}

/* ── Action cluster (tools + valora + phone) ── */
.scl-actions {
	display: flex;
	align-items: center;
	gap: 4px;
	background: #f4f5f7;
	border-radius: 50px;
	padding: 4px;
}

/* ── Shared base for all action buttons ── */
.scl-actions__btn {
	height: 36px;
	border-radius: 50px;
	border: 1.5px solid transparent;
	background: transparent;
	font-family: 'DM Sans', sans-serif;
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-shrink: 0;
	padding: 0;
}

/* ── Tools button (icon only) ── */
.scl-tools__btn {
	width: 36px;
	padding: 0;
	color: var(--gris-texto);
}

.scl-tools__btn:hover {
	background: var(--blanco);
	color: var(--azul);
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
}

.scl-tools__btn[aria-expanded="true"] {
	background: #fff;
	color: var(--azul);
	box-shadow: 0 0 0 3px rgba(74, 143, 204, 0.15);
	position: relative;
	z-index: 10003;
}

.scl-tools__btn svg {
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
	opacity: 0.7;
}

.scl-tools__btn:hover svg,
.scl-tools__btn[aria-expanded="true"] svg {
	opacity: 1;
}

.scl-tools__btn[aria-expanded="true"] svg {
	transform: rotate(90deg);
}

/* ── CTA Valora (desktop: pill + star + texto) ── */
.scl-cta-val {
	padding: 0 16px 0 12px;
	background: var(--blanco);
	border-color: rgba(74, 143, 204, 0.2);
	color: var(--azul);
	box-shadow: 0 1px 3px rgba(74, 143, 204, 0.06);
}

.scl-cta-val svg {
	fill: rgba(74, 143, 204, 0.15);
	transition: all 0.25s;
}

.scl-cta-val:hover {
	background: var(--azul);
	border-color: var(--azul);
	color: var(--blanco);
	box-shadow: 0 3px 12px rgba(74, 143, 204, 0.3);
}

.scl-cta-val:hover svg {
	stroke: #fff;
	fill: rgba(255, 255, 255, 0.2);
}

/* ── CTA Valora mobile (star icon only) ── */
.scl-cta-val-mobile {
	display: none;
	width: 36px;
	color: var(--azul);
}

.scl-cta-val-mobile svg {
	fill: rgba(74, 143, 204, 0.12);
}

.scl-cta-val-mobile:hover {
	background: var(--blanco);
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
}

/* ── CTA Phone (primary, filled) ── */
.scl-cta-phone {
	width: 36px;
	background: var(--azul);
	color: #ffffff;
}

.scl-cta-phone:hover {
	background: var(--azul-hover);
	box-shadow: 0 3px 12px rgba(74, 143, 204, 0.35);
	transform: scale(1.06);
}

/* ── Language switcher (standalone, outside cluster) ── */
.scl-lang {
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: 'DM Sans', sans-serif;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--gris-texto);
	text-decoration: none;
	padding: 6px 10px;
	border: 1.5px solid var(--borde);
	border-radius: 50px;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	white-space: nowrap;
	height: 34px;
}

.scl-lang:hover {
	border-color: var(--azul);
	color: var(--azul);
	background: rgba(74, 143, 204, 0.04);
}

/* ═══ LANGUAGE FLAGS ═══ */

.scl-lang__flag {
	display: inline-block;
	width: 14px;
	height: 10px;
	border-radius: 1.5px;
	background-size: cover;
	background-position: center;
	flex-shrink: 0;
}

.scl-lang__flag--es {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 750 500'%3E%3Crect width='750' height='500' fill='%23c60b1e'/%3E%3Crect width='750' height='250' y='125' fill='%23ffc400'/%3E%3C/svg%3E");
}

.scl-lang__flag--en {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='s'%3E%3Cpath d='M0,0 v30 h60 v-30 z'/%3E%3C/clipPath%3E%3CclipPath id='t'%3E%3Cpath d='M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z'/%3E%3C/clipPath%3E%3Cg clip-path='url(%23s)'%3E%3Cpath d='M0,0 v30 h60 v-30 z' fill='%23012169'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' clip-path='url(%23t)' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/g%3E%3C/svg%3E");
}

.scl-lang__label {
	letter-spacing: 0.5px;
}

/* Mobile language switcher (inside mobile menu) */
.scl-mobile-menu__lang {
	padding: 8px 16px 0;
}

.scl-lang--mobile {
	display: inline-flex;
	border-color: var(--borde);
}

/* ═══ HAMBURGER ═══ */
.scl-hamburger {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	border-radius: var(--radio-sm);
	transition: background var(--transition);
	position: relative;
	z-index: 9999;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

.scl-hamburger:hover {
	background: rgba(0, 0, 0, 0.05);
}

.scl-hamburger__line {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--negro);
	border-radius: 2px;
	transition: transform var(--transition), opacity var(--transition);
}

/* Hamburger open state */
.scl-hamburger--open .scl-hamburger__line:nth-child(1) {
	transform: rotate(45deg) translate(5px, 5px);
}

.scl-hamburger--open .scl-hamburger__line:nth-child(2) {
	opacity: 0;
}

.scl-hamburger--open .scl-hamburger__line:nth-child(3) {
	transform: rotate(-45deg) translate(5px, -5px);
}

/* ═══ MOBILE MENU ═══ */
.scl-mobile-menu {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100dvh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	z-index: 9998;
	padding: 64px 20px 16px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-10px);
	transition: opacity var(--transition), transform var(--transition), visibility 0s linear 0.3s;
}

.scl-mobile-menu--open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
	transition: opacity var(--transition), transform var(--transition), visibility 0s linear 0s;
}

.scl-mobile-menu__list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.scl-mobile-menu__link {
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: 'DM Sans', sans-serif;
	font-size: 15px;
	font-weight: 500;
	color: var(--gris-texto);
	padding: 9px 16px;
	border-radius: var(--radio-sm);
	transition: color var(--transition), background var(--transition);
}

.scl-mobile-menu__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	background: #f4f5f7;
	color: #8b8f96;
	flex-shrink: 0;
	transition: all 0.25s;
}

.scl-mobile-menu__link:hover .scl-mobile-menu__icon,
.scl-mobile-menu__link--active .scl-mobile-menu__icon {
	background: rgba(74, 143, 204, 0.1);
	color: var(--azul);
}

.scl-mobile-menu__link--cta .scl-mobile-menu__icon {
	background: rgba(74, 143, 204, 0.12);
	color: var(--azul);
}

.scl-mobile-menu__link:hover {
	color: var(--azul);
	background: rgba(74, 143, 204, 0.04);
}

.scl-mobile-menu__link--active {
	color: var(--azul);
	font-weight: 600;
}

.scl-mobile-menu__link--cta {
	margin-top: 4px;
	border: 1.5px solid var(--azul);
	background: var(--blanco);
	color: var(--azul);
	font-weight: 600;
	border-radius: var(--radio-sm);
}
.scl-mobile-menu__link--cta:hover {
	background: var(--azul);
	color: #fff;
}

/* Mobile menu footer */
.scl-mobile-menu__footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--borde);
}

.scl-mobile-menu__phone {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 18px;
	font-weight: 600;
	color: var(--azul);
}

.scl-mobile-menu__socials {
	display: flex;
	gap: 16px;
}

.scl-mobile-menu__socials a {
	color: var(--gris-texto);
	transition: color var(--transition);
}

.scl-mobile-menu__socials a:hover {
	color: var(--azul);
}

.scl-mobile-menu__lang {
	display: flex;
	gap: 8px;
}

.scl-mobile-menu__lang-btn {
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 500;
	color: var(--gris-texto);
	border: 1px solid var(--borde);
	border-radius: var(--radio-sm);
	transition: all var(--transition);
}

.scl-mobile-menu__lang-btn:hover {
	border-color: var(--azul);
	color: var(--azul);
}

.scl-mobile-menu__lang-btn--active {
	background: var(--azul);
	color: #fff;
	border-color: var(--azul);
	font-weight: 600;
}

/* ═══ RESPONSIVE ═══ */

/* Narrow desktop (<=1100px) — ocultar texto valora, mostrar solo icono */
@media (max-width: 1100px) {
	.scl-nav__link {
		padding: 8px 10px;
		font-size: 13px;
	}

	.scl-cta-val {
		display: none;
	}

	.scl-cta-val-mobile {
		display: flex;
	}
}

/* Tablet (<=900px) */
@media (max-width: 900px) {
	.scl-mainbar {
		height: 60px;
	}

	.scl-mainbar__inner {
		max-width: var(--max-width);
		padding: 0 24px;
	}

	.scl-nav {
		display: none;
	}

	.scl-hamburger {
		display: flex;
	}

	.scl-cta-val {
		display: none;
	}

	.scl-cta-val-mobile {
		display: flex;
	}

	/* Lang goes to mobile menu */
	.scl-lang {
		display: none;
	}

	.scl-lang.scl-lang--mobile {
		display: inline-flex;
	}

	.scl-logo img {
		max-height: 40px;
	}

	.scl-actions {
		gap: 4px;
		padding: 4px;
	}

	/* Ocultar herramientas del menú hamburguesa (ya hay dropdown) */
	.scl-mobile-menu__tools-title,
	.scl-mobile-menu__list--tools {
		display: none;
	}
}

/* Mobile (<=600px) */
@media (max-width: 600px) {
	.scl-mainbar__inner {
		padding: 0 12px;
	}

	.scl-logo img {
		max-height: 36px;
	}

	.scl-actions {
		gap: 4px;
		padding: 4px;
	}

	.scl-actions__btn {
		width: 38px;
		height: 38px;
	}

	/* Estrella más grande para igualar proporción */
	.scl-cta-val-mobile svg {
		width: 19px;
		height: 19px;
	}

	.scl-tools__dropdown::before {
		right: auto;
		left: var(--arrow-left, 14px);
	}
}

/* ═══ VALORACION DROPDOWN ═══ */
.scl-val {
	position: relative;
}

.scl-val__btn[aria-expanded="true"],
.scl-val__btn-mobile[aria-expanded="true"] {
	background: var(--azul);
	color: #fff;
	border-color: var(--azul);
}

.scl-val__btn[aria-expanded="true"] svg {
	stroke: #fff;
	fill: rgba(255,255,255,0.2);
}

.scl-val__dropdown {
	position: fixed;
	width: 320px;
	max-width: calc(100vw - 24px);
	background: var(--blanco);
	border-radius: 14px;
	box-shadow:
		0 4px 6px -1px rgba(0, 0, 0, 0.07),
		0 12px 40px -4px rgba(0, 0, 0, 0.12);
	border: 1px solid rgba(0, 0, 0, 0.06);
	padding: 6px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transform-origin: top right;
	transition:
		opacity 0.18s ease,
		visibility 0.18s,
		transform 0.22s cubic-bezier(0.2, 0, 0, 1);
	z-index: 10001;
}

.scl-val__dropdown::before {
	content: '';
	position: absolute;
	top: -5px;
	right: 14px;
	width: 10px;
	height: 10px;
	background: var(--blanco);
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	border-left: 1px solid rgba(0, 0, 0, 0.06);
	transform: rotate(45deg);
}

.scl-val__dropdown--open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

@media (max-width: 600px) {
	.scl-val__dropdown::before {
		right: auto;
		left: var(--arrow-left, 14px);
	}
}

/* ═══ TOOLS DROPDOWN ═══ */
.scl-tools {
	position: relative;
}

.scl-tools__btn svg {
	transition: transform 0.3s ease;
}

.scl-tools__btn[aria-expanded="true"] {
	background: var(--azul);
	color: #fff;
}

/* Dropdown panel */
.scl-tools__dropdown {
	position: fixed;
	width: 290px;
	background: var(--blanco);
	border-radius: 14px;
	box-shadow:
		0 4px 6px -1px rgba(0, 0, 0, 0.07),
		0 12px 40px -4px rgba(0, 0, 0, 0.12);
	border: 1px solid rgba(0, 0, 0, 0.06);
	padding: 6px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transform-origin: top right;
	transition:
		opacity 0.18s ease,
		visibility 0.18s,
		transform 0.22s cubic-bezier(0.2, 0, 0, 1);
	z-index: 10001;
}

/* Arrow pointing to button */
.scl-tools__dropdown::before {
	content: '';
	position: absolute;
	top: -5px;
	right: 14px;
	width: 10px;
	height: 10px;
	background: var(--blanco);
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	border-left: 1px solid rgba(0, 0, 0, 0.06);
	transform: rotate(45deg);
}

.scl-tools__dropdown--open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* Blur backdrop — sits BELOW header (z-index 9998 < header 9999) */
.scl-tools__blur {
	position: fixed;
	inset: 0;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	background: rgba(255, 255, 255, 0.1);
	z-index: 9998;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.25s, visibility 0.25s;
}

.scl-tools__blur--visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.scl-tools__header {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 1.4px;
	text-transform: uppercase;
	color: #b0b5bd;
	padding: 10px 14px 4px;
}

/* List */
.scl-tools__list {
	padding: 4px 0;
}

/* Each tool item */
.scl-tools__item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 12px;
	border-radius: 12px;
	text-decoration: none;
	color: var(--negro);
	transition: background 0.2s, transform 0.15s;
	z-index: 1;
}

.scl-tools__item:hover {
	transform: translateX(2px);
}

.scl-tools__item[data-color="blue"]:hover  { background: rgba(74, 143, 204, 0.07); }
.scl-tools__item[data-color="teal"]:hover  { background: rgba(20, 184, 166, 0.07); }
.scl-tools__item[data-color="amber"]:hover { background: rgba(217, 149, 51, 0.07); }
.scl-tools__item[data-color="coral"]:hover { background: rgba(225, 100, 100, 0.07); }

/* Icon containers — unified shape, unique color */
.scl-tools__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 11px;
	flex-shrink: 0;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
	position: relative;
	z-index: 2;
}

.scl-tools__item:hover .scl-tools__icon {
	transform: scale(1.08);
}

/* Chromatic spectrum — blue → teal → amber → coral */
.scl-tools__icon--blue {
	background: linear-gradient(135deg, rgba(74, 143, 204, 0.12), rgba(74, 143, 204, 0.20));
	color: #4a8fcc;
}
.scl-tools__item:hover .scl-tools__icon--blue {
	box-shadow: 0 0 0 3px rgba(74, 143, 204, 0.12);
}

.scl-tools__icon--teal {
	background: linear-gradient(135deg, rgba(20, 184, 166, 0.10), rgba(20, 184, 166, 0.18));
	color: #0d9488;
}
.scl-tools__item:hover .scl-tools__icon--teal {
	box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.scl-tools__icon--amber {
	background: linear-gradient(135deg, rgba(217, 149, 51, 0.10), rgba(217, 149, 51, 0.18));
	color: #b8860b;
}
.scl-tools__item:hover .scl-tools__icon--amber {
	box-shadow: 0 0 0 3px rgba(217, 149, 51, 0.12);
}

.scl-tools__icon--coral {
	background: linear-gradient(135deg, rgba(225, 100, 100, 0.10), rgba(225, 100, 100, 0.18));
	color: #dc4a4a;
}
.scl-tools__item:hover .scl-tools__icon--coral {
	box-shadow: 0 0 0 3px rgba(225, 100, 100, 0.12);
}

.scl-tools__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.scl-tools__label {
	font-size: 13.5px;
	font-weight: 600;
	color: #1a1a2e;
	line-height: 1.2;
}

.scl-tools__desc {
	font-size: 11.5px;
	color: #9ca3af;
	line-height: 1.3;
}

/* Mobile tools section (hidden on tablet+ since dropdown exists) */
.scl-mobile-menu__tools-title {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: #aaa;
	padding: 20px 20px 8px;
	border-top: 1px solid var(--borde);
	margin-top: 4px;
}

.scl-mobile-menu__list--tools .scl-mobile-menu__link {
	display: flex;
	align-items: center;
	gap: 10px;
}

.scl-mobile-menu__list--tools .scl-mobile-menu__link svg {
	color: var(--azul);
	flex-shrink: 0;
}
