:root {
  --ha-bg-1: #e8edf4;
  --ha-bg-2: #f6f8fc;
  --ha-text: #162035;
  --ha-muted: #5b667a;
  --ha-card: rgba(255, 255, 255, 0.92);
  --ha-border: rgba(16, 30, 54, 0.12);
  --ha-shadow: 0 18px 40px rgba(11, 25, 45, 0.14);
}

body.ra-modern {
  margin: 0;
  color: var(--ra-body-text, var(--ha-text));
  font-family: var(--ra-body-font, "Manrope"), "Segoe UI", sans-serif;
  font-size: var(--ra-body-size, 16px);
  padding-top: 108px;
  background:
    radial-gradient(circle at 7% 0%, rgba(31, 92, 168, 0.19), transparent 28%),
    radial-gradient(circle at 93% 8%, rgba(242, 107, 29, 0.18), transparent 23%),
    linear-gradient(180deg, var(--ha-bg-2) 0%, var(--ha-bg-1) 56%, #dfe7f1 100%);
}

/* Mantener header consistente entre home/listados/detalle aunque cambie el bundle cargado */
#site-header .topbar__item,
#site-header .topbar__icon,
#site-header .nav a {
  font-family: var(--ra-body-font, var(--bar-font, "Manrope")), "Segoe UI", sans-serif;
}

#site-header .nav a.nav__cta,
#site-header .nav a.nav__cta:hover,
#site-header .nav a.nav__cta:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(
    92deg,
    var(--bar-left-color, #0d47a1) 0%,
    var(--bar-right-color, #27afc9) 100%
  ) !important;
  border-color: var(--button-border-color, #ff6f00) !important;
  -webkit-text-fill-color: #ffffff;
}

#hero {
  width: min(1380px, calc(100% - 1.2rem));
  margin: 0.55rem auto 2rem;
  min-height: clamp(420px, 68vh, 760px);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(8, 22, 42, 0.22);
  position: relative;
}

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  image-rendering: auto;
  filter: none !important;
  opacity: 0;
  transition: opacity 0.9s ease-in-out;
  pointer-events: none;
  z-index: 0;
}

.hero-media--current {
  opacity: 1;
}

.hero-media--next.is-visible {
  opacity: 1;
}

.hero-overlay {
  display: none;
}

.hero-caption {
  position: absolute;
  left: clamp(1rem, 4vw, 3rem);
  bottom: clamp(1rem, 4vw, 2.2rem);
  right: clamp(1rem, 4vw, 3rem);
  max-width: 780px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: linear-gradient(
    135deg,
    var(--ra-brand-primary, #0d47a1),
    var(--ra-brand-secondary, #27afc9)
  );
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--ra-brand-primary, #0d47a1) 82%, transparent),
    color-mix(in srgb, var(--ra-brand-secondary, #27afc9) 64%, transparent)
  );
  color: #fff;
  border-radius: 22px;
  padding: clamp(1rem, 2.4vw, 1.7rem);
  backdrop-filter: blur(7px);
  box-shadow: inset 0 0 0 999px rgba(7, 16, 30, 0.12);
}

.hero-title {
  margin: 0;
  color: #ffffff;
  font-family: var(--ra-body-font, "Manrope"), "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  font-size: clamp(1.6rem, 3vw, 2.9rem);
}

.home-section,
.ra-carousel-section,
.site-footer {
  width: min(1240px, calc(100% - 1.2rem));
  margin: 0 auto 1.2rem;
}

/* Ajustes exclusivos del inicio: ensanchar shell general y cards del carrusel */
body.home-index .home-section,
body.home-index .ra-carousel-section,
body.home-index .site-footer {
  width: min(1380px, calc(100% - 1.6rem));
}

@media (min-width: 992px) {
  body.home-index .ra-property-card {
    flex: 0 0 min(96vw, 348px);
  }

  body.home-index .ra-media-wrap {
    height: 220px;
  }
}

.home-shell,
.ra-carousel-shell {
  background:
    radial-gradient(circle at 0% 0%, rgba(31, 92, 168, 0.08), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(242, 107, 29, 0.09), transparent 28%),
    var(--ha-card);
  border: 1px solid var(--ha-border);
  border-radius: 24px;
  box-shadow: var(--ha-shadow);
  padding: clamp(1rem, 2.2vw, 1.7rem);
  backdrop-filter: blur(4px);
}

.home-section-head {
  margin-bottom: 1rem;
  text-align: center;
}

.home-kicker,
.ra-carousel-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: #4d6787;
}

.home-title,
.ra-carousel-title {
  margin: 0.45rem 0 0;
  font-family: var(--ra-body-font, "Manrope"), "Segoe UI", sans-serif;
  color: #0f2d55;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.home-title {
  font-size: clamp(1.45rem, 2.8vw, 2.35rem);
}

.home-lead {
  margin: 0.85rem auto 0;
  max-width: 770px;
  color: var(--ha-muted);
  line-height: 1.7;
  font-size: clamp(0.95rem, 1.2vw, 1.06rem);
}

.team-carousel {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
}

.team-track {
  display: flex;
  transition: transform 540ms cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
}

.team-slide {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: clamp(1rem, 2.3vw, 2.1rem);
  align-items: stretch;
  border-radius: 18px;
  border: 1px solid rgba(19, 48, 88, 0.12);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.87), rgba(247, 251, 255, 0.9));
  padding: clamp(0.8rem, 1.4vw, 1rem);
}

