/* === Notaría 171 — shared styles ===================================== */
:root {
  --ink:       #0f2a33;          /* darkest text */
  --ink-2:     #213a42;          /* secondary  — 9.5:1 on white  */
  --ink-3:     #475c64;          /* tertiary   — 5.4:1 on white, 5.0:1 on cream */
  --line:      #e6e3dd;          /* hairlines */
  --line-2:    #efece6;
  --paper:     #ffffff;
  --paper-2:   #faf8f4;          /* warm white */
  --paper-3:   #f3efe7;          /* warmer panel */
  --brand:     #1d4e5f;          /* petrol — from logo */
  --brand-2:   #163e4c;          /* darker hover */
  --brand-soft:#e4ecef;          /* tint */
  --accent:    #b8965a;          /* warm brass accent */
  --whats:     #25d366;
  --radius:    4px;
  --maxw:      1320px;
  --pad-x:     clamp(20px, 4vw, 56px);
  --serif:     "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans:      "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display:   "Manrope", "Inter Tight", Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* === A11Y =============================================================
   Skip link, focus-visible, reduced-motion overrides */

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 999;
  background: var(--brand);
  color: white;
  padding: 12px 20px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border-radius: 0 0 2px 0;
  transition: top .15s;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  outline: 2px solid white;
  outline-offset: -4px;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 1px;
}
/* On dark backgrounds */
.footer :focus-visible,
.cta-banner :focus-visible,
.notary-band :focus-visible,
.lightbox :focus-visible {
  outline-color: var(--accent);
}
/* Disable the default browser outline only when we have focus-visible */
:focus:not(:focus-visible) { outline: none; }

main { scroll-margin-top: 80px; }

/* Discreet underline for abbreviations */
abbr[title] {
  text-decoration: underline dotted;
  text-decoration-color: rgba(255,255,255,.35);
  text-underline-offset: 4px;
  cursor: help;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .trust-row { animation: none !important; }
  .wa-fab::after { animation: none !important; }
}

/* === HEADER ============================================================ */
.nav-wrap {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.97);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px var(--pad-x);
  font-size: 12.5px;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-2);
  letter-spacing: .01em;
  background: var(--paper-2);
}
.nav-top .nt-left { display: flex; gap: 22px; align-items: center; }
.nav-top .nt-right { display: flex; gap: 22px; align-items: center; }
.nav-top a:hover { color: var(--brand); }
.nav-top .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--brand); display: inline-block; }
@media (max-width: 760px) { .nav-top { display: none; } }

/* Banner row — logo with full breathing room */
.nav-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px var(--pad-x);
  max-width: var(--maxw);
  margin: 0 auto;
  gap: 24px;
}

