/* =========================================
   VARIABLES Y TEMAS (Light/Dark Mode)
========================================= */
:root {
  --bg-main: #f7f6f2;
  --text-main: #111111;
  --text-inverse: #ffffff;
  --bg-card: #ffffff;
  --bg-modal: rgba(255, 255, 255, 0.98);
  --bg-btn: #e0e0e0;
  --line: rgba(0, 0, 0, 0.08);
  --muted: #888888;
  --font: 'Inter', -apple-system, sans-serif;
  --overlay: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.8) 100%);
  --glass: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] {
  --bg-main: #121212;
  --text-main: #f7f6f2;
  --text-inverse: #111111;
  --bg-card: #1e1e1e;
  --bg-modal: rgba(30, 30, 30, 0.98);
  --bg-btn: #333333;
  --line: rgba(255, 255, 255, 0.1);
  --muted: #aaaaaa;
  --overlay: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.1) 20%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.9) 100%);
  --glass: rgba(30, 30, 30, 0.95);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow: hidden; 
  height: 100vh;
  width: 100vw;
  transition: background-color 0.4s ease, color 0.4s ease;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }

/* =========================================
   OVERLAY DE TRANSICIÓN
========================================= */
.transition-overlay {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; visibility: hidden;
}
.transition-overlay svg { width: 100%; height: 100%; display: block; }
.transition-overlay path { fill: var(--bg-main); }

