:root {
  --bg: #ffffff;
  --bg-soft: #f4f4f4;
  --panel: rgba(0, 0, 0, 0.04);
  --text: #1a1a1a;
  --text-soft: rgba(26, 26, 26, 0.72);
  --line: rgba(0, 0, 0, 0.12);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.10);
  --header: rgba(255, 255, 255, 0.94);
  --card: #ffffff;
  --overlay: rgba(15, 15, 15, 0.76);
  --accent: #a8a25f;
  --accent-strong: #8f8950;
  --btn-text: #ffffff;
}

body.dark {
  --bg: #000000;
  --bg-soft: #0e0e0e;
  --panel: rgba(255, 255, 255, 0.05);
  --text: #f3efdd;
  --text-soft: rgba(243, 239, 221, 0.76);
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --header: rgba(0, 0, 0, 0.94);
  --card: #121212;
  --overlay: rgba(0, 0, 0, 0.88);
  --accent: #a8a25f;
  --accent-strong: #c3bc76;
  --btn-text: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

img,
video {
  display: block;
  width: 100%;
}

.top-marquee {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1300;
  overflow: hidden;
  white-space: nowrap;
  background: var(--accent);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.marquee-track {
  display: inline-flex;
  gap: 3rem;
  min-width: max-content;
  padding: 0.9rem 0;
  animation: marquee 24s linear infinite;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.site-header {
  position: fixed;
  top: 48px;
  left: 0;
  width: 100%;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  background: var(--header);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 95px;
  height: 95px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  animation: floatLogo 4.5s ease-in-out infinite;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.brand-copy h1 {
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-copy p {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.main-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.main-nav a {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  transition: 0.25s ease;
}

.main-nav a:hover {
  background: var(--panel);
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-size: 1rem;
}

main {
  padding-top: 170px;
}

/* HERO CON IMAGEN */
.hero {
  padding: 2rem 1rem 2rem;
}

.hero-card-image {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  height: 520px;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #000;
}

.hero-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: clamp(1.2rem, 3vw, 2.5rem);
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.68) 0%,
    rgba(0, 0, 0, 0.32) 45%,
    rgba(0, 0, 0, 0.08) 100%
  );
  color: #fff;
}

.hero-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-image-overlay h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.05;
  margin-bottom: 0.7rem;
  max-width: 700px;
}

.hero-image-overlay p {
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 620px;
  color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.95rem 1.3rem;
  border-radius: 999px;
  font-weight: 700;
  transition: 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn:hover {
  transform: translateY(-2px);
}

.section-head {
  max-width: 1200px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}

.section-head h3 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 0.5rem;
}

.section-head p {
  color: var(--text-soft);
  line-height: 1.7;
  max-width: 780px;
}

.tasacion,
.properties,
.showcase-3d {
  padding: 2rem 0 3rem;
}

/* CARRUSEL 3D */
.carousel-3d-wrap {
  max-width: 1200px;
  margin: 0 auto;
  height: 460px;
  perspective: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 0 5rem;
}

.carousel-3d-scene {
  width: 320px;
  height: 200px;
  perspective: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-3d {
  position: relative;
  width: 320px;
  height: 200px;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-item-3d {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--card);
  backface-visibility: hidden;
}

.carousel-item-3d video,
.carousel-item-3d img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #111;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.20);
  transition: transform 0.2s ease;
}

body.dark .carousel-arrow {
  background: #f2f2f2;
  color: #111;
}

.carousel-arrow:hover {
  transform: translateY(-50%) scale(1.05);
}

.carousel-arrow-left {
  left: 1rem;
}

.carousel-arrow-right {
  right: 1rem;
}

/* TARJETAS */
.properties-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.4rem;
}

.property-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: 0.3s ease;
}

.property-card:hover {
  transform: translateY(-6px);
}

.property-media {
  position: relative;
  height: 230px;
  overflow: hidden;
  background: #000;
}

.property-media video,
.property-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.property-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
}

.property-body {
  padding: 1.25rem;
}

.property-body h3 {
  margin-bottom: 0.55rem;
}

.property-price {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: var(--accent-strong);
}

.property-description {
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 0.9rem;
}

.property-location {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.property-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.card-btn {
  flex: 1;
  min-width: 135px;
  text-align: center;
  padding: 0.9rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s ease;
  background: transparent;
  color: var(--text);
}

.card-btn:hover {
  transform: translateY(-2px);
}

.card-btn.primary {
  background: var(--accent);
  color: var(--btn-text);
}

/* FOOTER */
.site-footer {
  margin-top: 2rem;
  padding: 2rem 1rem;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.site-footer h4 {
  margin-bottom: 0.6rem;
}

.site-footer p {
  color: var(--text-soft);
  line-height: 1.7;
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

.modal.active {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(12px);
}

.modal-content {
  position: relative;
  width: min(1100px, calc(100% - 2rem));
  margin: 4rem auto;
  z-index: 2;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
}

.modal-info {
  padding: 0.5rem 0.5rem 1rem;
}

.modal-info h3 {
  font-size: 1.7rem;
  margin-bottom: 0.35rem;
}

.modal-info p {
  color: var(--text-soft);
}

.modal-slider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.slider-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.slider-stage {
  flex: 1;
  min-height: 560px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

.slider-stage img,
.slider-stage video {
  width: 100%;
  height: 560px;
  object-fit: cover;
}

.desktop-only {
  display: block;
}

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
  }

  .main-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .desktop-only {
    display: none;
  }

  .hero-card-image {
    height: 390px;
  }

  .hero-image-overlay {
    padding: 1.2rem;
  }

  .hero-image-overlay h2 {
    font-size: clamp(1.6rem, 6vw, 2.3rem);
  }

  .hero-image-overlay p {
    font-size: 0.98rem;
    max-width: 100%;
  }

  .modal-slider {
    flex-direction: column;
  }

  .slider-stage,
  .slider-stage img,
  .slider-stage video {
    min-height: 320px;
    height: 320px;
  }

  main {
    padding-top: 210px;
  }
}

@media (max-width: 640px) {
  .brand {
    width: 100%;
  }

  .brand-logo {
    width: 76px;
    height: 76px;
  }

  .hero {
    padding: 1.2rem 1rem 2rem;
  }

  .hero-card-image {
    height: 300px;
    border-radius: 22px;
  }

  .hero-image-overlay {
    padding: 1rem;
    justify-content: flex-end;
  }

  .hero-badge {
    font-size: 0.72rem;
    padding: 0.45rem 0.8rem;
    margin-bottom: 0.7rem;
  }

  .hero-image-overlay h2 {
    font-size: 1.45rem;
    margin-bottom: 0.45rem;
  }

  .hero-image-overlay p {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .hero-actions {
    gap: 0.7rem;
    margin-top: 1rem;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }

  .property-actions {
    flex-direction: column;
  }
}