/* ================= RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: #f7f7f7;
  color: #222;
}

/* ================= CONTENEDOR GLOBAL ================= */
.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

/* ================= HEADER DESKTOP ================= */
.header {
  width: 100%;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transition: all 0.3s ease;
}

.header.scrolled {
  padding: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.header.scrolled .header-container {
  height: 52px;
}

.header.scrolled .header-logo img {
  height: 28px;
}

.header.scrolled .logo-text {
  font-size: 1.1rem;
}

.header-container {
  max-width: 1200px;
  margin: auto;
  padding: 0px 30px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: height 0.3s ease;
}

/* ===== LOGO ===== */
.header-logo {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s;
}

.header-logo:hover {
  opacity: 0.8;
}

.logo-icon {
  height: 42px;
  width: auto;
  display: block;
  transition: height 0.3s ease;
  margin-right: -24px;
}

.logo-text {
  font-size: 1.6rem;
  font-weight: 800;
  color: #2c3e50;
  letter-spacing: -0.5px;
  line-height: 1;
  transition: font-size 0.3s ease;
}

.logo-green {
  color: #7cc242;
}
/* ===== ACCIONES ===== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-actions a {
  text-decoration: none;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
}

/* ===== BOTONES VIVOS ===== */
.btn-publish {
  text-decoration: none;
  font-weight: 700;
  color: #fff;
  background: #7cc242;
  padding: 8px 18px;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(124, 194, 66, 0.35);
}

.btn-publish:hover {
  background: #6aad35;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(124, 194, 66, 0.5);
}

.btn-publish:active {
  transform: translateY(0px);
  box-shadow: 0 2px 6px rgba(124, 194, 66, 0.3);
}

.btn-outline {
  text-decoration: none;
  font-weight: 600;
  color: #333;
  border: 1.5px solid #ccc;
  padding: 7px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  border-color: #7cc242;
  color: #7cc242;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.btn-outline:active {
  transform: translateY(0px);
}

.btn-primary {
  background: #7cc242;
  color: #fff !important;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(124, 194, 66, 0.35);
}

.btn-primary:hover {
  background: #6aad35;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(124, 194, 66, 0.5);
}

.search-box button:hover {
  background: #6aad35 !important;
  transform: none;
}

.btn-icon {
  text-decoration: none;
  font-size: 1.3rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: #f0f0f0;
}

/* ===== USER MENU ===== */
.user-menu {
  position: relative;
  cursor: pointer;
}

.user-name::after {
  content: " ▾";
}

.dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 130%;
  background: #fff;
  min-width: 180px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  overflow: hidden;
}

.dropdown a {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
}

.dropdown a:hover {
  background: #f5f5f5;
}

.user-menu.open .dropdown {
  display: block;
}

/* ================= HERO ================= */
.hero {
  height: 80vh;
  position: relative;
  overflow: hidden;
}

.hero-slider,
.slide {
  position: absolute;
  inset: 0;
}

.slide {
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.slide.active {
  opacity: 1;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  text-align: center;
  padding: 0 20px;
}

.hero-content h1 {
  font-size: 2.8rem;
  margin-bottom: 25px;
}

.search-box {
  display: flex;
  width: 100%;
  max-width: 520px;
}

.search-box input {
  flex: 1;
  padding: 14px;
  border-radius: 10px 0 0 10px;
  border: none;
}

.search-box button {
  padding: 14px 22px;
  border: none;
  background: #7cc242;
  color: #fff;
  font-weight: 600;
  border-radius: 0 10px 10px 0;
  cursor: pointer;
}

/* ================= MOBILE NAV ================= */
.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 75px;
  }

  .header {
    display: block;
  }

  .header-container {
    display: none;
  }

  .header-topbar {
    display: flex;
  }

  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
  }

  .mobile-nav a {
    text-decoration: none;
    color: #666;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .mobile-nav a span {
    font-size: 22px;
  }

  .mobile-nav a.active {
    color: #7cc242;
  }
}

/* ================= SECCIÓN ¿QUÉ QUIERES HACER HOY? ================= */
.destacadas-section {
  max-width: 1200px;
  margin: 50px auto;
  padding: 0 20px;
}

.destacadas-section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 24px;
}

.lista {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.lista .item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  transition: transform 0.2s, box-shadow 0.2s;
  aspect-ratio: 4/3;
}

.lista .item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

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

.lista .item .info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff;
  padding: 30px 18px 18px;
}

