/* Capa visual transversal: conserva la identidad TPL y mejora consistencia, foco y respuesta móvil. */
:root {
  --tpl-navy: #072f4f;
  --tpl-blue: #075d91;
  --tpl-green: #1f8a63;
  --tpl-green-dark: #146348;
  --tpl-sand: #f6f3ec;
  --tpl-ink: #17212b;
  --tpl-muted: #5d6b78;
  --tpl-line: #dce4e9;
  --tpl-surface: #ffffff;
  --tpl-radius: 18px;
  --tpl-shadow: 0 18px 50px rgba(7, 47, 79, .10);
}

html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { color: var(--tpl-ink); background: #fbfcfd; text-rendering: optimizeLegibility; }
body, button, input, select, textarea { font-family: "Outfit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
img { max-width: 100%; height: auto; }
a, button { -webkit-tap-highlight-color: transparent; }
button, [role="button"], a { touch-action: manipulation; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid #f4b942 !important;
  outline-offset: 3px !important;
  border-radius: 8px;
}

.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 100000;
  padding: 11px 16px; border-radius: 10px; color: #fff; background: var(--tpl-navy);
  transform: translateY(-160%); transition: transform .18s ease; text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.navbar {
  background: rgba(255,255,255,.94) !important;
  border-bottom: 1px solid rgba(7,47,79,.10) !important;
  box-shadow: 0 8px 28px rgba(7,47,79,.06) !important;
  backdrop-filter: blur(14px);
}
.navbar .nav-links a { font-weight: 600; text-underline-offset: 5px; }
.navbar .nav-links a:hover { color: var(--tpl-green-dark); }
.nav-contact-btn, .btn-primary-submit, .btn-publish-primary, .btn-activate-project {
  border-radius: 12px !important; box-shadow: 0 8px 20px rgba(31,138,99,.17);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
:where(.nav-contact-btn, .btn-primary-submit, .btn-publish-primary, .btn-activate-project):hover {
  transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31,138,99,.25); filter: saturate(1.08);
}

:where(.card, .parcel-card, .house-card, .project-card, .buy-step, .tech-card, .mode-card) {
  border-color: var(--tpl-line) !important; border-radius: var(--tpl-radius) !important;
}
:where(.parcel-card, .house-card, .project-card, .buy-step, .tech-card, .mode-card) {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
:where(.parcel-card, .house-card, .project-card, .buy-step, .tech-card, .mode-card):hover {
  transform: translateY(-4px); box-shadow: var(--tpl-shadow); border-color: rgba(31,138,99,.35) !important;
}

main section { scroll-margin-top: 104px; }
.main-footer { border-top: 1px solid rgba(255,255,255,.14); }
.main-footer a { text-underline-offset: 4px; }

.tpl-status-toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 99999; max-width: min(390px, calc(100vw - 36px));
  padding: 13px 16px; border-radius: 12px; color: #fff; background: var(--tpl-navy);
  box-shadow: 0 16px 38px rgba(0,0,0,.22); opacity: 0; transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease; pointer-events: none;
}
.tpl-status-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  html { scroll-padding-top: 78px; }
  .navbar-inner { min-height: 68px; }
  .nav-toggle { min-width: 44px; min-height: 44px; display: inline-grid !important; place-items: center; }
  .nav-links { max-height: calc(100dvh - 82px); overflow-y: auto; }
  .nav-links a { display: block; min-height: 44px; padding: 12px 14px !important; }
  .nav-contact-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  :where(.container, .section-container) { width: min(100% - 28px, 1180px); }
}

@media (max-width: 560px) {
  :where(h1, .hero-title) { font-size: clamp(2rem, 10vw, 3.1rem) !important; line-height: 1.02 !important; }
  h2 { font-size: clamp(1.55rem, 7vw, 2.3rem) !important; }
  :where(button, .btn, .nav-contact-btn, .buy-btn) { min-height: 44px; }
  .main-footer .footer-inner { gap: 14px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .navbar, .main-footer, .nav-toggle, .skip-link, .tpl-status-toast { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Proyecto guardado: barra transversal y herramientas de decisión. */
.tpl-project-tray {
  position: fixed; left: 50%; bottom: 14px; z-index: 9800;
  width: min(920px, calc(100vw - 28px)); transform: translateX(-50%);
  color: #fff; background: rgba(7, 47, 79, .96); border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px; box-shadow: 0 20px 54px rgba(4, 29, 48, .30); backdrop-filter: blur(16px);
}
.tpl-project-tray.is-empty { width: min(620px, calc(100vw - 28px)); }
.tpl-project-tray.is-collapsed { width: auto; left: 18px; transform: none; border-radius: 999px; }
.tpl-project-tray.is-collapsed .tpl-project-tray-body { display: none; }
.tpl-project-tray-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 46px; padding: 7px 10px 7px 15px; }
.tpl-project-tray-title { display: inline-flex; align-items: center; gap: 9px; min-width: 0; font-size: .84rem; font-weight: 800; }
.tpl-project-tray-title i { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #f2be1a; box-shadow: 0 0 0 5px rgba(242,190,26,.13); }
.tpl-project-tray-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-project-tray-tools { display: flex; align-items: center; gap: 7px; }
.tpl-project-tray-tools button { min-height: 32px; border: 1px solid rgba(255,255,255,.17); border-radius: 9px; padding: 6px 9px; color: #fff; background: rgba(255,255,255,.08); cursor: pointer; font: inherit; font-size: .76rem; font-weight: 700; }
.tpl-project-tray-tools button:hover { background: rgba(255,255,255,.16); }
.tpl-project-tray-body { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 0 10px 10px 15px; }
.tpl-project-tray-items { display: flex; align-items: center; gap: 9px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.tpl-project-chip { display: grid; grid-template-columns: 34px minmax(0,1fr) 26px; align-items: center; gap: 8px; flex: 0 1 280px; min-width: 190px; padding: 6px; border-radius: 10px; background: rgba(255,255,255,.09); }
.tpl-project-chip img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: #dce4e9; }
.tpl-project-chip small, .tpl-project-chip strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-project-chip small { color: rgba(255,255,255,.64); font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; }
.tpl-project-chip strong { margin-top: 1px; font-size: .78rem; }
.tpl-project-chip button { width: 26px; height: 26px; border: 0; border-radius: 7px; color: #fff; background: transparent; cursor: pointer; }
.tpl-project-chip button:hover { background: rgba(255,255,255,.13); }
.tpl-project-empty { color: rgba(255,255,255,.76); font-size: .8rem; }
.tpl-project-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tpl-project-actions a, .tpl-project-actions button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; padding: 8px 12px; text-decoration: none; font-size: .77rem; font-weight: 800; cursor: pointer; }
.tpl-project-actions .secondary { border: 1px solid rgba(255,255,255,.18); color: #fff; background: rgba(255,255,255,.08); }
.tpl-project-actions .primary { border: 0; color: #10273b; background: #f2be1a; }

.tpl-card-tools { position: absolute; z-index: 8; top: 11px; right: 11px; display: flex; gap: 6px; }
.tpl-card-tools button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(7,47,79,.12); border-radius: 50%; color: var(--tpl-navy); background: rgba(255,255,255,.94); box-shadow: 0 6px 18px rgba(7,47,79,.12); cursor: pointer; font-size: 1rem; }
.tpl-card-tools button.is-active { color: #fff; background: var(--tpl-green); }
.tpl-card-tools button[data-tpl-favorite].is-active { background: #d64b5f; }
.parcel-card, .parcela-card { position: relative; }
.detail-header-layout, .detail-main-info { position: relative; }

.tpl-trust-strip { padding: 18px 0; border-block: 1px solid var(--tpl-line); background: #fff; }
.tpl-trust-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.tpl-trust-grid article { padding: 14px 16px; border-left: 3px solid var(--tpl-green); }
.tpl-trust-grid strong, .tpl-trust-grid span { display: block; }
.tpl-trust-grid strong { color: var(--tpl-navy); font-size: .92rem; }
.tpl-trust-grid span { margin-top: 4px; color: var(--tpl-muted); font-size: .8rem; line-height: 1.45; }
.tpl-faq-section { padding: clamp(54px,7vw,90px) 0; background: var(--tpl-sand); }
.tpl-faq-layout { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(0,1.3fr); gap: clamp(28px,6vw,76px); align-items: start; }
.tpl-faq-layout h2 { margin: 8px 0 12px; color: var(--tpl-navy); }
.tpl-faq-list { display: grid; gap: 10px; }
.tpl-faq-list details { border: 1px solid rgba(7,47,79,.12); border-radius: 14px; padding: 0 16px; background: #fff; }
.tpl-faq-list summary { padding: 16px 34px 16px 0; cursor: pointer; color: var(--tpl-navy); font-weight: 750; }
.tpl-faq-list p { margin: -3px 0 16px; color: var(--tpl-muted); line-height: 1.6; }

.tpl-compare-dialog { position: fixed; inset: 0; z-index: 12000; display: grid; place-items: center; padding: 20px; background: rgba(4,29,48,.72); }
.tpl-compare-panel { width: min(980px,100%); max-height: min(760px, calc(100dvh - 30px)); overflow: auto; border-radius: 20px; padding: 22px; color: var(--tpl-ink); background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.tpl-compare-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.tpl-compare-head h2 { margin: 0; font-size: 1.55rem !important; }
.tpl-compare-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #eef3f5; cursor: pointer; font-size: 1.25rem; }
.tpl-compare-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.tpl-compare-table th, .tpl-compare-table td { padding: 12px; border-bottom: 1px solid var(--tpl-line); text-align: left; vertical-align: top; }
.tpl-compare-table th { color: var(--tpl-navy); background: #f6f9fa; }
.tpl-compare-table img { width: 160px; height: 95px; border-radius: 12px; object-fit: cover; }
.tpl-compare-remove { border: 0; color: #a12b3d; background: transparent; cursor: pointer; font-weight: 700; }

body.tpl-has-project-tray { padding-bottom: 96px; }
body.tpl-has-project-tray :where(.agente-launcher, .agent-launcher, .tpl-agent-button) { bottom: 112px !important; }

@media (max-width: 720px) {
  .tpl-trust-grid, .tpl-faq-layout { grid-template-columns: 1fr; }
  .tpl-trust-grid { gap: 2px; }
  .tpl-project-tray { bottom: 8px; width: calc(100vw - 16px); border-radius: 14px; }
  .tpl-project-tray.is-collapsed { left: 8px; }
  .tpl-project-tray-head { min-height: 42px; padding-left: 12px; }
  .tpl-project-tray-tools [data-tpl-tool-label] { display: none; }
  .tpl-project-tray-body { grid-template-columns: 1fr; padding-left: 10px; }
  .tpl-project-tray-items { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; overflow: hidden; }
  .tpl-project-chip { grid-template-columns: minmax(0,1fr) 26px; min-width: 0; padding-left: 9px; }
  .tpl-project-chip img { display: none; }
  .tpl-project-actions { width: 100%; }
  .tpl-project-actions a, .tpl-project-actions button { flex: 1; }
  body.tpl-has-project-tray { padding-bottom: 154px; }
  body.tpl-has-project-tray :where(.agente-launcher, .agent-launcher, .tpl-agent-button) { bottom: 164px !important; }
}
