/*
Theme Name: Novatropolis
Theme URI: https://novatropolis.es
Author: Novatropolis
Author URI: https://novatropolis.es
Description: Tema a medida para Novatropolis, asesores inmobiliarios en Málaga. Diseñado para funcionar con el plugin Viviendas.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: novatropolis
*/

:root {
  --navy: #0c2b5e;
  --navy-2: #0a2350;
  --orange: #ff5a1f;
  --orange-2: #e94c12;
  --ink: #14213d;
  --muted: #5b6475;
  --line: #e4e8ef;
  --soft: #f5f7fa;
  --wrap: 1104px;
  /* El plugin Viviendas toma estos colores */
  --viv-navy: var(--navy);
  --viv-orange: var(--orange);
  --viv-ink: var(--ink);
  --viv-muted: var(--muted);
  --viv-line: var(--line);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.5; color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: "Plus Jakarta Sans", Inter, sans-serif; line-height: 1.15; margin: 0; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; width: auto; height: auto; clip: auto; background: #fff; color: var(--navy); padding: 10px 16px; border-radius: 6px; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 600; font-size: 14px; border-radius: 7px; padding: 0 20px; height: 44px; border: 1.5px solid transparent; white-space: nowrap; cursor: pointer; transition: background .2s, color .2s, border-color .2s; font-family: inherit; }
.btn .ico { width: 18px; height: 18px; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-2); }
.btn-ghost { border-color: rgba(255, 255, 255, .85); color: #fff; background: rgba(10, 35, 80, .25); }
.btn-ghost:hover { background: #fff; color: var(--navy); }
.btn-outline { border-color: var(--orange); color: var(--orange); background: #fff; }
.btn-outline:hover { background: var(--orange); color: #fff; }
.btn-green { background: #25a244; color: #fff; }
.btn-green:hover { background: #1e8a39; }
.eyebrow { display: flex; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--orange); }

/* ---------- Cabecera ---------- */
.site-header { background: var(--navy); position: relative; z-index: 30; }
.site-header .wrap { display: flex; align-items: center; height: 72px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; flex: none; }
.logo svg { width: 44px; height: 40px; }
.logo img { max-height: 48px; width: auto; }
.logo-txt { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 21px; line-height: .98; letter-spacing: .2px; }
.main-nav { flex: 1; margin-left: 16px; }
.main-nav ul { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; }
.main-nav a { color: #fff; font-size: 13.5px; font-weight: 600; position: relative; padding: 6px 0; display: block; white-space: nowrap; }
.main-nav a:hover { color: #ffd3c2; }
.main-nav .current-menu-item > a::after, .main-nav .current_page_item > a::after, .main-nav .is-current > a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--orange); border-radius: 2px; }
.main-nav .sub-menu { display: none; }
.lang-switch { display: flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 700; letter-spacing: .5px; }
.lang-switch a { color: rgba(255, 255, 255, .7); padding: 4px 6px; border-radius: 4px; }
.lang-switch a + a::before { content: "·"; color: rgba(255, 255, 255, .45); margin: 0 6px 0 -4px; }
.lang-switch a:hover { color: #fff; }
.lang-switch a.is-current { color: #fff; }
/* Selector flotante de GTranslate: abajo a la izquierda, sin tapar la cabecera. */
.gtranslate_wrapper, [id^="gt-wrapper-"], #gt_float_wrapper { position: fixed !important; top: auto !important; bottom: 20px !important; left: 16px !important; right: auto !important; z-index: 35 !important; }
@media (max-width: 760px) { .gtranslate_wrapper, [id^="gt-wrapper-"], #gt_float_wrapper { bottom: 86px !important; } }
/* Selector flotante de TranslatePress: el tema ya trae el suyo. */
.trp-language-switcher.trp-floating-switcher, #trp-floater-ls { display: none !important; }
.header-search { color: #fff; display: grid; place-items: center; width: 36px; height: 36px; }
.menu-toggle { display: none; margin-left: auto; color: #fff; background: none; border: 0; padding: 6px; cursor: pointer; }
.menu-toggle .ico { width: 28px; height: 28px; }

/* ---------- Portada: hero ---------- */
.hero { position: relative; background: var(--navy); overflow: hidden; }
.hero-photo { position: absolute; top: 0; right: 0; bottom: 0; width: 72%; background-position: center 40%; background-size: cover; background-repeat: no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background:
  linear-gradient(90deg, var(--navy) 0%, var(--navy) 26%, rgba(12, 43, 94, .82) 38%, rgba(12, 43, 94, .35) 55%, rgba(12, 43, 94, 0) 70%),
  linear-gradient(180deg, rgba(12, 43, 94, .55) 0%, rgba(12, 43, 94, 0) 22%); }
.hero .wrap { position: relative; z-index: 2; padding-top: 42px; padding-bottom: 150px; }
.hero .eyebrow { color: #fff; }
.hero h1 { color: #fff; font-size: 58px; line-height: 1.02; font-weight: 800; letter-spacing: -1px; margin: 16px 0 14px; }
.hero h1 span { color: var(--orange); }
.hero p { color: #eef2f8; font-size: 19px; line-height: 1.38; max-width: 440px; }
.hero-btns { display: flex; gap: 16px; margin-top: 26px; }
.hero-btns .btn { height: 50px; font-size: 15px; padding: 0 22px; }
.home-search { position: relative; z-index: 4; margin-top: -118px; }

/* ---------- Ventajas ---------- */
.features { display: grid; grid-template-columns: 1fr 1.2fr 1fr 1fr; gap: 18px; padding: 34px 0 30px; }
.feat { display: flex; align-items: center; gap: 14px; }
.feat .ico { width: 46px; height: 46px; stroke-width: 1.5; color: var(--navy); }
.feat:first-child .ico { color: var(--orange); }
.feat b { display: block; font-size: 15px; font-weight: 700; }
.feat small { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
@media (min-width: 1081px) { .feat small { white-space: nowrap; } }

/* ---------- Cabeceras de sección ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.sec-head h2 { font-size: 35px; font-weight: 800; letter-spacing: -.6px; margin-top: 8px; color: var(--navy-2); }
.link-more { color: var(--orange); font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; white-space: nowrap; }
.link-more .ico { width: 17px; height: 17px; }
.link-more:hover { text-decoration: underline; }
.empty-note { padding: 34px; text-align: center; background: var(--soft); border-radius: 10px; color: var(--muted); }

/* ---------- Bloque "¿Quieres vender?" ---------- */
.cta { margin-top: 24px; border-radius: 12px; overflow: hidden; position: relative; background: var(--navy); min-height: 150px; display: flex; align-items: center; }
.cta-photo { position: absolute; left: 36%; top: 0; bottom: 0; width: 29%; background-position: 60% 30%; background-size: cover; }
.cta::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, var(--navy) 0%, var(--navy) 40%, rgba(12, 43, 94, .4) 44%, rgba(12, 43, 94, 0) 47%, rgba(12, 43, 94, 0) 57%, rgba(12, 43, 94, .8) 62%, var(--navy) 65%); }
.cta-in { position: relative; z-index: 2; display: flex; align-items: center; width: 100%; padding: 24px 36px 24px 44px; gap: 20px; }
.cta h2 { color: #fff; font-size: 28px; font-weight: 700; letter-spacing: -.3px; }
.cta p { color: #e8eef7; font-size: 15px; line-height: 1.4; margin: 8px 0 14px; max-width: 380px; }
.cta .btn { height: 42px; font-size: 15px; }
.cta-icons { margin-left: auto; display: flex; }
.ci { width: 102px; text-align: center; color: #fff; font-size: 12.5px; line-height: 1.35; padding: 0 8px; border-left: 1px solid rgba(255, 255, 255, .22); }
.ci:first-child { border-left: 0; }
.ci .ring { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); display: grid; place-items: center; margin: 0 auto 10px; background: rgba(255, 255, 255, .06); }
.ci .ico { width: 23px; height: 23px; }

/* ---------- Servicios ---------- */
.services { padding: 34px 0 40px; }
.services h2 { font-size: 30px; font-weight: 800; color: var(--navy-2); margin: 8px 0 22px; letter-spacing: -.4px; }
.srv { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.sv { display: flex; gap: 14px; align-items: flex-start; }
.sv .circ { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 1px solid #f3d2c5; background: #fff6f2; color: var(--orange); display: grid; place-items: center; }
.sv b { display: block; font-size: 14.5px; font-weight: 700; }
.sv small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 3px; }

/* ---------- Banner "Por qué elegir" (ficha) ---------- */
.why { position: relative; border-radius: 12px; overflow: hidden; background: var(--navy); color: #fff; padding: 30px 36px; margin: 20px 0 60px; }
.why-photo { position: absolute; top: 0; right: 0; bottom: 0; width: 45%; background-size: cover; background-position: center; }
.why::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, var(--navy) 0%, var(--navy) 55%, rgba(12, 43, 94, .4) 75%, rgba(12, 43, 94, .15) 100%); }
.why > * { position: relative; z-index: 2; }
.why h2 { font-size: 26px; font-weight: 700; margin-bottom: 20px; }
.why-items { display: flex; flex-wrap: wrap; }
.why-items .ci { width: 150px; }

/* ---------- Migas y páginas internas ---------- */
.page-top { padding: 22px 0 6px; }
.breadcrumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs a:hover { color: var(--orange); }
.breadcrumbs span[aria-current] { color: var(--ink); }
.page-title { font-size: 34px; font-weight: 800; color: var(--navy-2); margin: 10px 0 18px; letter-spacing: -.5px; }

/* ---------- Listado de inmuebles ---------- */
.listing-search { margin-bottom: 26px; }
.listing-search .viv-search-box { box-shadow: 0 6px 20px rgba(12, 35, 80, .08); border: 1px solid var(--line); }
.listing { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 60px; }
.listing-side details { border: 0; }
.listing-side summary { display: none; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.results-count { font-weight: 600; white-space: nowrap; }
.results-head .viv-order label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.results { display: grid; gap: 18px; }
.pagination { margin-top: 30px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; font-size: 14px; }
.pagination .page-numbers.current { background: var(--orange); border-color: var(--orange); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--orange); color: var(--orange); }

/* ---------- Ficha de inmueble ---------- */
.single-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 34px; align-items: start; padding-top: 6px; }
.prop-head h1 { font-size: 26px; font-weight: 700; font-family: Inter, sans-serif; }
.prop-price { font-size: 32px; font-weight: 800; margin: 6px 0 12px; }
.prop-head .viv-specs { font-size: 15px; }
.prop-head .viv-loc { margin-top: 10px; }
.sold-note { margin: 18px 0 4px; padding: 14px 16px; border-radius: 10px; background: #f3f4f6; border-left: 4px solid #6b7280; font-size: 14px; color: #374151; }
.sold-note strong { display: block; font-size: 15px; color: #111827; margin-bottom: 4px; }
.prop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 14px; }
.prop-actions .btn { height: 48px; font-size: 15px; }
.agent { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-bottom: 22px; }
.agent .btn-green { width: 120px; height: 48px; }
.agent .btn-green svg { width: 24px; height: 24px; fill: currentColor; }
.agent-info { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.agent-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-family: "Plus Jakarta Sans", sans-serif; flex: none; }
.agent-info b { display: block; color: var(--ink); font-size: 14px; }
.side-box { border: 1px solid var(--line); border-radius: 10px; padding: 20px; background: #fff; }
.single-side { position: sticky; top: 20px; }
.prop-section { margin-top: 30px; }
.prop-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.prop-tabs a { padding: 10px 0; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.prop-tabs a:first-child, .prop-tabs a:hover { color: var(--ink); border-bottom-color: var(--orange); }
.prop-section h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; color: var(--navy-2); }
.entry-content { color: #3a4356; line-height: 1.7; }
.entry-content p + p { margin-top: 1em; }
.features-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.features-table th, .features-table td { padding: 11px 0; border-bottom: 1px solid var(--line); text-align: left; }
.features-table th { color: var(--muted); font-weight: 500; width: 45%; }
.related { padding: 30px 0 60px; }

/* ---------- Blog / páginas genéricas ---------- */
.content-area { padding: 30px 0 60px; }
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.post-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.post-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; display: block; }
.post-card-body { padding: 18px; }
.post-card h2 { font-size: 19px; margin-bottom: 8px; }
.post-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.single-content { max-width: 760px; }
.single-content h1 { font-size: 36px; margin-bottom: 12px; color: var(--navy-2); }
.single-content .entry-content h2 { font-size: 24px; margin: 1.4em 0 .5em; }
.single-content .entry-content a { color: var(--orange); text-decoration: underline; }
.error-404 { text-align: center; padding: 80px 0; }
.error-404 h1 { font-size: 80px; color: var(--orange); }

/* ---------- Pie ---------- */
.site-footer { background: var(--navy-2); color: #c9d3e3; padding: 44px 0 22px; font-size: 14px; }
.f-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 8px 0; }
.site-footer a:hover { color: #fff; }
.site-footer p { line-height: 1.6; margin-top: 14px; max-width: 290px; }
.f-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 34px; padding-top: 18px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.f-bottom ul { display: flex; gap: 14px; }
.f-bottom li { margin: 0; }

/* Barra fija de contacto (móvil) */
.mbar { display: none; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1200px) {
  .site-header .wrap { gap: 16px; }
  .main-nav { margin-left: 6px; }
  .main-nav ul { gap: 18px; }
  .header-cta { padding: 0 14px; }
}

@media (max-width: 1080px) {
  .main-nav ul { gap: 14px; }
  .main-nav a { font-size: 13px; }
  .header-search { display: none; }
  .cta-icons { display: none; }
  .srv { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .feat small { white-space: normal; }
}

@media (max-width: 900px) {
  .listing { grid-template-columns: 1fr; }
  .listing-side summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; list-style: none; }
  .listing-side summary::-webkit-details-marker { display: none; }
  .listing-side details[open] summary { margin-bottom: 10px; }
  .single-grid { grid-template-columns: 1fr; }
  .single-side { position: static; }
  .single-grid { display: flex; flex-direction: column; gap: 0; }
  .single-main { display: contents; }
  .single-main > .viv-gallery { order: 1; }
  .single-side { order: 2; margin: 22px 0 6px; }
  .single-main > :not(.viv-gallery) { order: 3; }
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .main-nav, .header-search, .header-cta { display: none; }
  .menu-toggle { display: block; }
  .site-header .lang-switch { margin-left: auto; }
  .site-header .lang-switch ~ .menu-toggle { margin-left: 4px; }
  .site-header.is-open .main-nav { display: block; position: absolute; top: 100%; left: 0; right: 0; background: var(--navy); margin: 0; padding: 8px 24px 20px; box-shadow: 0 14px 24px rgba(0, 0, 0, .2); }
  .site-header.is-open .main-nav ul { flex-direction: column; gap: 0; }
  .site-header.is-open .main-nav a { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); font-size: 15px; }
  .site-header.is-open .main-nav .current-menu-item > a::after { display: none; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .site-header .wrap { height: 66px; }
  .logo svg { width: 40px; height: 36px; }
  .logo-txt { font-size: 19px; }
  .hero-photo { width: 100%; background-position: 68% 30%; }
  .hero::before { background: linear-gradient(180deg, rgba(12, 43, 94, .9) 0%, rgba(12, 43, 94, .7) 45%, rgba(12, 43, 94, .25) 75%, rgba(12, 43, 94, .1) 100%); }
  .hero .wrap { padding-top: 22px; padding-bottom: 120px; }
  .eyebrow { font-size: 10.5px; letter-spacing: 1.2px; }
  .hero h1 { font-size: 33px; margin: 10px 0; letter-spacing: -.5px; }
  .hero p { font-size: 14.5px; }
  .hero-btns { display: none; }
  .home-search { margin-top: -96px; }
  .home-search .wrap { padding: 0 14px; }
  .features { grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 18px 0 14px; border-bottom: 1px solid var(--line); }
  .feat { flex-direction: column; text-align: center; gap: 6px; }
  .feat .ico { width: 30px; height: 30px; }
  .feat b { font-size: 10.5px; font-weight: 600; line-height: 1.25; }
  .feat small { display: none; }
  .home-props { padding-top: 16px; }
  .sec-head { margin-bottom: 12px; align-items: center; }
  .home-props .sec-head h2 { display: none; }
  .sec-head h2 { font-size: 26px; }
  .sec-head .eyebrow { font-size: 10.5px; }
  .link-more { font-size: 12px; margin: 0; }
  .link-more .full { display: none; }
  .cta-photo { left: auto; right: 0; width: 55%; opacity: .55; }
  .cta::before { background: linear-gradient(90deg, var(--navy) 0%, var(--navy) 40%, rgba(12, 43, 94, .5) 100%); }
  .cta-in { padding: 24px; }
  .cta h2 { font-size: 22px; }
  .srv { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 26px; }
  .results-head { font-size: 14px; }
  .results-head .viv-order select { max-width: 170px; }
  .prop-price { font-size: 28px; }
  .posts { grid-template-columns: 1fr; }
  .f-grid { grid-template-columns: 1fr 1fr; }
  .f-grid > :first-child { grid-column: 1 / -1; }
  .why { padding: 24px; }
  .why-items .ci { width: 50%; border: 0; margin-bottom: 14px; }

  .mbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); background: #fff; z-index: 40; box-shadow: 0 -6px 18px rgba(12, 35, 80, .10); }
  .mbar a { height: 48px; border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #fff; font-weight: 600; font-size: 15.5px; }
  .mbar .wa { background: #25a244; }
  .mbar .call { background: var(--orange); }
  .mbar svg { width: 22px; height: 22px; }
  .mbar .ico { stroke: #fff; }
  .mbar .wa svg { fill: #fff; }
  body.has-mbar { padding-bottom: 80px; }
  /* La barra inferior ya trae WhatsApp: se oculta el botón flotante de Click to Chat. */
  body.has-mbar #ht-ctc-chat { display: none !important; }
}

/* Casilla de privacidad añadida a los formularios de WPForms. */
.nt-wpf-privacidad { margin: 4px 0 14px; font-size: 14px; line-height: 1.45; }
.nt-wpf-privacidad label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.nt-wpf-privacidad input { margin-top: 3px; flex: none; }
.nt-wpf-privacidad a { text-decoration: underline; }
