:root {
  --bg-body: #f6fbff;
  --bg-card: #ffffff;
  --bg-muted: #f3f7fb;
  --text-main: #0c1826;
  --text-muted: #263444;
  --accent: #ff8b3d;
  --accent-strong: #ff5f52;
  --accent-alt: #1fb7a3;
  --border: rgba(16, 35, 52, 0.12);
  --shadow: 0 18px 48px rgba(12, 30, 50, 0.14);
  font-size: 16px;
}

html {
  scroll-behavior: smooth;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Sora", "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  color: var(--text-main);
  background: #f3f7fb;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.section {
  padding: clamp(3rem, 7vw, 5.5rem) 5vw;
  position: relative;
}

.section.showcase {
  padding-left: clamp(1.5rem, 3vw, 3rem);
  padding-right: clamp(1.5rem, 3vw, 3rem);
}

.section.territories {
  background: #f3f5f7;
}

.section::after {
  content: "";
  position: absolute;
  inset: 0 3vw auto 3vw;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(12, 30, 50, 0.12), transparent);
  opacity: 0.8;
}

.section-intro {
  max-width: 800px;
  margin-bottom: 2.5rem;
}

.about .section-intro {
  max-width: 960px;
}

.about .section-intro h2 {
  font-size: clamp(2.2rem, 4.2vw, 3rem);
  letter-spacing: -0.01em;
  line-height: 1.22;
}

.about .section-intro p {
  font-size: 1.06rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  max-width: 820px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

h1,
h2,
h3,
h4 {
  font-family: "Playfair Display", serif;
  margin: 0 0 0.8rem 0;
  color: var(--text-main);
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.3rem);
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(1.95rem, 3.2vw, 2.5rem);
}

h3 {
  font-size: 1.38rem;
}

p {
  margin: 0 0 1rem 0;
  color: var(--text-muted);
  font-size: 1.02rem;
  letter-spacing: 0.005em;
}

.hero {
  min-height: 75vh;
  padding: 2rem 5vw 3.5rem;
  background: url("../img/AGUANTAO/IMG-20251112-WA0029.jpg") center/cover;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -6%;
  background:
    radial-gradient(circle at 18% 22%, rgba(31, 183, 163, 0.35), transparent 40%),
    radial-gradient(circle at 82% 18%, rgba(255, 143, 79, 0.25), transparent 42%),
    linear-gradient(145deg, rgba(12, 22, 38, 0.6), rgba(6, 11, 20, 0.35));
  mix-blend-mode: screen;
  opacity: 0.5;
  animation: heroGlow 16s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroGlow {
  from { transform: translate3d(-2%, -1%, 0) rotate(0deg); }
  to   { transform: translate3d(2%, 2%, 0) rotate(3deg); }
}

.nav,
.hero-body {
  position: relative;
  z-index: 1;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  background: rgba(12, 22, 34, 0.55);
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  letter-spacing: 0.12em;
}

.logo-title {
  font-weight: 800;
}

.logo small {
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 1rem;
  align-items: center;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
}

.nav-links .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}


.hero h1,
.hero h2,
.hero h3,
.hero p {
  color: #fff;
}

.hero-content .intro {
  max-width: 720px;
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.85);
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}