/* =========================================
   HEADER (Logo con Ícono)
========================================= */
.site-header {
  position: absolute; top: 0; left: 0; width: 100%; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 30px 40px; color: #ffffff; text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.header-left { display: flex; align-items: center; gap: 15px; }

/* LOGO ACTUALIZADO */
.logo { 
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 32px; 
  font-weight: 700; 
  letter-spacing: -0.04em; 
  line-height: 1; 
  color: #ffffff; 
  text-decoration: none;
}
.logo-icon {
  margin-bottom: 2px;
}

.tagline { font-size: 11px; font-weight: 500; line-height: 1.2; opacity: 0.9; margin-top: 2px; }
.header-right { display: flex; align-items: center; gap: 30px; }
.site-nav { display: flex; gap: 35px; }
.site-nav a { font-size: 13px; font-weight: 500; transition: opacity 0.2s; color: #ffffff; }
.site-nav a:hover { opacity: 0.6; }
.btn-search, .btn-theme { display: flex; align-items: center; justify-content: center; transition: opacity 0.2s; color: #ffffff; }
.btn-search:hover, .btn-theme:hover { opacity: 0.6; }
.btn-connect { background-color: #ffffff; color: #111111; padding: 12px 24px; font-size: 13px; font-weight: 600; border-radius: 4px; text-shadow: none; transition: background-color 0.2s; }
.btn-connect:hover { background-color: #e0e0e0; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* Menú Móvil */
.mobile-menu-btn { display: none; flex-direction: column; gap: 5px; z-index: 150; }
.mobile-menu-btn span { width: 24px; height: 2px; background-color: currentColor; transition: 0.3s; }
.mobile-nav { position: fixed; inset: 0; background: var(--bg-main); color: var(--text-main); z-index: 200; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 40px; opacity: 0; visibility: hidden; transition: 0.4s ease; text-shadow: none; }
.mobile-nav.is-open { opacity: 1; visibility: visible; }
.mobile-nav a { font-size: 24px; font-weight: 500; color: var(--text-main); }
.mobile-nav .mobile-connect { background: var(--bg-btn); padding: 12px 30px; border-radius: 4px; font-size: 16px; }
.close-mobile-nav { position: absolute; top: 30px; right: 30px; font-size: 40px; color: var(--text-main); }

/* =========================================
   VISTA 1: SLIDER
========================================= */
.hero-slider { position: relative; width: 100vw; height: 100vh; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 1s ease-in-out, visibility 1s ease-in-out; z-index: 1; }
.slide.active { opacity: 1; visibility: visible; z-index: 2; }
.slide-bg { width: 100%; height: 100%; object-fit: cover; }
.slide-overlay { position: absolute; inset: 0; background: var(--overlay); }
.slide-content { position: absolute; bottom: 60px; left: 40px; z-index: 5; max-width: 600px; color: #ffffff; }
.slide-content h1 { font-size: 48px; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 12px; line-height: 1.1; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.slide-content p { font-size: 16px; font-weight: 400; line-height: 1.4; margin-bottom: 24px; opacity: 0.9; }
.btn-view { font-size: 14px; font-weight: 600; border-bottom: 2px solid #ffffff; padding-bottom: 4px; text-shadow: none; }
.slider-controls { position: absolute; bottom: 60px; right: 40px; z-index: 5; display: flex; align-items: center; gap: 25px; color: #ffffff; }
.counter { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.9); }
.controls-icons { display: flex; align-items: center; gap: 15px; }
.icon-pause { display: flex; align-items: center; color: rgba(255, 255, 255, 0.9); margin-right: 5px; }
.icon-btn { display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.9); transition: transform 0.2s; }
.icon-btn:hover { transform: scale(1.1); }

/* =========================================
   VISTA 2: GALERÍA (POND GALLERY)
========================================= */
.gallery-view {
  position: fixed; inset: 0; background-color: var(--bg-main); color: var(--text-main);
  z-index: 150; display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transition: opacity 0.6s ease, visibility 0.6s ease;
}
.gallery-view.is-open { opacity: 1; visibility: visible; }

.gallery-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 30px 40px; border-bottom: 1px solid var(--line);
  z-index: 10; background-color: var(--bg-main);
}
.btn-close-gallery { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; color: var(--muted); }
#galleryTitle { font-size: 20px; font-weight: 500; }

.gallery-background {
  position: absolute; inset: 0; z-index: -1;
  background: 
    radial-gradient(circle at 50% 50%, var(--bg-main) 0%, var(--bg-btn) 100%),
    url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.05"/></svg>');
}

.gallery-grid-container {
  flex: 1; overflow-y: auto; padding: 40px;
  display: flex; justify-content: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 30px;
  width: 100%;
  max-width: 1400px; 
  align-content: start;
  margin: 0 auto;
}

.gallery-card {
  position: relative;
  width: 100%;
  background-color: var(--bg-card);
  border-radius: 0; 
  overflow: hidden; 
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  cursor: pointer;
  animation: floatCard 6s ease-in-out infinite;
  transform: translateZ(0); 
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
  animation-play-state: paused;
  transform: translateY(-4px);
  z-index: 10;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(0.5deg); }
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--bg-btn);
}

.card-image-wrapper img,
.card-image-wrapper .liquid-card-canvas {
  position: absolute !important; 
  top: 0 !important; left: 0 !important;
  width: 100% !important; height: 100% !important;
  object-fit: cover !important; 
}
.card-image-wrapper img { z-index: 1; }
.card-image-wrapper .liquid-card-canvas { z-index: 2; pointer-events: none; }

.card-footer {
  width: 100%;
  padding: 18px 15px;
  text-align: center;
  background-color: var(--bg-card);
  border-top: 1px solid var(--line);
  z-index: 3;
}

.card-footer .city-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-main);
  margin: 0;
}

/* =========================================
   VISTA 3: DETALLE (SPA)
========================================= */
.detail-view {
  position: fixed; inset: 0; background-color: var(--bg-main); color: var(--text-main);
  z-index: 160; overflow-y: auto; opacity: 0; visibility: hidden; transform: translateY(30px);
  transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s ease;
}
.detail-view.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.btn-close-detail {
  position: fixed; top: 30px; left: 40px; z-index: 170; background-color: var(--glass);
  backdrop-filter: blur(10px); padding: 12px 20px; border-radius: 30px; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.property-page { display: none; width: 100%; min-height: 100vh; padding-bottom: 100px; }
.property-page.is-active { display: block; }
.property-hero { width: 100%; height: 65vh; background: var(--bg-btn); }
.property-hero img { width: 100%; height: 100%; object-fit: cover; }

.property-container { max-width: 1100px; margin: 0 auto; padding: 80px 40px; }
.property-header { margin-bottom: 60px; }
.property-header h2 { font-size: 52px; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 16px; }
.property-header .location { font-size: 18px; color: var(--muted); }

/* VIDEO PREMIUM */
.property-video-section { width: 100%; margin-bottom: 60px; }
.video-wrapper { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; box-shadow: 0 15px 35px rgba(0,0,0,0.1); }
.video-wrapper video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-overlay-text { position: absolute; bottom: 20px; left: 20px; color: #fff; font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px); padding: 8px 14px; border-radius: 20px; pointer-events: none; }

/* SLIDER DE GALERÍA (Igual al Inicio) */
.property-gallery-slider {
  position: relative;
  width: 100%;
  margin-bottom: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-btn);
}

.gallery-track-wrapper {
  width: 100%;
  overflow: hidden;
}

.gallery-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.gallery-track img {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 16 / 9; 
  object-fit: cover;
  display: block;
}

.gallery-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 25px;
  z-index: 10;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.gallery-controls .counter {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.9);
}

.gallery-controls .controls-icons {
  display: flex;
  align-items: center;
  gap: 15px;
}

.gallery-controls .icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  transition: transform 0.2s;
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  backdrop-filter: blur(4px);
}

.gallery-controls .icon-btn:hover {
  transform: scale(1.1);
  background: rgba(0,0,0,0.5);
}

/* ESTILOS BASE */
.property-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 60px; margin-bottom: 60px; }
.property-desc h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 20px; }
.property-desc p { font-size: 16px; line-height: 1.7; color: var(--text-main); margin-bottom: 10px; }
.property-specs { border-top: 1px solid var(--line); }
.spec-row { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.spec-row span:first-child { font-weight: 500; color: var(--muted); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }

.property-map-section { width: 100%; height: 450px; margin-bottom: 80px; border-radius: 6px; overflow: hidden; background: var(--bg-btn); }
.property-map-section iframe { width: 100%; height: 100%; border: 0; filter: grayscale(100%) contrast(0.9); transition: filter 0.5s; }
.property-map-section:hover iframe { filter: grayscale(0%) contrast(1); }

.property-cta { text-align: center; padding: 60px 0; border-top: 1px solid var(--line); }
.property-cta h2 { font-size: 32px; font-weight: 500; margin-bottom: 30px; }
.btn-whatsapp { display: inline-flex; align-items: center; gap: 12px; background-color: var(--text-main); color: var(--bg-main); padding: 20px 40px; font-size: 15px; font-weight: 500; border-radius: 4px; transition: opacity 0.3s; }
.btn-whatsapp:hover { opacity: 0.8; }
.btn-back-to-top { position: fixed; bottom: 40px; right: 40px; width: 50px; height: 50px; background: var(--text-main); color: var(--bg-main); border-radius: 50%; font-size: 20px; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 120; opacity: 0; visibility: hidden; transition: all 0.3s; }
.btn-back-to-top.show { opacity: 1; visibility: visible; }

/* MODALES */
.search-modal, .floorplan-modal { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
.search-modal { background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(12px); align-items: flex-start; padding-top: 15vh; }
.search-modal.is-open { opacity: 1; visibility: visible; }
.search-panel { background: var(--bg-modal); color: var(--text-main); width: 100%; max-width: 800px; padding: 40px; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.2); transform: translateY(-20px); transition: transform 0.4s ease; }
.search-modal.is-open .search-panel { transform: translateY(0); }
.search-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.search-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.search-field label { display: block; font-size: 11px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.search-field select { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 4px; font-family: var(--font); font-size: 14px; background: var(--bg-main); color: var(--text-main); }
.btn-apply-filter { grid-column: 1 / -1; background: var(--text-main); color: var(--bg-main); padding: 16px; border-radius: 4px; font-size: 14px; font-weight: 500; margin-top: 10px; }

/* ANIMACIONES */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 1024px) {
  .header-right { display: none; }
  .mobile-menu-btn { display: flex; }
  .property-grid { gap: 40px; grid-template-columns: 1fr; }
}

@media (max-width: 850px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 768px) {
  .site-header { padding: 20px; }
  .logo { font-size: 26px; }
  .logo-icon { width: 26px; height: 26px; }
  .slide-content { left: 20px; bottom: 80px; right: 20px; }
  .slide-content h1 { font-size: 32px; }
  .btn-close-detail { top: 20px; left: 20px; }
  .property-container { padding: 40px 20px; }
  .property-hero { height: 40vh; }
  .property-header h2 { font-size: 36px; }
  .property-map-section { height: 300px; }
  
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
  .card-footer .city-label { font-size: 11px; }
}