/* ===========================
   GR Gestión Inmobiliaria
   Base styles, tokens, typography
   =========================== */

:root {
  --accent: #E63027;
  --accent-dark: #C8202A;
  --accent-light: #F2DDDB;
  --ink: #1A1A1A;
  --ink-2: #2A2A2A;
  --ink-3: #5C5C5C;
  --ink-4: #8A8884;
  --paper: #FAFAF8;
  --paper-2: #F4F2EE;
  --line: #E7E4DE;
  --line-2: #D9D6CF;
  --wa: #25D366;
  --wa-dark: #128C7E;
  --gold: #B8956A;

  --serif: "DM Serif Display", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", monospace;

  --shadow-sm: 0 2px 8px rgba(20, 18, 14, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 18, 14, 0.08);
  --shadow-lg: 0 24px 60px rgba(20, 18, 14, 0.12);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shell: 1320px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; font-family: var(--serif); font-weight: 400; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 720px) {
  .shell { padding: 0 20px; }
}

/* ============ Section primitives ============ */
.section { padding: 96px 0; }
@media (max-width: 720px) { .section { padding: 64px 0; } }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 56px;
}
.section-head.center {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.section-aside { max-width: 360px; color: var(--ink-3); font-size: 15px; }

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-eyebrow.on-dark { color: rgba(255,255,255,0.7); }
.section-eyebrow.on-red { color: rgba(255,255,255,0.85); }

.section-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-title.on-dark { color: white; }
.section-title.on-red { color: white; }
.section-title.small { font-size: clamp(24px, 2.6vw, 32px); margin-bottom: 32px; }

.lede {
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-3);
  max-width: 60ch;
  margin-top: 16px;
}
.lede.on-dark { color: rgba(255,255,255,0.78); }

/* ============ Buttons ============ */
.btn-primary, .btn-secondary, .btn-white, .btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  padding: 14px 22px;
  border-radius: 100px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: white;
}
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }
.btn-primary.full { width: 100%; justify-content: center; }

.btn-secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn-secondary:hover { border-color: var(--ink); }
.btn-secondary.sm { padding: 8px 14px; font-size: 13px; }
.btn-secondary.lg { padding: 14px 22px; width: 100%; justify-content: center; }

.btn-white {
  background: white;
  color: var(--ink);
}
.btn-white:hover { background: var(--ink); color: white; }

.btn-link {
  background: transparent;
  color: var(--ink);
  padding: 8px 0;
  border-bottom: 1px solid var(--line-2);
  border-radius: 0;
}
.btn-link:hover { border-color: var(--ink); }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  background: white;
  transition: all 0.2s;
}
.ghost-btn:hover { border-color: var(--ink); }

.ghost-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.ghost-link.on-red { color: white; }
.ghost-link:hover { color: var(--accent); }
.ghost-link.on-red:hover { color: rgba(255,255,255,0.7); }

/* ============ WhatsApp buttons ============
   White-background style so the official WhatsApp brand mark
   (green chat bubble) stays visible inside the button.
*/
.wa-btn, .wa-btn-sm, .wa-btn-tiny, .wa-btn-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: white;
  color: var(--wa-dark);
  font-weight: 600;
  border-radius: 100px;
  border: 1.5px solid var(--wa);
  transition: all 0.2s;
  white-space: nowrap;
}
.wa-btn { padding: 11px 18px; font-size: 14px; }
.wa-btn.sm { padding: 7px 14px; font-size: 13px; }
.wa-btn-sm { padding: 9px 16px; font-size: 13px; }
.wa-btn-sm.full {
  width: 100%; padding: 13px 16px;
  background: var(--wa);
  color: white;
  border-color: var(--wa);
}
.wa-btn-tiny {
  padding: 5px 10px;
  font-size: 11px;
  gap: 4px;
  background: var(--wa);
  color: white;
  border-color: var(--wa);
}
.wa-btn-lg {
  padding: 18px 24px;
  font-size: 14px;
  width: 100%;
  gap: 14px;
  justify-content: flex-start;
  text-align: left;
  background: white;
  color: var(--ink);
  border: 1.5px solid var(--wa);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.18);
}
.wa-btn-lg span { display: flex; flex-direction: column; line-height: 1.25; }
.wa-btn-lg strong { color: var(--wa-dark); font-weight: 700; }
.wa-btn-lg em { font-family: var(--sans); font-style: normal; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.wa-btn:hover, .wa-btn-sm:hover, .wa-btn-lg:hover {
  background: #ecfdf2;
  border-color: var(--wa-dark);
  color: var(--wa-dark);
  transform: translateY(-1px);
}
.wa-btn-lg:hover {
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.28);
}
.wa-btn-lg:hover strong { color: var(--wa-dark); }
.wa-btn-tiny:hover, .wa-btn-sm.full:hover {
  background: var(--wa-dark);
  border-color: var(--wa-dark);
  color: white;
  transform: translateY(-1px);
}