.hero-chips span {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(17, 29, 48, 0.4);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.5rem 0 1.5rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.hero-stats div {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stats span {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
}

.hero-stats p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.testimonial {
  background: var(--bg-card);
  border: 1px solid rgba(12, 35, 52, 0.12);
  border-radius: 1.3rem;
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 4px 12px rgba(12, 30, 50, 0.08);
}

.testimonial--animated {
  animation: testimonialEntrance 0.6s ease-out forwards;
  opacity: 0;
}

/* Clases aplicadas por IntersectionObserver */
.in-view {
  opacity: 0;
  transform: translateY(12px);
  animation: gridItemFadeIn 0.6s ease-out forwards;
}

.in-view-testimonial {
  opacity: 0;
  transform: translateY(18px);
  animation: testimonialEntrance 0.6s ease-out forwards;
}

@keyframes testimonialEntrance {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.testimonial:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(12, 30, 50, 0.12);
  border-color: rgba(31, 183, 163, 0.3);
}

.testimonial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(12, 30, 50, 0.08);
}

.testimonial-rating {
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.testimonial-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.testimonial .quote {
  font-size: 1.1rem;
  color: #0b1d2f;
  margin-bottom: 1.2rem;
  font-weight: 700;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

.testimonial .author {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

.testimonial .author span {
  display: inline;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  margin-left: 0.3rem;
}

.map-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.3rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
  align-items: center;
}

.map-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.map-chips span {
  background: var(--bg-muted);
  border: 1px solid rgba(12, 35, 52, 0.12);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.map-embed {
  position: relative;
  border-radius: 1.1rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(75, 199, 193, 0.24), transparent 34%),
    radial-gradient(circle at 78% 15%, rgba(255, 143, 79, 0.18), transparent 32%),
    linear-gradient(145deg, #184d63, #1f6680 55%, #2c7b94);
  min-height: 320px;
  border: 1px solid var(--border);
  perspective: 900px;
  transform: rotateX(6deg) rotateZ(-1deg);
  box-shadow: 0 25px 55px rgba(6, 14, 28, 0.35);
}

.map-viewport {
  position: absolute;
  inset: 0;
  background-image: url("../img/map-base.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: none;
  transform: translateZ(0);
}

.pin {
  position: absolute;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(12, 30, 50, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pin:hover,
.pin:focus-visible {
  background: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 36px rgba(12, 30, 50, 0.35);
}

.pin-rilan { top: 52%; left: 74%; }
.pin-puyao { top: 44%; left: 64%; }
.pin-aguantao { top: 40%; left: 54%; }
.pin-quilquico { top: 50%; left: 58%; }
.pin-compu { top: 70%; left: 30%; }

.pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.6;
  animation: pulse 2s infinite;
  pointer-events: none;
}

.map-popup {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  background: var(--bg-card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: min(320px, 90vw);
  overflow: hidden;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: grid;
}

.map-popup.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.map-popup img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.map-popup figcaption {
  padding: 0.75rem 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.6; }
  60% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(0.8); opacity: 0; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 22, 0.7);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 20;
}

.modal-dialog {
  background: var(--bg-card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: 820px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  overflow: hidden;
}

.modal-dialog img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 320px;
}

.modal-body {
  padding: 1.4rem;
  display: grid;
  gap: 0.6rem;
  align-content: start;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  background: var(--bg-muted);
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.modal-backdrop[hidden] {
  display: none;
}
.gallery-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 22, 0.78);
  display: grid;
  place-items: center;
  padding: 1.2rem;
  z-index: 30;
}

.gallery-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  box-shadow: var(--shadow);
  width: min(1100px, 94vw);
  display: grid;
  gap: 0.9rem;
  position: relative;
  overflow: hidden;
}

.gallery-main {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--bg-muted);
}

.gallery-main img {
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
  display: block;
}

.gallery-info {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1rem 1.2rem;
  background: linear-gradient(180deg, rgba(6, 15, 25, 0) 0%, rgba(6, 15, 25, 0.75) 100%);
  color: #fff;
  display: grid;
  gap: 0.2rem;
}

.gallery-info .eyebrow {
  color: rgba(255, 255, 255, 0.85);
}

.gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  color: #fff;
}

.gallery-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  background: var(--bg-muted);
  cursor: pointer;
  z-index: 1;
}

.gallery-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.gallery-btn {
  border: 1px solid var(--border);
  background: var(--bg-muted);
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-main);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.gallery-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  padding-bottom: 0.2rem;
}

.gallery-thumbs button {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0;
  background: transparent;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}

.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumbs button.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 130, 46, 0.2);
}

.gallery-backdrop[hidden] {
  display: none;
}

.hero-aside .aside-card {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(16, 35, 52, 0.12);
  border-radius: 1.2rem;
  padding: 1.6rem;
  box-shadow: var(--shadow);
  color: var(--text-main);
}

.hero-aside ul {
  display: grid;
  gap: 0.45rem;
  color: var(--text-muted);
  padding-left: 0.2rem;
}

.btn-solid,
.btn-outline,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.9rem 1.55rem;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-solid {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1a0f03;
  box-shadow: var(--shadow);
}

.btn-solid:hover {
  transform: translateY(-2px);
}