/* Marquee dentro del header */
.header-marquee {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.header-marquee .hm-track {
  display: inline-flex;
  gap: 44px;
  white-space: nowrap;
  animation: hm-scroll 60s linear infinite;
  padding-left: 44px;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.header-marquee .hm-track span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.header-marquee .hm-track span::before {
  content: "·";
  color: var(--brand);
  font-weight: 700;
  font-size: 22px;
  line-height: 0;
}
@keyframes hm-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (max-width: 1100px) {
  .header-marquee { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .header-marquee .hm-track { animation: none; }
}
.nav-brand { display: flex; align-items: center; flex-shrink: 0; }
.nav-brand .brand-logo {
  height: 124px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  .nav-brand .brand-logo { height: 108px; }
}
@media (max-width: 760px) {
  .nav-brand .brand-logo { height: 86px; }
}
@media (max-width: 540px) {
  .nav-brand .brand-logo { height: 72px; }
  .nav-banner { padding: 10px var(--pad-x); }
}
@media (max-width: 380px) {
  .nav-brand .brand-logo { height: 58px; }
  .nav-banner-cta .btn { padding: 9px 12px; font-size: 13px; }
}
.nav-banner-cta {
  display: flex; align-items: center; gap: 22px;
  flex-shrink: 0;
}
.nbc-meta {
  display: flex; flex-direction: column; align-items: flex-end;
  text-align: right;
  line-height: 1.15;
}
.nbc-label {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.nbc-phone {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  color: var(--brand);
  letter-spacing: -.01em;
  margin-top: 3px;
}
.nbc-phone:hover { color: var(--brand-2); }

@media (max-width: 860px) {
  .nbc-meta { display: none; }
}
@media (max-width: 540px) {
  .nav-banner { padding: 12px var(--pad-x); }
}

/* Nav links — second row */
.nav {
  border-top: 1px solid var(--line-2);
  background: white;
  padding: 0 var(--pad-x);
}
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  padding: 14px 14px;
  font-size: 13.5px;
  color: var(--ink-2);
  transition: color .15s;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}
.nav-links a:hover { color: var(--brand); }
.nav-links a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: .005em;
  border-radius: 2px;
  border: 1px solid var(--ink);
  background: transparent; color: var(--ink);
  cursor: pointer;
  transition: all .18s;
}
.btn:hover { background: var(--ink); color: white; }
.btn--brand { background: var(--brand); color: white; border-color: var(--brand); }
.btn--brand:hover { background: var(--brand-2); border-color: var(--brand-2); color: white; }
.btn--ghost { border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { background: var(--paper-3); color: var(--ink); }
.btn--lg { padding: 14px 22px; font-size: 15px; }

.btn--wa {
  background: #25d366;
  color: white;
  border-color: #25d366;
}
.btn--wa:hover { background: #1ea954; border-color: #1ea954; color: white; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: white;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -2px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.menu-btn { display: none; background: none; border: 0; cursor: pointer; padding: 6px; color: var(--ink); }
.menu-btn svg { width: 26px; height: 26px; }

@media (max-width: 1100px) {
  .nav { display: none; }
  .menu-btn { display: block; }
}

/* mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 100;
  background: var(--paper);
  display: flex; flex-direction: column;
  padding: 20px var(--pad-x);
  transform: translateX(100%);
  transition: transform .25s;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.drawer-close { background: none; border: 0; font-size: 22px; cursor: pointer; padding: 6px; }
.drawer-list { display: flex; flex-direction: column; padding: 24px 0; gap: 2px; }
.drawer-list a { padding: 14px 0; font-size: 18px; font-family: var(--display); color: var(--ink); border-bottom: 1px solid var(--line-2); }
.drawer-list a:hover { color: var(--brand); }

/* === FOOTER ============================================================ */
.footer {
  background: var(--ink);
  color: #b6c4c8;
  padding: 72px var(--pad-x) 28px;
  margin-top: 80px;
}
.footer-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 48px;
}
.footer h4 {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: white;
  margin: 0 0 18px;
  font-weight: 600;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.footer a { color: #b6c4c8; font-size: 14px; transition: color .15s; }
.footer a:hover { color: white; }
.footer .f-brand-title {
  font-family: var(--display);
  font-size: 22px;
  color: white;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 12px;
}
.footer-logo {
  max-width: 280px;
  width: 100%;
  height: auto;
  display: block;
  /* Logo is light-grey on transparent — let it sit on the dark footer
     in the same tone as the surrounding text + social icons.
     Slight opacity matches the text color exactly; hover lifts to white. */
  opacity: 0.85;
  transition: opacity .18s;
}
.footer-logo:hover { opacity: 1; }
.footer .f-brand-body { font-size: 14px; line-height: 1.7; max-width: 36ch; color: #9babb0; }

.social-row {
  margin-top: 26px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.social-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid #2a4a54;
  background: transparent;
  color: #b6c4c8;
  border-radius: 2px;
  transition: all .18s;
}
.social-icon svg { width: 18px; height: 18px; display: block; }
.social-icon:hover {
  color: var(--ink);
  background: white;
  border-color: white;
  transform: translateY(-2px);
}
.footer-bottom {
  max-width: var(--maxw);
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid #1f3d47;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: #7a8f95; gap: 16px; flex-wrap: wrap;
}
.footer-bottom .legal-links { display: inline-flex; gap: 10px; align-items: center; }
.footer-bottom .legal-links a {
  color: white;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,.3);
  transition: text-decoration-color .15s;
}
.footer-bottom .legal-links a:hover { text-decoration-color: white; }
.footer-bottom .sep { color: #4a6168; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px 32px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } .footer { padding-top: 56px; } }

/* === WHATSAPP FLOATING BUTTON ========================================= */
.wa-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  background: var(--whats);
  color: white;
  width: 54px; height: 54px;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 14px 28px rgba(37, 211, 102, .35), 0 4px 10px rgba(0,0,0,.15);
  transition: transform .2s;
  cursor: pointer;
}
.wa-fab:hover { transform: scale(1.06); }
.wa-fab svg { width: 27px; height: 27px; }
.wa-fab::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--whats);
  opacity: .35;
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { transform: scale(.85); opacity: .5; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}
.wa-label {
  position: absolute;
  right: 66px; top: 50%; transform: translateY(-50%);
  background: white;
  color: var(--ink);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 30px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0; transition: opacity .2s;
}
.wa-fab:hover .wa-label { opacity: 1; }

/* === BACK TO TOP ====================================================== */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 90px;          /* sits above the WhatsApp FAB */
  z-index: 79;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(15,42,51,.12), 0 2px 6px rgba(0,0,0,.06);
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, background .15s, color .15s, border-color .15s;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}
.back-to-top svg { width: 18px; height: 18px; display: block; }
.back-to-top:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
@media (max-width: 540px) {
  .back-to-top { right: 16px; bottom: 80px; width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: opacity .15s linear, visibility .15s linear; transform: none !important; }
}

/* === COMMON ============================================================ */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad-x); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; width: 28px; height: 1px; background: var(--brand);
}

h1, h2, h3 {
  font-family: var(--display);
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
  font-weight: 600;
}
p { text-wrap: pretty; }

.h-display {
  font-size: clamp(40px, 6.6vw, 84px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -.035em;
}
.h-section { font-size: clamp(28px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -.025em; }
.h-sub { font-size: clamp(20px, 2vw, 26px); line-height: 1.25; }

.lede {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 62ch;
}

/* placeholder page */
.placeholder-hero {
  padding: 100px var(--pad-x) 80px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.placeholder-hero .container { display: flex; flex-direction: column; gap: 18px; }
.placeholder-body {
  padding: 80px var(--pad-x);
}
.placeholder-body .container { display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; }
@media (max-width: 860px) { .placeholder-body .container { grid-template-columns: 1fr; } }
.coming-soon-card {
  border: 1px solid var(--line);
  padding: 32px;
  background: var(--paper-2);
}
.coming-soon-card .tag {
  display: inline-block;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  background: var(--brand-soft); color: var(--brand);
  padding: 4px 10px; border-radius: 2px; font-weight: 600; margin-bottom: 14px;
}


/* === Cookie banner & modal ============================================ */
.cookie-banner {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  max-width: 720px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 22px 50px rgba(15,42,51,.18), 0 4px 12px rgba(0,0,0,.08);
  border-radius: 4px;
  z-index: 250;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .3s ease, transform .3s ease;
}
.cookie-banner.show { opacity: 1; transform: translateY(0); }
.cookie-banner .cb-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 20px 24px;
}
.cookie-banner .cb-text strong {
  display: block;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.cookie-banner .cb-text p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.55;
  max-width: 56ch;
}
.cookie-banner .cb-text a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.cookie-banner .cb-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.cookie-banner .cb-actions .btn {
  padding: 9px 14px;
  font-size: 13px;
  white-space: nowrap;
}
.cookie-banner .cb-personalize {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-2);
}
.cookie-banner .cb-personalize:hover { background: var(--paper-2); color: var(--ink); }
.cookie-banner .cb-reject {
  background: var(--paper-2);
  border-color: var(--line);
  color: var(--ink);
}
.cookie-banner .cb-reject:hover { background: var(--paper-3); }

@media (max-width: 700px) {
  .cookie-banner .cb-inner { grid-template-columns: 1fr; gap: 14px; padding: 16px 18px; }
  .cookie-banner .cb-actions { justify-content: space-between; }
  .cookie-banner .cb-actions .btn { flex: 1; min-width: 90px; }
}

/* Modal */
.cookie-modal {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity .25s ease;
}
.cookie-modal.show { opacity: 1; }
.cookie-modal .cm-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,42,51,.55);
  backdrop-filter: blur(6px);
}
.cookie-modal .cm-panel {
  position: relative;
  background: white;
  width: min(560px, 92vw);
  max-height: 86vh;
  display: flex; flex-direction: column;
  border-radius: 4px;
  box-shadow: 0 40px 80px rgba(0,0,0,.35);
  overflow: hidden;
  transform: scale(.96);
  transition: transform .25s;
}
.cookie-modal.show .cm-panel { transform: scale(1); }
.cm-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.cm-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}
.cm-close {
  background: none; border: 0; cursor: pointer;
  font-size: 18px; color: var(--ink-3);
  padding: 8px;
  border-radius: 50%;
  transition: background .15s;
}
.cm-close:hover { background: var(--paper-2); color: var(--ink); }

