/* =============================================
   Güenumil Inmobiliaria — main.css
   Sistema de diseño + estilos base del sitio público
   ============================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@400;500;600&display=swap');

/* --- Design Tokens --- */
:root {
  /* Colores */
  --c-navy: #0a1628;
  --c-gold: #C8963E;
  --c-navy-deep: #060e1a;
  --c-navy-mid: #0d1d35;
  --c-gold-light: #e8b96a;
  --c-gold-dim: #8a6420;
  --c-cream: #F9F7F4;
  --c-dark: #1A1A1A;
  --c-slate: #4A6572;
  --c-white: #FFFFFF;

  /* Tipografía */
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'DM Sans', sans-serif;

  /* Breakpoints (referencia, se usan en @media) */
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;

  /* Sombras */
  --shadow-card: 0 2px 12px rgba(27, 58, 75, 0.10), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 10px 32px rgba(27, 58, 75, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);

  /* Radios */
  --radius-card: 12px;
  --radius-pill: 50px;

  /* Transiciones */
  --t-base: 0.25s ease;
  --t-slow: 0.4s ease;
  --gpu: translateZ(0);
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-dark);
  background: var(--c-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--c-gold);
  text-decoration: none;
  transition: color var(--t-base);
}

a:hover {
  color: var(--c-navy);
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Tipografía --- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  color: var(--c-dark);
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

h2 {
  font-size: clamp(1.375rem, 3vw, 2rem);
}

h3 {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
}

h4 {
  font-size: 1.125rem;
}

p {
  margin-bottom: 1rem;
}

.text-serif {
  font-family: var(--font-serif);
}

.text-sans {
  font-family: var(--font-sans);
}

/* --- Inputs (CRÍTICO: nunca fondo oscuro) --- */
input,
select,
textarea {
  background: var(--c-white);
  border: 1px solid rgba(27, 58, 75, 0.15);
  border-radius: 8px;
  color: var(--c-dark);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  padding: 0.625rem 0.875rem;
  width: 100%;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px rgba(200, 150, 62, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: var(--c-slate);
  opacity: 0.6;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234A6572' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* --- Botones --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.625rem 1.5rem;
  border-radius: 8px;
  transition: all var(--t-base);
  cursor: pointer;
  border: none;
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #C8963E 0%, #e8b96a 50%, #C8963E 100%);
  background-size: 200% 100%;
  background-position: right center;
  color: #060e1a;
  font-family: var(--font-sans);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(200, 150, 62, 0.35);
  text-decoration: none;
  will-change: transform, box-shadow;
}

.btn-gold:hover {
  background-position: left center;
  box-shadow: 0 4px 20px rgba(200, 150, 62, 0.55);
  transform: translateY(-1px);
  color: #060e1a;
}

.btn-navy {
  background: var(--c-navy);
  color: var(--c-white);
}

.btn-navy:hover {
  background: #153242;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--c-navy);
  color: var(--c-navy);
}

.btn-outline:hover {
  background: var(--c-navy);
  color: var(--c-white);
}

.btn-pill {
  border-radius: var(--radius-pill);
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 1400px) {
  .container {
    max-width: 1380px;
  }
}

@media (min-width: 1700px) {
  .container {
    max-width: 1600px;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

/* --- Cards --- */
.card {
  background: var(--c-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow var(--t-base), transform var(--t-base);
  will-change: transform;
  backface-visibility: hidden;
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

/* --- Acento de sección (barra dorada) --- */
.sec-accent {
  width: 3px;
  height: 26px;
  background: var(--c-gold);
  border-radius: 2px;
}

.sec-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* --- Tags --- */
.tag {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--c-slate);
}

.tag-gold {
  color: var(--c-gold);
}

/* --- Glass effect (solo donde aplica: nav scrolled, contacto sticky) --- */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* --- Utilidades --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.text-slate {
  color: var(--c-slate);
}

.text-gold {
  color: var(--c-gold);
}

.text-navy {
  color: var(--c-navy);
}

.text-white {
  color: var(--c-white);
}

.text-small {
  font-size: 0.875rem;
}

.fw-500 {
  font-weight: 500;
}

.fw-600 {
  font-weight: 600;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.gap-3 {
  gap: 1.5rem;
}

.grid {
  display: grid;
}

.hidden {
  display: none !important;
}

/* --- Secciones (separación tonal, sin bordes) --- */
.section {
  padding: 3rem 0;
}

.section-alt {
  background: var(--c-white);
}

@media (min-width: 768px) {
  .section {
    padding: 4rem 0;
  }
}

@media (min-width: 1024px) {
  .section {
    padding: 5rem 0;
  }
}

/* --- NAV --- */
.nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, backdrop-filter 0.4s ease,
    border-color 0.4s ease, box-shadow 0.4s ease;
}

.nav.scrolled {
  position: fixed;
  background: rgba(6, 14, 26, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(200, 150, 62, 0.18);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.25);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.nav__logo-img {
  height: 52px;
  width: auto;
  display: block;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color var(--t-base);
}

.nav-link:hover {
  color: var(--c-gold);
}

.nav-link--active {
  color: var(--c-white);
}

.nav-link--cta {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

/* Hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--c-white);
  border-radius: 2px;
  transition: transform var(--t-base), opacity var(--t-base);
}

.nav__toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav */
@media (max-width: 767px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    background: var(--c-navy);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transform: translateX(100%) var(--gpu);
    transition: transform var(--t-slow);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
  }

  .nav__links.open {
    transform: translateX(0) var(--gpu);
  }

  .nav-link--cta {
    margin-top: 1rem;
    width: 100%;
    text-align: center;
  }
}

/* Nav sólido (páginas internas) */
.nav--solid {
  position: fixed;
  background: rgba(6, 14, 26, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(200, 150, 62, 0.18);
}

.nav--solid.scrolled {
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.25);
}

/* --- PAGE HEADER (páginas internas con nav fijo) --- */
.page-header {
  padding-top: calc(72px + 2.5rem);
  padding-bottom: 2rem;
  background: var(--c-navy);
  color: var(--c-white);
}

.page-header h1 {
  color: var(--c-white);
}

.page-header__sub {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.0625rem;
  margin-top: 0.375rem;
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .page-header {
    padding-top: calc(64px + 1.5rem);
    padding-bottom: 1.5rem;
  }
}

/* --- FOOTER SOCIAL ICONS --- */
.footer__social {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--t-base), transform var(--t-base);
}

.footer__social a:hover {
  color: var(--c-gold);
  transform: translateY(-2px);
}

.footer__social svg,
.footer__social a svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px;
  max-height: 20px;
  display: block;
  flex-shrink: 0;
}

/* =============================================
   Fondo navy premium con textura dorada
   Aplicar a secciones oscuras para efecto de profundidad
   ============================================= */
.dark-textured-bg {
  position: relative;
  background: linear-gradient(160deg,
      #0d1f3c 0%,
      #060e1a 35%,
      #071224 65%,
      #0a1628 100%);
  overflow: hidden;
}

.dark-textured-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(200, 150, 62, 0.11) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 85% 80%, rgba(200, 150, 62, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(13, 31, 60, 0.6) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.dark-textured-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(200, 150, 62, 0.4) 30%,
      rgba(200, 150, 62, 0.6) 50%,
      rgba(200, 150, 62, 0.4) 70%,
      transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.dark-textured-bg>* {
  position: relative;
  z-index: 1;
}

/* --- FOOTER --- */
.footer {
  color: rgba(255, 255, 255, 0.7);
  padding-top: 3rem;
  margin-top: 0;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .footer__inner {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
  }
}

.footer__logo {
  height: 46px;
  width: auto;
  display: block;
  opacity: 0.85;
  margin-bottom: 0.75rem;
}

.footer__tagline {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0;
}

.footer__title {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--c-gold);
  margin-bottom: 1rem;
}

.footer__nav a,
.footer__contact a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  transition: color var(--t-base);
}

.footer__nav a:hover,
.footer__contact a:hover {
  color: var(--c-gold);
}

.footer__nav li,
.footer__contact li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer__contact svg {
  color: var(--c-gold);
  flex-shrink: 0;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 0;
}

.footer__bottom p {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  margin: 0;
}

/* === ANIMACIONES DE SCROLL === */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .reveal.is-hidden {
    opacity: 0;
    transform: translateY(-16px);
  }

  /* Stagger para grupos de elementos */
  .reveal-group .reveal:nth-child(1) { transition-delay: 0s; }
  .reveal-group .reveal:nth-child(2) { transition-delay: 0.08s; }
  .reveal-group .reveal:nth-child(3) { transition-delay: 0.16s; }
  .reveal-group .reveal:nth-child(4) { transition-delay: 0.24s; }
  .reveal-group .reveal:nth-child(5) { transition-delay: 0.32s; }
  .reveal-group .reveal:nth-child(6) { transition-delay: 0.40s; }
}