.btn-outline {
  border-color: var(--border);
  color: var(--text-main);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.btn-ghost:hover {
  border-color: var(--accent);
}

.btn-solid.full {
  width: 100%;
  text-align: center;
}

.btn-solid:focus-visible,
.btn-outline:focus-visible,
.btn-ghost:focus-visible,
.carousel-btn:focus-visible,
.dot:focus-visible,
.cta-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.highlights,
.services-grid,
.gallery-grid,
.territory-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.highlights article,
.services-grid article {
  background: var(--bg-card);
  border-radius: 1.1rem;
  padding: 1.35rem;
  border: 1px solid rgba(12, 35, 52, 0.12);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.services-grid article h3,
.highlights article h3 {
  color: #0b1d2f;
}

.services-grid article::after {
  content: "";
  position: absolute;
  inset: auto -10% -18% auto;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 143, 79, 0.08), transparent 60%);
  transform: rotate(-8deg);
  pointer-events: none;
}

.portfolio-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  align-items: stretch;
}

.carousel-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86));
  border-radius: 1.4rem;
  border: 1px solid rgba(12, 31, 49, 0.08);
  box-shadow: 0 18px 48px rgba(4, 12, 22, 0.12);
  overflow: hidden;
  display: grid;
  gap: 1.1rem;
  padding: 1.5rem;
  width: min(1400px, 100%);
  max-width: none;
  margin: 0 auto;
}

.carousel-head h3 {
  margin-bottom: 0.4rem;
}

.carousel-head p {
  margin: 0 0 0.4rem 0;
}

.carousel-shell {
  position: relative;
  border-radius: 1.1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 35%), #0c1524;
  min-height: 340px;
  touch-action: pan-y;
}

.carousel-track {
  position: relative;
  isolation: isolate;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  transition: opacity 0.55s ease, transform 0.55s ease;
  pointer-events: none;
}

.slide.active {
  position: relative;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.16, 0.68, 0.38, 1);
}

.slide.prev,
.slide.next {
  opacity: 0.55;
  filter: saturate(0.98);
  pointer-events: none;
}

.slide.prev {
  transform: translateX(-68%) scale(0.92);
}

.slide.next {
  transform: translateX(68%) scale(0.92);
}

.slide.prev .slide-overlay,
.slide.next .slide-overlay {
  background: linear-gradient(180deg, rgba(12, 21, 36, 0.75), rgba(12, 21, 36, 0.55));
}

.slide img {
  width: 100%;
  height: clamp(260px, 44vw, 380px);
  object-fit: cover;
  filter: brightness(1.02) saturate(1.02);
}

.slide-overlay {
  position: absolute;
  inset: 0;
  padding: clamp(1.2rem, 3vw, 2rem);
  background: linear-gradient(185deg, rgba(9, 12, 19, 0.6), rgba(9, 12, 19, 0.18));
  display: grid;
  align-content: end;
  animation: fadeUp 0.6s ease;
  pointer-events: none;
}

.slide-overlay p {
  color: #dbe4f2;
}

.slide-overlay h3 {
  color: #ffffff;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.slide-overlay .eyebrow {
  color: #f5a533;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.carousel-controls {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.9rem;
  pointer-events: none;
  z-index: 2;
}

.carousel-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: linear-gradient(135deg, rgba(255, 161, 72, 0.95), rgba(255, 114, 50, 0.9));
  color: #1b0d02;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  pointer-events: auto;
}

.carousel-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28), 0 0 0 3px rgba(255, 148, 74, 0.18);
}

