/* =========================================================================
   ADELANTE — «Moderno Oscuro» en versión limpia e invertida (fondo blanco)
   Todo va colgado de body.adl para ganar a las reglas del plugin
   (.ip-style-moderno …) sin tocar sus archivos. Los valores salen de
   Apariencia → Personalizar → Diseño Adelante (variables --adl-*).
   ========================================================================= */

/* ------------------------------------------------------------------ 1. Base */
body.adl {
	--ip-bg: var(--adl-bg);
	--ip-bg-alt: var(--adl-bg);
	--ip-text: var(--adl-text);
	--ip-muted: var(--adl-muted);
	--ip-line: var(--adl-line);
	--ip-card: var(--adl-bg);
	--ip-shadow: none;
	--ip-primary: var(--adl-accent);
	--ip-primary-d: var(--adl-accent);
	/* Tonos derivados del violeta de la plantilla: a grises neutros. */
	--ip-primary-rgb: 17, 17, 17;
	--ip-secondary-rgb: 17, 17, 17;
	--ip-primary-l: #555555;
	--ip-primary-xl: #f2f2f2;
	--ip-secondary-l: #555555;
	--ip-secondary-xl: #f2f2f2;
	--ip-secondary: var(--adl-accent);
	--ip-radius: var(--adl-radius);
	--ip-font-head: var(--adl-font-head);
	--ip-font-body: var(--adl-font-body);
	background: var(--adl-bg) !important;
	color: var(--adl-text);
	font-family: var(--adl-font-body);
	font-size: var(--adl-fs-base);
	color-scheme: light;
}
body.adl .ip-h1,
body.adl .ip-h2,
body.adl h1, body.adl h2, body.adl h3, body.adl h4 { font-family: var(--adl-font-head); color: var(--adl-text); }
body.adl .ip-h2 { font-size: var(--adl-fs-h2); letter-spacing: -.01em; }
body.adl .ip-eyebrow { color: var(--adl-muted); }
body.adl .ip-sec-sub, body.adl p { color: inherit; }

/* Todo a lo ancho de la pantalla, con un margen lateral ajustable. */
body.adl .ip-wrap { max-width: none; padding-left: var(--adl-side); padding-right: var(--adl-side); }
body.adl .ip-section { padding: var(--adl-sec-pad) 0; background: var(--adl-bg); }

/* Botones: sólidos, sin degradados ni saltos. */
body.adl .ip-btn { border-radius: 100px; transform: none !important; }
body.adl .ip-btn--primary {
	background: var(--adl-accent); color: var(--adl-accent-txt); box-shadow: none; border: 1px solid var(--adl-accent);
}
body.adl .ip-btn--primary:hover { filter: none; opacity: .85; box-shadow: none; }
body.adl .ip-btn--ghost { color: var(--adl-text); background: transparent; border: 1px solid var(--adl-line); }
body.adl .ip-btn--ghost:hover { background: var(--adl-text); color: var(--adl-bg); border-color: var(--adl-text); }

/* Calculadora de hipoteca de la ficha: se apaga en Personalizar → Diseño Adelante → Ficha del inmueble. */
body.adl-sin-hipoteca .ip-hipoteca { display: none !important; }

/* Ítems de menú marcados como ocultos (clase CSS «adl-oculto» en Apariencia → Menús). */
body.adl .adl-oculto { display: none !important; }

/* ------------------------------------------------------------- 2. Cabecera */
/* Translúcida: el vídeo sube hasta arriba del todo. */
body.adl .ip-header {
	position: fixed; top: 0; left: 0; right: 0; z-index: 100;
	background: rgba(255, 255, 255, .88);
	backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
	border-bottom: 1px solid var(--adl-line);
	transition: transform .35s ease, background-color .3s ease, border-color .3s ease;
}
body.adl .ip-main { padding-top: var(--ip-header-h); }
body.adl.home .ip-main { padding-top: 0; }