.lista .item .titulo {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.lista .item .direccion {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* ================= TESTIMONIOS ================= */
.testimonios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 16px;
}

.testimonio {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.testimonio .texto {
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 18px;
  line-height: 1.6;
}

.testimonio .cliente {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonio .cliente img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
}

.testimonio .cliente h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #222;
}

.testimonio .cliente span {
  font-size: 0.8rem;
  color: #888;
}

@media (max-width: 768px) {
  .lista {
    grid-template-columns: 1fr;
  }

  .testimonios {
    grid-template-columns: 1fr;
  }
}

/* ================= PÁGINA COMPRAR ================= */
.mobile-quick-actions {
  display: none;
}

.page-header {
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 16px 20px;
}

.page-header-inner {
  max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-header-inner h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #222;
}

.result-count {
  font-size: 0.9rem;
  color: #888;
}

.contenedor-comprar {
  max-width: 1200px;
  margin: 25px auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 25px;
  padding: 0 20px;
}

.filtros {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  position: sticky;
  top: 90px;
  height: max-content;
}

.filtros h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #222;
}

.filtros label {
  display: block;
  margin: 12px 0 4px;
  font-size: .85rem;
  font-weight: 600;
  color: #555;
}

.filtros input,
.filtros select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
}

.filtros button {
  margin-top: 14px;
  width: 100%;
  padding: 11px;
  background: #7cc242;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.filtros .btn-reset {
  background: #f0f0f0;
  color: #555;
  margin-top: 8px;
}

.filtros .btn-reset:hover {
  background: #e0e0e0;
}

/* ===== TARJETAS ===== */
.lista-propiedades {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .lista-propiedades {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .lista-propiedades {
    grid-template-columns: 1fr;
  }
}

.card-propiedad {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(0,0,0,0.04);
}

.card-propiedad:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.13);
}

/* IMAGEN */
.card-img-wrap {
  position: relative;
  height: 210px;
  overflow: hidden;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card-propiedad:hover .card-img-wrap img {
  transform: scale(1.06);
}

/* TAGS */
.tag-tipo {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.tag-venta    { background: #7cc242; }
.tag-alquiler { background: #f59e0b; }

/* BODY */
.card-body {
  padding: 16px 18px 20px;
}

.card-precio {
  font-size: 1.35rem;
  font-weight: 800;
  color: #222;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.card-titulo {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-direccion {
  font-size: 0.82rem;
  color: #999;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-hab {
  font-size: 0.82rem;
  color: #666;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.card-extras {
  font-size: 0.78rem;
  color: #aaa;
  margin-top: 6px;
}

/* FAVORITO */
.btn-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 10;
}

.btn-fav:hover {
  transform: scale(1.18);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

/* LOADING */
.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  color: #aaa;
  font-size: 1rem;
}

/* SIN RESULTADOS */
.no-resultados {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.no-resultados button {
  margin-top: 12px;
  padding: 10px 24px;
  background: #7cc242;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.no-resultados button:hover {
  background: #6aad35;
}

/* ===== MÓVIL ===== */
@media (max-width: 768px) {
  .mobile-quick-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
  }

  .quick-btn {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1.5px solid #ccc;
    color: #333;
    white-space: nowrap;
  }

  .quick-btn.active {
    border-color: #7cc242;
    color: #7cc242;
  }

  .quick-btn.publish {
    background: #7cc242;
    color: #fff;
    border-color: #7cc242;
  }

  .contenedor-comprar {
    grid-template-columns: 1fr;
  }

  .filtros {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    border-radius: 0;
    overflow-y: auto;
  }

  .filtros.open {
    display: block;
  }

  .btn-filtros-mobile {
    display: block;
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #7cc242;
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 12px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1000;
  }
}

@media (min-width: 769px) {
  .btn-filtros-mobile {
    display: none;
  }
}

/* ================= BUSCADOR ANIMADO ================= */
.search-box {
  transition: all 0.3s ease;
}

.search-box input {
  flex: 1;
  padding: 14px;
  border-radius: 10px 0 0 10px;
  border: none;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: none;
}

.search-box:focus-within {
  transform: scaleX(1.04);
  filter: drop-shadow(0 4px 16px rgba(124, 194, 66, 0.35));
}

.search-box:focus-within input {
  background: #fff;
}

.search-box:focus-within button {
  background: #6aad35;
  transform: none;
}

.search-box button {
  transition: background 0.2s ease;
}

/* ==============================
   TOPBAR PAÍSES
============================== */
.header-topbar {
  background: #1a2332;
  padding: 6px 0;
  width: 100%;
}

.header-topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-brand {
  font-size: 0.8rem;
  color: #8a9ab0;
  font-weight: 600;
}

.topbar-countries {
  display: flex;
  gap: 12px;
}

.topbar-country {
  font-size: 0.8rem;
  color: #8a9ab0;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.topbar-country:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.topbar-country.active {
  color: #7cc242;
  font-weight: 700;
}