.img-box {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  min-height: clamp(230px, 30vw, 320px);
  box-shadow: 0 14px 28px rgba(9, 24, 45, 0.18);
}

.img-box img,
.photo-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--ra-brand-primary, #1f5ca8), var(--ra-brand-secondary, #27afc9));
  color: #fff;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  font-weight: 800;
}

.info-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.team-role-label {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ra-brand-accent, #f26b1d);
}

.name {
  margin: 0.4rem 0 0;
  font-family: var(--ra-body-font, "Manrope"), "Segoe UI", sans-serif;
  font-size: clamp(1.3rem, 2.5vw, 2.05rem);
  line-height: 1.14;
  color: #112f58;
}

.role {
  margin: 0.45rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: #27558c;
}

.bio {
  margin: 0.7rem 0 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: #4a5e7b;
}

.team-controls {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.team-btn,
.ra-carousel-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(24, 59, 104, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: #163d71;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.team-btn:hover,
.ra-carousel-btn:hover {
  transform: translateY(-2px);
  background: var(--ra-brand-primary, #1f5ca8);
  color: #fff;
  box-shadow: 0 10px 20px rgba(9, 31, 59, 0.22);
}

.team-btn:disabled,
.ra-carousel-btn:disabled {
  opacity: 0.34;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ra-carousel-section {
  padding: 0;
}

.ra-carousel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ra-carousel-title {
  font-size: clamp(1.55rem, 2.9vw, 2.5rem);
}

.ra-carousel-track {
  gap: 0.95rem;
  user-select: none;
}

.ra-carousel-viewport {
  touch-action: pan-y;
  cursor: grab;
}

.team-carousel.is-dragging,
.ra-carousel-viewport.is-dragging {
  cursor: grabbing;
}

.team-carousel.is-dragging a,
.ra-carousel-viewport.is-dragging a {
  pointer-events: none;
}

.ra-property-card {
  border-radius: 16px;
  border: 1px solid rgba(18, 50, 90, 0.12);
  background: #fff;
  box-shadow: 0 14px 24px rgba(11, 31, 57, 0.11);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.ra-property-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 34px rgba(9, 25, 48, 0.18);
}

.ra-media-wrap {
  height: 212px;
}

.ra-media-gradient {
  background: linear-gradient(180deg, rgba(7, 20, 40, 0.04) 34%, rgba(7, 20, 40, 0.72) 100%);
}

.ra-badge {
  background: rgba(12, 36, 68, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ra-view-link {
  border-radius: 999px;
  background: rgba(21, 69, 125, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.44);
}

.ra-view-link:hover {
  background: var(--ra-brand-accent, #f26b1d);
  border-color: var(--ra-brand-accent, #f26b1d);
}

.ra-card-title {
  color: #15335f;
}

.ra-card-price {
  color: var(--ra-brand-primary, #1f5ca8);
}

body.home-index .ra-card-body {
  display: grid;
  gap: 0.48rem;
  padding: 0.84rem 0.9rem 0.92rem;
  align-content: start;
}

body.home-index .ra-property-card {
  display: flex;
  flex-direction: column;
}

body.home-index .ra-media-wrap {
  height: 236px;
}

body.home-index .ra-card-title {
  margin: 0;
  color: #14345d;
  font-size: clamp(1rem, 1.2vw, 1.14rem);
  line-height: 1.24;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.48em;
}

body.home-index .ra-card-location {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  color: #587090;
  font-size: 0.78rem;
  line-height: 1.35;
  min-width: 0;
}

body.home-index .ra-card-location i {
  color: #2e6b9c;
  font-size: 0.82rem;
  line-height: 1.2;
  margin-top: 0.05rem;
}

body.home-index .ra-card-location span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.home-index .ra-card-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  flex-wrap: wrap;
}

body.home-index .ra-card-ref,
body.home-index .ra-card-agent {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #d6e4f3;
  background: #f7fbff;
  color: #466486;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.44rem;
}

body.home-index .ra-card-ref {
  white-space: nowrap;
}

body.home-index .ra-card-agent {
  max-width: min(66%, 210px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.home-index .ra-card-price-wrap {
  border: 1px solid #cfe0f0;
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(247, 252, 255, 1), rgba(238, 247, 255, 0.95));
  padding: 0.42rem 0.54rem 0.48rem;
  display: grid;
  gap: 0.16rem;
}

body.home-index .ra-card-price-label {
  margin: 0;
  color: #5a7291;
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}

body.home-index .ra-card-price {
  margin: 0;
  color: var(--ra-brand-primary, #1f5ca8);
  font-size: clamp(1.14rem, 1.35vw, 1.28rem);
  line-height: 1.12;
}

body.home-index .ra-card-price .uf {
  display: inline-block;
  margin-top: 0;
  margin-left: 0.36rem;
  color: #627991;
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 600;
}

body.home-index .ra-card-facts-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.14rem;
  align-items: center;
  margin-top: 0.1rem;
}

body.home-index .ra-fact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  color: #5b7290;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0;
  line-height: 1.15;
  white-space: nowrap;
}

body.home-index .ra-fact-pill strong {
  color: #2a4e78;
  font-size: 0.8rem;
  font-weight: 700;
}

body.home-index .ra-fact-pill:not(:last-child)::after {
  content: "·";
  color: #a3b5c9;
  font-weight: 700;
  margin-left: 0.18rem;
}

body.home-index .ra-card-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.02rem;
}

body.home-index .ra-amenity-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(160, 175, 194, 0.42);
  background: rgba(255, 255, 255, 0.7);
  color: #5b7190;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.14rem 0.42rem;
}

body.home-index .ra-card-facts-empty {
  margin: 0;
  border: 1px dashed #d1dfef;
  border-radius: 10px;
  background: #f8fbff;
  color: #5f7897;
  font-size: 0.77rem;
  line-height: 1.4;
  padding: 0.5rem 0.56rem;
}

.ra-spec-chip {
  border: 1px solid #d7e1ef;
  background: #f7faff;
  color: #365379;
}

.ra-spec-ico {
  font-size: 0.8rem;
  opacity: 0.92;
}

.ra-spec-text {
  font-weight: 600;
  color: #5b6f8d;
}

.ra-spec-value {
  font-weight: 800;
  color: #24476f;
}

.ra-carousel-dot.is-active {
  background: var(--ra-brand-accent, #f26b1d);
}

.contact-shell {
  background:
    radial-gradient(circle at 100% 0%, rgba(39, 175, 201, 0.16), transparent 32%),
    radial-gradient(circle at 0% 100%, rgba(31, 92, 168, 0.11), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.93));
}

.contact-card {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.contact-btn {
  margin-top: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 211, 102, 0.5);
  background: linear-gradient(130deg, #1fca63 0%, #189e4d 100%);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 24px rgba(23, 131, 68, 0.24);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(20, 118, 59, 0.32);
  filter: saturate(1.08);
  color: var(--hover-color, var(--ra-brand-accent, #ff6f00));
}

.contact-btn i {
  font-size: 1.16rem;
}

.site-footer {
  margin-top: 1.4rem;
  margin-bottom: 1.6rem;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(116deg, var(--footer-left, #1f5ca8) 0%, var(--footer-right, #27afc9) 100%);
  box-shadow: 0 22px 38px rgba(9, 30, 56, 0.24);
}

.site-footer__inner {
  padding: clamp(1.1rem, 2.5vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}

.site-footer__logo-frame {
  width: 118px;
  height: 118px;
  margin: 0 auto 0.95rem;
  padding: 0.52rem;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.42), transparent 54%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    0 16px 28px rgba(7, 27, 51, 0.28),
    inset 0 1px 2px rgba(255, 255, 255, 0.55);
}

.site-footer__logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: 20px;
  padding: 0.36rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.66),
    0 8px 16px rgba(9, 28, 52, 0.2);
}

.site-footer__title {
  margin: 0;
  font-family: var(--ra-body-font, "Manrope"), "Segoe UI", sans-serif;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  color: #fff;
}

.site-footer__meta {
  margin: 0.45rem auto 0;
  max-width: 740px;
  line-height: 1.62;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.95);
}

.site-footer__meta a {
  color: inherit;
}

.site-footer__social {
  margin-top: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.site-footer__icon {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.site-footer__icon:hover {
  transform: translateY(-2px);
  background: var(--footer-hover, #ff6f00);
  border-color: var(--footer-hover, #ff6f00);
  color: #fff;
}

.site-footer__legal {
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.23);
  display: grid;
  gap: 0.2rem;
}

.site-footer__legal p {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.88);
}

.ra-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 560ms ease, transform 560ms ease;
}

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

@media (max-width: 991px) {
  body.ra-modern {
    padding-top: 82px;
  }

  .team-slide {
    grid-template-columns: 1fr;
  }

  .img-box {
    min-height: 230px;
  }

  .ra-media-wrap {
    height: 190px;
  }

  body.home-index .ra-card-body {
    padding: 0.78rem 0.82rem 0.86rem;
  }

  body.home-index .ra-media-wrap {
    height: 208px;
  }

  body.home-index .ra-card-price .uf {
    display: block;
    margin-left: 0;
    margin-top: 0.1rem;
  }
}

@media (max-width: 640px) {
  #hero {
    width: min(1380px, calc(100% - 0.6rem));
    border-radius: 16px;
    margin-bottom: 1rem;
  }

  .hero-caption {
    border-radius: 16px;
  }

  .home-section,
  .ra-carousel-section,
  .site-footer {
    width: min(1240px, calc(100% - 0.75rem));
    margin-bottom: 0.95rem;
  }

  .home-shell,
  .ra-carousel-shell {
    border-radius: 16px;
    padding: 0.9rem;
  }

  .site-footer__logo-frame {
    width: 102px;
    height: 102px;
    border-radius: 24px;
  }
}