/* Sobre el vídeo de la portada: cristal oscuro suave y textos blancos. */
body.adl .ip-header.is-overlay {
	background: rgba(0, 0, 0, var(--adl-hdr-alpha));
	border-bottom-color: rgba(255, 255, 255, .12);
}
body.adl .ip-header.is-overlay .ip-nav > ul a,
body.adl .ip-header.is-overlay .ip-nav .ip-btn--ghost { color: #fff; text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
body.adl .ip-header.is-overlay .ip-nav .ip-btn--ghost { border-color: rgba(255, 255, 255, .45); }
body.adl .ip-header.is-overlay .ip-nav .ip-btn--primary { background: #fff; color: #111; border-color: #fff; }
body.adl .ip-header.is-overlay .ip-burger span { background: #fff; }

/* Al bajar de la portada, pasa a blanco translúcido con textos negros. */
body.adl.ip-scrolled .ip-header.is-overlay {
	background: rgba(255, 255, 255, .88); border-bottom-color: var(--adl-line);
}
body.adl.ip-scrolled .ip-header.is-overlay .ip-nav > ul a,
body.adl.ip-scrolled .ip-header.is-overlay .ip-nav .ip-btn--ghost { color: var(--adl-text); text-shadow: none; }
body.adl.ip-scrolled .ip-header.is-overlay .ip-nav .ip-btn--ghost { border-color: var(--adl-line); }
body.adl.ip-scrolled .ip-header.is-overlay .ip-nav .ip-btn--primary { background: var(--adl-accent); color: var(--adl-accent-txt); border-color: var(--adl-accent); }
body.adl.ip-scrolled .ip-header.is-overlay .ip-burger span { background: var(--adl-text); }

/* Desaparece al bajar y vuelve con un ligero scroll hacia arriba (lo decide adelante.js). */
body.adl-hdr-hide .ip-header.adl-hdr-oculta { transform: translateY(-100%); }

body.adl .ip-nav > ul a { color: var(--adl-text); font-size: var(--adl-fs-menu); font-weight: 500; }
body.adl .ip-nav > ul a:hover,
body.adl .ip-nav > ul .current-menu-item > a { color: inherit; opacity: .7; }
body.adl .ip-nav > ul a::after { display: none; }
/* Hamburguesa y «cerrar»: color explícito (Safari del iPhone pinta los botones de azul). */
body.adl .ip-burger,
body.adl .ip-nav__close { color: var(--adl-text); -webkit-appearance: none; appearance: none; }
body.adl .ip-burger span { background: var(--adl-text); }
body.adl .ip-brand__logo { height: 34px; width: auto; max-width: 220px; filter: none !important; }

/* ------------------------------------------------------ 3. Portada (hero) */
body.adl .ip-hero { min-height: 100vh; min-height: 100svh; margin-top: 0; }
body.adl .ip-hero__media::after {
	background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .25) 50%, rgba(0, 0, 0, .45) 100%);
}
body.adl .ip-hero__overlay { display: none; }

/* Fuera el bloque de textos y botones de la izquierda; solo queda el titular. */
body.adl .ip-hero__eyebrow,
body.adl .ip-hero__sub,
body.adl .ip-hero__actions,
body.adl .ip-hero__meta { display: none !important; }

/* Titular y buscador, justo en el centro del vídeo. */
body.adl .ip-hero__in {
	width: 100%; min-height: 100vh; min-height: 100svh;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	padding: var(--ip-header-h) var(--adl-side) 40px; text-align: center;
}
body.adl .ip-hero__text { max-width: none; }
body.adl .ip-hero__title {
	font-family: var(--adl-font-head); font-size: var(--adl-fs-hero); line-height: 1.05;
	background: none; -webkit-background-clip: initial; background-clip: initial;
	color: #fff; max-width: none; margin: 0 0 32px; text-shadow: 0 2px 30px rgba(0, 0, 0, .25);
}
body.adl .ip-hero__search { margin: 0; width: 100%; max-width: 1180px; }

/* ---------------------------------------------------- 4. Buscador píldoras */
body.adl .ip-hero .ip-buscador {
	background: transparent; border: 0; box-shadow: none; padding: 0;
	backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.adl .ip-hero .ip-buscador__main {
	display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 10px;
}
/* Las etiquetas pasan dentro de las píldoras (se quedan para lectores de pantalla). */
body.adl .ip-hero .ip-field > label {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
/* Tipo de inmueble: oculto de momento. */
body.adl .ip-hero .ip-field:has(#ip-tipo) { display: none; }
body.adl .ip-hero .ip-field { flex: 0 1 210px; min-width: 0; position: relative; }
body.adl .ip-hero .ip-field--q { flex: 1 1 280px; }
body.adl .ip-hero .ip-field input,
body.adl .ip-hero .ip-field select {
	height: 54px; border-radius: 100px; padding: 0 22px;
	background: rgba(255, 255, 255, .96); border: 1px solid transparent; color: #111;
	font-size: 15px; box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
}
body.adl .ip-hero .ip-field__ico input { padding-left: 46px; }
body.adl .ip-hero .ip-field__ico svg { color: #111; left: 18px; }
body.adl .ip-hero .ip-field input::placeholder { color: #666; }
body.adl .ip-hero .ip-field select option { background: #fff; color: #111; }
body.adl .ip-hero .ip-buscador__submit {
	height: 54px; border-radius: 100px; padding: 0 28px;
	background: var(--adl-accent); color: var(--adl-accent-txt); box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
}
body.adl .ip-hero .ip-buscador__more {
	height: 54px; padding: 0 22px; white-space: nowrap; border-radius: 100px; color: #fff; border: 1px solid rgba(255, 255, 255, .6); background: rgba(0, 0, 0, .2);
}
/* «Más filtros» abre un panel blanco debajo. */
body.adl .ip-hero .ip-buscador__adv {
	margin-top: 12px; padding: 20px; border-radius: 22px; background: #fff; color: #111; text-align: left;
}
body.adl .ip-hero .ip-buscador__adv label,
body.adl .ip-hero .ip-buscador__adv .ip-field__legend { position: static !important; width: auto; height: auto; clip: auto; color: #666; }
body.adl .ip-hero .ip-buscador__adv input,
body.adl .ip-hero .ip-buscador__adv select { background: #f4f4f4; box-shadow: none; }
body.adl .ip-chip span { color: #111; border-color: var(--adl-line); }

/* Buscador del listado y de otras páginas: claro. */
body.adl .ip-buscador:not(.ip-buscador--hero) { background: var(--adl-bg); border: 1px solid var(--adl-line); box-shadow: none; backdrop-filter: none; }
body.adl .ip-field input, body.adl .ip-field select { background: #fff; color: var(--adl-text); border-color: var(--adl-line); }
body.adl .ip-field select option { background: #fff; color: #111; }
body.adl .ip-field label, body.adl .ip-field__legend { color: var(--adl-muted); }
body.adl .ip-buscador__submit { background: var(--adl-accent); color: var(--adl-accent-txt); }
body.adl .ip-buscador__more { color: var(--adl-text); border-color: var(--adl-line); }

/* Accesos rápidos (Comprar / Alquilar / Valorar…): fuera. */
body.adl .ip-quick { display: none !important; }

/* ------------------------------------------ 5. Últimas propiedades destacadas */
body.adl .ip-section--destacados .ip-sec-head { display: block; text-align: center; }
body.adl .ip-section--destacados .ip-sec-head .ip-eyebrow,
body.adl .ip-section--destacados .ip-sec-head .ip-sec-sub,
body.adl .ip-section--destacados .ip-sec-head > .ip-btn { display: none; }
body.adl .ip-section--destacados .ip-h2 { margin: 0 auto 40px; }

body.adl .ip-results--grid { grid-template-columns: repeat(var(--adl-cols), minmax(0, 1fr)); gap: calc(var(--adl-gap) * 1.6) var(--adl-gap); }

/* ---------------------------------------------------------------- 6. Fichas */
body.adl .ip-card,
body.adl .ip-card:hover {
	background: transparent; border: 0; border-radius: 0; box-shadow: none; transform: none;
	backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.adl .ip-card__media { padding-top: 56.25%; border-radius: var(--adl-radius); background: #f1f1f1; }
body.adl .ip-card__media::after { display: none; }
body.adl .ip-card__media img,
body.adl .ip-card:hover .ip-card__media img { transform: none; transition: opacity .25s ease; }
body.adl .ip-card__price,
body.adl .ip-card__photos,
body.adl .ip-card__link { display: none !important; }
body.adl .ip-badge { background: rgba(255, 255, 255, .92); color: #111; border: 0; }
body.adl .ip-badge--op { background: #111; color: #fff; }

/* Texto centrado bajo la foto. */
body.adl .ip-card__body { padding: 16px 6px 0; text-align: center; }
body.adl .ip-card__loc { justify-content: center; color: var(--adl-muted); }
body.adl .ip-card__title { font-size: var(--adl-fs-card); font-weight: 500; }
body.adl .ip-card__title a { color: var(--adl-text); }
body.adl .ip-card__price2 {
	display: block; font-family: var(--adl-font-head); font-size: var(--adl-fs-price); font-weight: 600;
	color: var(--adl-text); margin: 6px 0 8px;
}
body.adl .ip-card__feats { justify-content: center; }
body.adl .ip-card__feats li { color: var(--adl-muted); }
body.adl .ip-card__foot { justify-content: center; border-top: 0; padding-top: 4px; }
body.adl .ip-card__ref { color: var(--adl-muted); }

/* Flechas para pasar las fotos (las crea adelante.js si hay más de una). */
body.adl .adl-flecha {
	position: absolute; top: 50%; z-index: 3; width: 38px; height: 38px; margin-top: -19px;
	border: 0; border-radius: 50%; cursor: pointer;
	background: rgba(255, 255, 255, .9); color: #111;
	display: flex; align-items: center; justify-content: center;
	opacity: 0; transition: opacity .2s ease;
}
body.adl .adl-flecha--prev { left: 10px; }
body.adl .adl-flecha--next { right: 10px; }
body.adl .ip-card__media:hover .adl-flecha,
body.adl .adl-flecha:focus-visible { opacity: 1; }
@media (hover: none) { body.adl .adl-flecha { opacity: 1; width: 32px; height: 32px; margin-top: -16px; } }
body.adl .adl-puntos { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 3; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
body.adl .adl-puntos i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
body.adl .adl-puntos i.is-on { background: #fff; }

/* ------------------------------------------------ 7. Resto de páginas en claro */
body.adl .ip-pagehero, body.adl .ip-pagehead { color: var(--adl-text); }
body.adl .ip-cta, body.adl .ip-stats, body.adl .ip-servicios { background: var(--adl-bg); border-color: var(--adl-line); }
body.adl .ip-cta__form, body.adl .ip-contacto__form, body.adl .ip-contactbox,
body.adl .ip-servicio, body.adl .ip-post, body.adl .ip-keyfact, body.adl .ip-hipoteca,
body.adl .ip-asidebox, body.adl .ip-infocard {
	background: var(--adl-bg); border: 1px solid var(--adl-line); border-radius: var(--adl-radius);
	backdrop-filter: none; box-shadow: none;
}
body.adl .ip-servicio:hover, body.adl .ip-post:hover, body.adl a.ip-infocard:hover { transform: none; box-shadow: none; }
body.adl .ip-form input, body.adl .ip-form textarea, body.adl .ip-form select { background: #fff; color: var(--adl-text); border-color: var(--adl-line); }
body.adl .ip-hipoteca__result { background: #f6f6f6; border-color: var(--adl-line); }
body.adl .ip-specs li { border-bottom-color: var(--adl-line); }
body.adl .ip-galeria__grid { border-radius: var(--adl-radius); }
body.adl .ip-galeria__item:hover img { transform: none; }
body.adl .ip-galeria__more { background: rgba(255, 255, 255, .92); color: #111; border: 0; }
body.adl .ip-stat strong { background: none; color: var(--adl-text); -webkit-background-clip: initial; background-clip: initial; }
body.adl .ip-pager__p, body.adl .ip-pager__nav { border-color: var(--adl-line); color: var(--adl-text); }

/* Pie claro. */
body.adl .ip-footer { background: var(--adl-footer-bg); color: var(--adl-muted); border-top: 1px solid var(--adl-line); }
body.adl .ip-footer h4, body.adl .ip-footer__name, body.adl .ip-footer a:hover { color: var(--adl-text); }
body.adl .ip-footer__social a { border-bottom-color: var(--adl-line); }
body.adl .ip-footer__bottom { border-top-color: var(--adl-line); }
body.adl .ip-footer__logo { filter: none !important; }

/* ---------------------------------------------------------- 8. Tamaños medios */
@media (max-width: 1200px) {
	body.adl .ip-results--grid { grid-template-columns: repeat(min(var(--adl-cols), 3), minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	body.adl .ip-results--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	body.adl .ip-hero__title { font-size: calc(var(--adl-fs-hero) * .7); }
	/* Menú móvil desplegado: panel blanco con textos negros. */
	body.adl .ip-nav { background: #fff; }
	body.adl .ip-nav > ul a,
	body.adl .ip-header.is-overlay .ip-nav > ul a { color: #111; text-shadow: none; }
	body.adl .ip-header.is-overlay .ip-nav .ip-btn--ghost { color: #111; border-color: var(--adl-line); }
}
@media (max-width: 860px) {
	/* El plugin quita el hero a pantalla completa en móvil: aquí se mantiene. */
	body.adl .ip-hero { min-height: 100vh; min-height: 100svh; margin-top: 0; }
	body.adl .ip-hero__in { padding: calc(var(--ip-header-h) + 20px) 20px 40px; }
}
@media (max-width: 640px) {
	body.adl .ip-results--grid { grid-template-columns: 1fr; }
	body.adl .ip-wrap { padding-left: min(var(--adl-side), 20px); padding-right: min(var(--adl-side), 20px); }
	body.adl .ip-hero__title { font-size: calc(var(--adl-fs-hero) * .55); margin-bottom: 22px; }
	body.adl .ip-h2 { font-size: calc(var(--adl-fs-h2) * .72); }
	body.adl .ip-hero .ip-field,
	body.adl .ip-hero .ip-field--q { flex: 1 1 100%; }
	body.adl .ip-hero .ip-buscador__submit,
	body.adl .ip-hero .ip-buscador__more { flex: 1 1 calc(50% - 5px); justify-content: center; }
	body.adl .ip-section { padding: calc(var(--adl-sec-pad) * .6) 0; }
}