.carousel-dots {
  display: flex;
  gap: 0.55rem;
  position: absolute;
  left: 50%;
  bottom: 0.9rem;
  transform: translateX(-50%);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(12, 21, 36, 0.42);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dot.active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

.carousel-progress {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.6rem;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.carousel-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  transition: width 0.2s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.territory-stack {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.property-card {
  background: #ffffff;
  border: 1px solid rgba(12, 30, 50, 0.08);
  border-radius: 1rem;
  box-shadow: 0 14px 32px rgba(12, 30, 50, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 260px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 35%, #f9fbfd 100%);
}

.property-media {
  position: relative;
  height: 160px;
  background: #0c1524;
  overflow: hidden;
  padding: 0;
  border: none;
  cursor: pointer;
  display: block;
}

.property-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.property-card:hover .property-media img {
  transform: scale(1.04);
}

.status-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(33, 37, 41, 0.84);
  color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.property-body {
  padding: 0.9rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  align-content: start;
  background: #ffffff;
  border-top: 1px solid rgba(12, 30, 50, 0.05);
}

.property-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.pill {
  background: rgba(12, 31, 49, 0.08);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.04em;
  text-transform: none;
  border: 1px solid var(--border);
}

.pill.light {
  background: rgba(31, 183, 163, 0.12);
  color: var(--accent-alt);
}

.property-location {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: #2c7a59;
  margin: 0;
}

.property-location::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2c7a59;
}

.property-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.property-meta .label {
  margin: 0;
  font-size: 0.9rem;
  color: #526074;
}

.property-meta .value {
  margin: 0.12rem 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.property-brief {
  margin: 0;
  color: #4a5868;
  font-weight: 600;
  line-height: 1.5;
}

.property-meta,
.property-features,
.property-brief,
.property-list {
  display: none;
}

/* Asegurar que grids de propiedades y testimonios muestren elementos por defecto */
.properties-grid, .testimonial-grid, .modern-grid {
  display: grid !important;
}

.property-actions .btn-outline {
  background: #fff;
  border: 1px solid rgba(12, 30, 50, 0.1);
  color: #0c1826;
}

.property-actions .btn-solid {
  display: none;
}

.full-detail {
  padding: 2rem 5vw 3rem;
  background: #eef2f6;
}

.detail-card {
  max-width: 1100px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(12, 30, 50, 0.14);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  overflow: hidden;
}

.detail-info {
  padding: 1.8rem;
  display: grid;
  gap: 0.9rem;
}

.detail-status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: #18b9711a;
  color: #0b6c50;
  font-weight: 800;
}

.detail-location {
  margin: 0;
  font-weight: 700;
  color: #2c7a59;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
}

.detail-features {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.detail-features span {
  background: #f1f5f9;
  border: 1px solid rgba(12, 30, 50, 0.06);
  border-radius: 12px;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  color: #0f172a;
}

.detail-list {
  list-style: none;
  padding: 0;
  margin: 0.2rem 0 0;
  display: grid;
  gap: 0.35rem;
  color: #42526b;
  font-weight: 600;
}

.detail-list li::before {
  content: "•";
  margin-right: 0.4rem;
  color: #2c7a59;
}

.detail-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.detail-actions .btn-outline {
  background: #fff;
  border: 1px solid rgba(12, 30, 50, 0.12);
  color: #0c1826;
}

.detail-media {
  position: relative;
  background: #0c1524;
  display: grid;
  gap: 0.75rem;
  align-content: start;
  min-height: 520px;
}

.detail-media img[data-detail-hero] {
  width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: contain;
  display: block;
  background: #0c1524;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  object-position: center;
  padding: 12px;
}

.detail-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}

.detail-thumbs img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

@media (max-width: 720px) {
  .detail-card {
    grid-template-columns: 1fr;
  }
}

.property-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.24rem;
}

.property-list li {
  list-style: none;
  position: relative;
  padding-left: 0.9rem;
  color: #425568;
  line-height: 1.3;
  font-size: 0.9rem;
}

.property-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.property-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
  margin-top: auto;
}

.property-features {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.9rem;
  background: #f6f8fb;
  border-radius: 0.8rem;
  border: 1px solid rgba(12, 30, 50, 0.06);
}

.property-features span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: #0f172a;
}

.property-features span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2c7a59;
}

.contact-card {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 1.8rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: stretch;
}

@media (max-width: 768px) {
  .contact-card {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.contact-card > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-details p {
  margin-bottom: 0.4rem;
  color: var(--text-main);
  font-size: 0.95rem;
}

.contact-details a {
  color: var(--accent);
  font-weight: 700;
  transition: all 0.3s ease;
}

.contact-details a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.social-panel {
  margin-top: 1.5rem;
}

.social-panel .label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
}

.social-icons {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.social-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: var(--bg-muted);
  cursor: pointer;
}

.social-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--text-main);
  transition: fill 0.3s ease;
}

.social-icon:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-6px) scale(1.1);
  box-shadow: 0 12px 28px rgba(31, 183, 163, 0.3);
}

.social-icon:hover svg {
  fill: #fff;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.contact-form label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-form label span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  border: 1.5px solid var(--border);
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-muted);
  color: var(--text-main);
  transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(31, 183, 163, 0.08);
  transform: translateY(-2px);
}