.cm-body {
  padding: 22px 24px;
  overflow-y: auto;
  font-size: 14px;
  color: var(--ink-2);
}
.cm-body > p {
  margin: 0 0 22px;
  line-height: 1.6;
}

.cm-row {
  display: flex; gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  align-items: flex-start;
}
.cm-row:first-of-type { border-top: 0; padding-top: 0; }
.cm-row > div:first-child { flex: 1; }
.cm-row strong {
  display: block;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.cm-row p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.55;
}

.cm-toggle {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer;
}
.cm-toggle.disabled { cursor: not-allowed; opacity: .6; }
.cm-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.cm-track {
  width: 36px; height: 20px;
  background: var(--line);
  border-radius: 20px;
  position: relative;
  transition: background .2s;
}
.cm-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.cm-toggle input:checked + .cm-track {
  background: var(--brand);
}
.cm-toggle input:checked + .cm-track .cm-thumb {
  transform: translateX(16px);
}
.cm-label {
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--ink-3);
  text-transform: uppercase;
  font-weight: 600;
}

.cm-foot {
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
  flex-wrap: wrap;
}
.cm-save-reject {
  background: var(--paper-2);
  border-color: var(--line);
}
@media (max-width: 480px) {
  .cm-foot { flex-direction: column-reverse; }
  .cm-foot .btn { width: 100%; }
}