/* For WA buttons on dark/colored surfaces — auto-flip to solid green */
.publish-cta .wa-btn,
.services-section .wa-btn,
.listing-head .wa-btn,
.footer-col .wa-btn,
.site-footer .wa-btn,
.hero .wa-btn {
  background: var(--wa);
  color: white;
  border-color: var(--wa);
}

/* ============ Floating WhatsApp ============ */
.wa-float-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0;
}

.wa-float {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 60px;
  padding: 0;
  background: white;
  color: var(--wa-dark);
  border-radius: 100px;
  box-shadow:
    0 12px 32px rgba(20, 18, 14, 0.18),
    0 4px 10px rgba(20, 18, 14, 0.08),
    0 0 0 1px rgba(20, 18, 14, 0.06);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  max-width: 60px;
}

.wa-float-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.wa-float-icon svg,
.wa-float-icon img {
  display: block;
  width: 38px;
  height: 38px;
}

.wa-float-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  padding-right: 22px;
  padding-left: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease 0.05s;
  position: relative;
  z-index: 2;
  color: var(--ink);
}
.wa-float-label strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.wa-float-label em {
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
  margin-top: 2px;
}

.wa-float-pulse {
  position: absolute;
  inset: 4px;
  border-radius: 100px;
  background: var(--wa);
  z-index: 0;
  animation: waPulseRing 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  pointer-events: none;
  opacity: 0.6;
}
@keyframes waPulseRing {
  0%   { transform: scale(0.95); opacity: 0.5; }
  70%  { transform: scale(1.25); opacity: 0;   }
  100% { transform: scale(1.25); opacity: 0;   }
}

/* Expanded state — pill with label */
.wa-float-wrap.is-expanded .wa-float {
  max-width: 340px;
}
.wa-float-wrap.is-expanded .wa-float-label { opacity: 1; }

/* Hover expands too */
.wa-float:hover {
  max-width: 340px !important;
  box-shadow:
    0 16px 40px rgba(20, 18, 14, 0.22),
    0 6px 14px rgba(20, 18, 14, 0.1),
    0 0 0 1px rgba(20, 18, 14, 0.08);
  background: white;
}
.wa-float:hover .wa-float-label { opacity: 1; }

/* Close button */
.wa-float-close {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--paper);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s ease;
  cursor: pointer;
  z-index: 3;
}
.wa-float-wrap:hover .wa-float-close,
.wa-float-wrap.is-expanded .wa-float-close {
  opacity: 1;
  transform: scale(1);
}
.wa-float-close:hover { background: var(--accent); }

@media (max-width: 720px) {
  .wa-float-wrap { bottom: 16px; right: 16px; }
  .wa-float { height: 56px; max-width: 56px; }
  .wa-float-icon { width: 56px; height: 56px; }
  .wa-float-icon img, .wa-float-icon svg { width: 34px; height: 34px; }
  .wa-float-wrap.is-expanded .wa-float,
  .wa-float:hover { max-width: 280px !important; }
}

/* ============ Badges ============ */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
}
.badge-new { background: var(--accent); color: white; }
.badge-featured { background: var(--ink); color: white; }
.badge-operation { background: var(--accent-light); color: var(--accent-dark); }
.badge-type { background: var(--paper-2); color: var(--ink-2); }
