/* =========================================================
   BASE / RESET
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

:root {
  --bg-body: #f5f5f7;
  --bg-card: #fff3c2;
  --bg-header: #e6c88f;
  --bg-sidebar: #ffffff;
  --bg-chip: #eef1ff;
  --border-soft: #e3e4ec;
  --text-main: #222;
  --text-muted: #6c6f7b;
  --accent: #1b365d;
  --accent-soft: #e6c88f;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

body {
  font-family: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
}

/* cuando el menú está abierto */
body.no-scroll {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.d-none {
  display: none !important;
}

/* =========================================================
   HEADER + MENÚ HAMBURGUESA
   ========================================================= */
header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg-header);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

/* texto "Menu" solo mobile */
.mobilemenu {
  position: absolute;
  left: 3.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

/* navegación de escritorio: oculta en mobile */
.desk-ul {
  list-style: none;
  display: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.desk-ul li a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  transition: background 0.2s, color 0.2s;
}

.desk-ul li a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* botón hamburguesa */
.hamburger-menu {
  position: fixed;
  top: 0.7rem;
  left: 0.9rem;
  z-index: 110;
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.1);
  cursor: pointer;
}

/* ocultar checkbox */
.hamburger-menu input {
  display: none;
}

/* icono (3 líneas) */
.hamburger-menu::before,
.hamburger-menu::after,
.hamburger-menu span {
  content: "";
  position: absolute;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}

.hamburger-menu span {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-menu::before {
  top: 45%;
}

.hamburger-menu::after {
  top: 55%;
}

/* estado "abierto" usando body.no-scroll
   (tu JS ya añade/quita esta clase) */
body.no-scroll .hamburger-menu::before {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

body.no-scroll .hamburger-menu::after {
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

body.no-scroll .hamburger-menu span {
  opacity: 0;
}

/* =========================================================
   SIDEBAR (MENÚ LATERAL)
   ========================================================= */
.sidebar {
  position: fixed;
  left: -100%;
  z-index: 100;
  background: rgba(15, 23, 42, 0.28);
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  transition: left 0.25s ease;
  margin-top: 6%;
}

/* panel interno */
.sidebar-nav {
  background: var(--bg-sidebar);
  width: min(260px, 80vw);
  padding: 1.5rem 1.25rem;
  box-shadow: 12px 0 30px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* cuando el cuerpo tiene no-scroll (menú abierto) */
body.no-scroll .sidebar {
  left: 0;
}

.sidebar-nav div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}

.sidebar-nav div:hover {
  background: var(--accent-soft);
}

.sidebar-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
}

.sidebar-nav .icons {
  font-size: 1.15rem;
  color: var(--accent);
}

/* =========================================================
   SECCIÓN WELCOME
   ========================================================= */
.welcome {
  padding: 1.5rem 1rem 1rem;
}

.welcome-box {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.3rem;
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.icon-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.icon-circle svg {
  width: 22px;
  height: 22px;
}

.welcome-box h1 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.welcome-box p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* =========================================================
   BARRA DE BÚSQUEDA / FILTROS
   ========================================================= */
.search-bar-container {
  max-width: 900px;
  margin: 0 auto 1.5rem;
background: color-mix(in srgb, var(--bg-card) 20%, transparent);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-lg);
  padding: 0.9rem 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.menu-wrapper {
  display: flex;
  gap: 0.5rem;
}

/* dropdown genérico */
.dropdown {
  position: relative;
  flex: 1;
}

.dropdown-button {
  width: 100%;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: #f7f8ff;
  color: var(--text-main);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  cursor: pointer;
}

.dropdown-button .simbolito {
  font-weight: 700;
}

/* contenido del dropdown */
.dropdown-content {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 0.35rem 0;
  display: none;
  z-index: 15;
  text-align: center;
}

.dropdown.open .dropdown-content {
  display: block;
}

.dropdown-content a {
  display: block;
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.dropdown-content a:hover {
  background: var(--accent-soft);
}

/* selects de ubicación y tipo */
#search-filter,
#tipo {
  width: 100%;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text-main);
  text-align: center;
}

/* =========================================================
   CONTENEDOR DE CARDS
   ========================================================= */
.container-deptos {
  max-width: 900px;
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  padding: 0 1rem;
}

/* cada card */
.card {
background: color-mix(in srgb, var(--bg-card) 20%, transparent);

  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.card a {
  display: block;
  color: inherit;
}

/* contenedor de imagen con ratio fijo */
.card-img-container {
  position: relative;
  width: 100%;
  padding-top: 66%; /* 3:2 */
  overflow: hidden;
  background: #e5e7eb;
}

.card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* contenido de la card */
.card-content {
  padding: 0.85rem 0.95rem 1rem;
}

.card-fecha {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.card-location {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.card-price {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0.2rem 0;
}

.card-direccion {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.card-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-height: 3.2em;
  overflow: hidden;
}

/* chip "Disponible ahora" */
.disponibleya {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: #dcfce7;
  color: #15803d;
}

/* =========================================================
   MODALES (IMÁGENES Y MAPA)
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal img.modal-content,
.modal .modal-content1 {
  max-width: min(90vw, 900px);
  max-height: 80vh;
  border-radius: var(--radius-lg);
  background: #000;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.modal .close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
}

.prev,
.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: #fff;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  user-select: none;
}

.prev {
  left: 1rem;
}
.next {
  right: 1rem;
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
  border-top: 1px solid #e5e7eb;
  padding: 1.3rem 1rem 1.8rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-card);
}

.footerline {
  width: 70px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent-soft);
  margin: 0 auto 0.75rem;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* ≥ 600px: dos columnas de cards */
@media (min-width: 600px) {
  .container-deptos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ≥ 900px: tres columnas y nav desktop */
@media (min-width: 900px) {
  .hamburger-menu {
    display: none;
  }

  .sidebar {
    display: none;
  }

  .mobilemenu {
    display: none;
  }

  header {
    justify-content: center;
  }

  .desk-ul {
    display: flex;
  }

  .welcome {
    padding-top: 2.5rem;
  }

  .search-bar-container {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
  }

  .search-bar-container > * {
    flex: 1 1 160px;
  }

  .container-deptos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0;
  }
}

/* =========================================================
   HERO DE PORTADA CON OVERLAY NEGRO
   ========================================================= */
.hero-home {
  position: relative;
  width: 100%;
  height: 48vh;
  min-height: 280px;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transform: scale(1.02);
  filter: brightness(90%) contrast(105%) saturate(115%);
}

/* Overlay negro suave con degradado */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.55) 50%,
    rgba(0, 0, 0, 0.6) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Texto centrado sobre el overlay */
.hero-text {
  color: #fff;
  text-align: center;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
  padding: 0 1rem;
}

.hero-text h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: 0.5px;
}

.hero-text p {
  font-size: 0.8rem;
  opacity: 0.95;
  font-weight: 400;
  margin-top:80px;
}

/* Responsivo */
@media (min-width: 900px) {
  .hero-home {
    height: 55vh;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .hero-text p {
    font-size: 1.15rem;
  }
}