.contact-form textarea {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
}

.contact-form .full {
  grid-column: 1 / -1;
}

.contact-form button {
  padding: 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 0.8rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: linear-gradient(135deg, var(--accent-alt), #28c5b8);
  color: #fff;
  box-shadow: 0 8px 24px rgba(31, 183, 163, 0.25);
}

.contact-form button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(31, 183, 163, 0.35);
}

.contact-form button:active {
  transform: translateY(-1px);
}

footer.footer {
  background: linear-gradient(135deg, #0f1f32, #132c42);
  color: #ffffff;
  padding: 2rem 5vw;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer p,
.footer a {
  color: #ffffff;
}

.footer-social a {
  color: #ffffff;
  font-weight: 700;
}

.floating-cta {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100% - 2.6rem));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.4rem;
  z-index: 10;
  overflow: hidden;
}

.floating-cta.is-hidden {
  display: none;
}

.cta-close {
  justify-self: end;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  background: var(--bg-muted);
  color: var(--text-main);
  cursor: pointer;
}

.floating-cta strong {
  font-size: 1rem;
  color: var(--text-main);
}

.floating-note {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text-muted);
}

.floating-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

/* Modern refresh using Tailwind/Flowbite helpers */
.hero {
  min-height: 68vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 2.75rem;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
  z-index: 0;
}

.nav.glass-nav {
  background: rgba(6, 13, 22, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.hero-body {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 48vh;
}

.hero-content.glass-card {
  background: rgba(10, 18, 30, 0.72);
  padding: clamp(1.8rem, 5vw, 2.8rem);
  border-radius: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  max-width: 900px;
}

.hero-content.glass-card .intro {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
}

.btn-solid,
.btn-outline,
.btn-ghost {
  letter-spacing: 0.01em;
  font-weight: 700;
}

.btn-solid {
  background: linear-gradient(135deg, #ff9c5f, #ff5f52);
  color: #0d0a0a;
  box-shadow: 0 12px 30px rgba(255, 140, 86, 0.4);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.property-card {
  border: 1px solid rgba(16, 35, 52, 0.08);
  background: radial-gradient(circle at 20% 20%, rgba(31, 183, 163, 0.06), transparent 45%), #ffffff;
  box-shadow: 0 16px 45px rgba(12, 30, 50, 0.12);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  position: relative;
  animation: cardFadeIn 0.6s ease both;
}

.property-card:nth-child(1) {
  animation-delay: 0s;
}

.property-card:nth-child(2) {
  animation-delay: 0.1s;
}

.property-card:nth-child(3) {
  animation-delay: 0.2s;
}

.property-card:nth-child(4) {
  animation-delay: 0.3s;
}

.property-card:nth-child(n+5) {
  animation-delay: 0.4s;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.property-card:hover {
  transform: translateY(-10px);
  border-color: rgba(31, 183, 163, 0.35);
  box-shadow: 0 28px 72px rgba(12, 30, 50, 0.2);
}

.property-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
  z-index: 1;
}

.property-card:hover::before {
  left: 100%;
}

.property-media span.status-pill {
  background: rgba(31, 183, 163, 0.95);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(31, 183, 163, 0.35);
  animation: badgePulse 0.6s ease;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.carousel-shell {
  background: linear-gradient(145deg, #0b1320, #0f1c2f);
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 340px;
}

.carousel-controls {
  display: none;
}

.carousel-track:hover .slide {
  transition-duration: 0.35s;
}

.floating-cta {
  width: auto;
  min-width: 0;
  max-width: 240px;
  padding: 0.85rem 1rem;
  background: rgba(12, 22, 34, 0.9);
  color: #e5ecf5;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.floating-cta p,
.floating-cta strong {
  margin: 0;
  color: #f7f9fc;
}

.floating-cta .floating-note {
  font-size: 0.9rem;
  color: #d8e2ee;
}

.floating-cta .floating-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cta-close {
  border-radius: 50%;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Galeria en pestaña aislada */
body.gallery-only {
  background: #050b14;
}

body.gallery-only header,
body.gallery-only main,
body.gallery-only footer,
body.gallery-only .floating-cta,
body.gallery-only .modal-backdrop {
  display: none !important;
}

body.gallery-only .full-detail {
  display: block;
}

@media (max-width: 1024px) {
  .hero-body {
    grid-template-columns: 1fr;
  }

  .portfolio-layout {
    grid-template-columns: 1fr;
  }

  .carousel-shell {
    min-height: 260px;
  }

  .slide img {
    height: clamp(230px, 54vw, 320px);
  }

  .slide.prev {
    transform: translateX(-60%) scale(0.94);
  }

  .slide.next {
    transform: translateX(60%) scale(0.94);
  }
}

@media (max-width: 780px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .carousel-card {
    padding: 1.2rem;
  }

  .carousel-shell {
    border-radius: 1rem;
    min-height: 260px;
  }

  .slide.prev {
    transform: translateX(-52%) scale(0.94);
  }

  .slide.next {
    transform: translateX(52%) scale(0.94);
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 1.6rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .carousel-controls {
    inset: 0;
    padding: 0 0.5rem;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
  }

  .dot {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 640px) {
  .floating-cta {
    right: 12px;
    left: 12px;
    width: auto;
  }

  .floating-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .floating-cta {
    bottom: 12px;
  }

  .modal-dialog {
    grid-template-columns: 1fr;
  }
}

/* Chat flotante */
.chat-launch {
  position: fixed;
  right: 18px;
  bottom: 18px;
  border: none;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #0d6efd, #0b5ed7);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 16px 40px rgba(13, 110, 253, 0.35);
  cursor: pointer;
  z-index: 40;
}

.chat-widget {
  position: fixed;
  right: 16px;
  bottom: 82px;
  width: min(320px, 92vw);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(12, 30, 50, 0.2);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
  z-index: 40;
}

.chat-header {
  padding: 0.75rem 0.9rem;
  background: linear-gradient(135deg, #0d6efd, #0b5ed7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}

.chat-header small {
  display: block;
  font-weight: 500;
  opacity: 0.85;
  font-size: 0.82rem;
}

.chat-close {
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
}

.chat-body {
  padding: 0.75rem;
  display: grid;
  gap: 0.5rem;
  background: #f8fafc;
  max-height: 260px;
  overflow-y: auto;
}

.chat-message {
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.chat-message.bot {
  background: #e0ecff;
  color: #0f172a;
}

.chat-message.user {
  background: #d1fae5;
  color: #064e3b;
  justify-self: end;
}

.chat-quick {
  padding: 0.6rem 0.7rem;
  background: #f0f4f8;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chat-quick button {
  border: 1px solid #d0d9e4;
  background: #fff;
  color: #0f172a;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.chat-quick button:hover {
  transform: translateY(-1px);
  border-color: #0d6efd;
  box-shadow: 0 10px 22px rgba(13, 110, 253, 0.18);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  padding: 0.75rem;
  background: #ffffff;
}

.chat-form input {
  padding: 0.65rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.95rem;
}

.chat-form button {
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 10px;
  background: #0d6efd;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 640px) {
  .chat-launch {
    right: 12px;
    bottom: 12px;
  }
  .chat-widget {
    right: 10px;
    left: 10px;
    width: auto;
  }
}
/* Carousel controls visible and clickable */
.carousel-controls {
  display: flex !important;
  pointer-events: none;
}

.carousel-controls .carousel-btn,
.carousel-controls .dot {
  pointer-events: auto;
}
.build-showcase {
  background: linear-gradient(135deg, #f5f7fb 0%, #eaf0f7 100%);
  padding-top: 2.5rem;
}

.build-showcase .section-intro {
  max-width: 1100px;
  margin: 0 0 1rem 0;
  text-align: left;
}

.build-showcase .section-intro h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  letter-spacing: -0.01em;
}

.build-showcase .section-intro p {
  font-size: 1.02rem;
  color: #374151;
}

.build-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

/* ==================== GALERÍA MASÓNICA ELEGANTE ==================== */
.masonry-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  grid-auto-rows: 220px;
}

.masonry-item {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(12, 30, 50, 0.1);
  cursor: pointer;
  background: #f0f4f8;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.masonry-item-large {
  grid-column: span 2;
  grid-row: span 2;
}

.masonry-item-inner {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.masonry-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.6s ease;
}

.masonry-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.4s ease;
  z-index: 1;
}

.masonry-item:hover {
  box-shadow: 0 20px 50px rgba(12, 30, 50, 0.2);
  transform: translateY(-8px);
}

.masonry-item:hover img {
  transform: scale(1.05);
  filter: brightness(1.12);
}

.masonry-item:hover .masonry-overlay {
  background: rgba(31, 183, 163, 0.08);
}

/* Lightbox */
.masonry-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.masonry-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.lightbox-content {
  position: relative;
  z-index: 2;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lightboxSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Permitir gestos táctiles dentro del contenido del lightbox */
.lightbox-content {
  touch-action: pan-y;
}

@keyframes lightboxSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.8rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 3;
  display: grid;
  place-items: center;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.lightbox-nav {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  pointer-events: none;
}

.lightbox-prev,
.lightbox-next {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: auto;
  display: grid;
  place-items: center;
  font-weight: 300;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

@media (max-width: 900px) {
  .masonry-gallery {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    grid-auto-rows: 160px;
    gap: 1rem;
  }

  .masonry-item-large {
    grid-column: span 2;
    grid-row: span 2;
  }
}

@media (max-width: 600px) {
  .masonry-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 140px;
    gap: 0.8rem;
    padding: 0.8rem;
  }

  .masonry-item-large {
    grid-column: span 2;
    grid-row: span 2;
  }

  .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    top: 1rem;
    right: 1rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}
.build-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(31, 183, 163, 0.95);
  color: #ffffff;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(31, 183, 163, 0.4);
  z-index: 2;
  animation: slideDown 0.6s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.build-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.build-thumb:hover {
  transform: translateY(-3px);
  border-color: #1fb7a3;
}

.build-thumb.active {
  border-color: #1fb7a3;
  box-shadow: 0 16px 40px rgba(31, 183, 163, 0.2);
}

/* Rediseño sección Territorios inspirado en la maqueta */
.modern-terr {
  background: #f5f7fb;
  color: var(--text-main);
  position: relative;
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
}

.modern-terr::after {
  display: none;
}

.modern-terr .section-intro h2,
.modern-terr .section-intro p,
.modern-terr .eyebrow {
  color: var(--text-main);
}

.modern-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.modern-terr .property-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(12, 30, 50, 0.12);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.modern-terr .property-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 38px rgba(12, 30, 50, 0.16);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.card-image-wrapper {
  position: relative;
  overflow: hidden;
  height: 200px;
  background: #0c1524;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(31, 183, 163, 0.15), rgba(255, 143, 79, 0.1));
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.property-card:hover .card-overlay {
  opacity: 1;
}

.card-floating-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem;
  background: rgba(31, 183, 163, 0.95);
  color: #fff;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(31, 183, 163, 0.3);
  transform: translateY(100px) translateX(20px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  cursor: pointer;
  backdrop-filter: blur(10px);
  border: none;
}

.card-floating-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.property-card:hover .card-floating-btn {
  transform: translateY(0) translateX(0);
  opacity: 1;
}

.property-card:hover .card-floating-btn:hover {
  background: rgba(31, 183, 163, 1);
  transform: translateY(-4px) translateX(0);
  box-shadow: 0 16px 40px rgba(31, 183, 163, 0.45);
}

.property-card:hover .card-floating-btn:hover svg {
  transform: translateX(4px);
}

.card-body {
  padding: 1rem;
  display: grid;
  gap: 0.5rem;
}

.card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: "Playfair Display", serif;
}

.card-location {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.card-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
  min-height: 40px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.card-price {
  font-weight: 800;
  color: var(--accent);
  font-size: 0.95rem;
}

.card-size {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  background: var(--bg-muted);
  border-radius: 4px;
}

.card-kmz-inline {
  color: #0d6efd;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-kmz {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  color: #0f172a;
  font-weight: 700;
  background: #f9fafb;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card-kmz:hover {
  transform: translateY(-1px);
  border-color: #0d6efd;
  box-shadow: 0 8px 18px rgba(13, 110, 253, 0.18);
}

@media (max-width: 600px) {
  .modern-terr {
    padding: 2.4rem 4vw;
  }

  .modern-terr .property-card {
    padding: 14px;
  }

  .modern-terr .property-image-wrapper {
    height: 180px;
  }
}

/* ==================== Nuevas Animaciones Mejoradas ==================== */

/* Animación para secciones al hacer scroll */
.section {
  animation: sectionFadeIn 0.8s ease-out;
}

@keyframes sectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mejora de botones con animación */
.btn,
button[type="submit"],
.btn-outline,
.btn-solid {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn::before,
button[type="submit"]::before,
.btn-outline::before,
.btn-solid::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: -1;
}

.btn:active::before,
button[type="submit"]:active::before,
.btn-outline:active::before,
.btn-solid:active::before {
  width: 300px;
  height: 300px;
}

/* Animación de hover para links */
a:not(.btn):not(.logo):not(.social-icon) {
  position: relative;
  transition: color 0.3s ease;
}

a:not(.btn):not(.logo):not(.social-icon)::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

a:not(.btn):not(.logo):not(.social-icon):hover::after {
  width: 100%;
}

/* Mejora de navegación */
.nav-links a {
  position: relative;
  transition: all 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* Animaciones de entrada para elementos de grid */
.properties-grid > * {
  animation: gridItemFadeIn 0.6s ease-out forwards;
}

.properties-grid > :nth-child(1) { animation-delay: 0s; }
.properties-grid > :nth-child(2) { animation-delay: 0.1s; }
.properties-grid > :nth-child(3) { animation-delay: 0.2s; }
.properties-grid > :nth-child(n+4) { animation-delay: 0.3s; }

@keyframes gridItemFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Animación de hover mejorada para tarjetas */
.card:hover {
  box-shadow: 0 32px 80px rgba(12, 30, 50, 0.2);
}

/* Efecto de brillo suave en hover */
.property-card:hover::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 0.6s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Animación de pulsación para elementos destacados */
.pulse-subtle {
  animation: pulseSoft 2s ease-in-out infinite;
}

@keyframes pulseSoft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Mejora de inputs */
input,
textarea,
select {
  transition: all 0.3s ease;
  border-color: var(--border);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 183, 163, 0.1);
  transform: translateY(-2px);
}

/* Animación de form submit */
.contact-form button:active {
  transform: scale(0.98);
}

/* Mejora visual de modal */
.modal-backdrop {
  animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(4px);
  }
}

.modal-dialog {
  animation: slideUpModal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpModal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Animación de chat */
.chat-message {
  animation: chatBubbleIn 0.3s ease-out;
}

@keyframes chatBubbleIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Efecto hover mejorado en social icons */
.social-icon {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateY(0);
}

.social-icon:hover {
  transform: translateY(-6px) scale(1.1);
  filter: drop-shadow(0 8px 20px rgba(31, 183, 163, 0.3));
}

/* ==================== Efectos Adicionales de Animación ==================== */

/* Efecto de ondulación en botones */
.btn::after,
button[type="submit"]::after,
.btn-outline::after,
.btn-solid::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.btn:active::after,
button[type="submit"]:active::after,
.btn-outline:active::after,
.btn-solid:active::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

/* Animación de entrada para secciones */
.section {
  position: relative;
}

.section-intro h2 {
  animation: titleSlideIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes titleSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Efecto de brillo para tarjetas al pasar mouse */
.property-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  z-index: 10;
}

.property-card:hover::before {
  animation: shine 0.7s ease-in-out;
}

@keyframes shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Animación de escala suave en grid items */
.properties-grid > * {
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.properties-grid > *:hover {
  transform: scale(1.02);
}

/* Mejora de transiciones en inputs */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
}

/* Efecto de flotación en elementos */
.floating-element {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Animación de aparición de contenido */
.fade-in {
  animation: fadeInSlow 0.8s ease-out;
}

@keyframes fadeInSlow {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Efecto de línea horizontal */
.hr-animated {
  background: linear-gradient(90deg, transparent, rgba(12, 30, 50, 0.12), transparent);
  animation: expandWidth 0.8s ease-out;
}

@keyframes expandWidth {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Efectos en hover de tarjetas de grid */
.carousel-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Animación de zoom en imágenes */
.carousel-image {
  transition: transform 0.5s ease;
}

.carousel-main:hover .carousel-image {
  transform: scale(1.03);
}

/* Mejora de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Efecto de glow en elementos interactivos */
.interactive-element {
  box-shadow: 0 0 0 0 rgba(31, 183, 163, 0.4);
}

.interactive-element:hover {
  animation: glow 0.6s ease-out;
}

@keyframes glow {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 183, 163, 0.7);
  }
  100% {
    box-shadow: 0 0 0 20px rgba(31, 183, 163, 0);
  }
}
