/* ============================================
   Inmuebles Zibata — Portal Styles
   ============================================ */

/* CSS Variables */
:root {
  --primary: #1a56db;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --secondary: #10b981;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
  --shadow-lg: 0 4px 20px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --max-w: 1200px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

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

/* UTILITIES */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  white-space: nowrap;
  font-family: var(--font);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-lg { padding: .85rem 1.75rem; font-size: 1rem; }

/* HEADER */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 68px;
}
.logo { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-icon { font-size: 1.5rem; }
.logo strong { color: var(--primary); }

.nav { display: flex; gap: 1.5rem; margin-left: auto; }
.nav-link { color: var(--text-muted); font-weight: 500; font-size: .9rem; transition: color .2s; }
.nav-link:hover { color: var(--primary); }
.nav-cta { margin-left: 1rem; }

/* HAMBURGER */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all .25s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* MOBILE MENU */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 260px;
  height: 100vh;
  background: var(--surface);
  z-index: 1001;
  padding: 5rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  box-shadow: -4px 0 20px rgba(0,0,0,.15);
  transition: right .3s ease;
  overflow-y: auto;
}
.mobile-menu.open { right: 0; }
.mobile-nav-link {
  display: block;
  padding: .85rem 1rem;
  color: var(--text);
  font-weight: 500;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  transition: background .2s;
}
.mobile-nav-link:hover { background: var(--bg); color: var(--primary); }
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: none;
}
.mobile-overlay.open { display: block; }

@media (max-width: 768px) {
  .nav { display: none; }
  .nav-cta { display: none; }
  .hamburger { display: flex; }
}

/* HERO */
.hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 50%, #0ea5e9 100%);
  color: #fff;
  padding: 3.5rem 0 4rem;
  text-align: center;
}
.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: .75rem;
}
.hero-title strong { color: #fbbf24; }
.hero-subtitle { font-size: 1.15rem; opacity: .9; margin-bottom: 2rem; }

/* SEARCH BOX */
.search-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  margin-top: 1rem;
  text-align: left;
}
.search-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.search-row + .search-row { margin-top: .75rem; }
.search-select, .search-input {
  flex: 1;
  min-width: 140px;
  padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: border-color .2s;
}
.search-select:focus, .search-input:focus {
  outline: none;
  border-color: var(--primary);
}
.search-input-wrap { flex: 2; min-width: 200px; }
.search-input { width: 100%; }
.search-btn { white-space: nowrap; }
.search-status { margin-top: .75rem; font-size: .85rem; color: var(--text-muted); min-height: 1.2em; }

@media (max-width: 768px) {
  .hero-title { font-size: 1.75rem; }
  .search-select, .search-input { min-width: 100%; }
}

/* STATS BAR */
.stats-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.stats-inner {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 1.25rem 0;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-number { display: block; font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* SECTION HEADER */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.section-title { font-size: 1.6rem; font-weight: 700; }
.section-actions { display: flex; align-items: center; gap: 1rem; }
.results-count { font-size: .85rem; color: var(--text-muted); }
.sort-select { padding: .5rem .75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .85rem; font-family: var(--font); }

/* PROPERTIES SECTION */
.properties-section { padding: 3rem 0; }

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* PROPERTY CARD */
.property-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.property-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.property-image-wrap {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: #e2e8f0;
}
.property-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.property-badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  padding: .25rem .6rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.badge-venta { background: var(--primary); color: #fff; }
.badge-renta { background: var(--secondary); color: #fff; }
.badge-new { background: var(--accent); color: #fff; }

.property-body { padding: 1rem; }
.property-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: .25rem;
}
.property-title { font-size: .95rem; font-weight: 600; margin-bottom: .5rem; color: var(--text); }
.property-location { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; display: flex; align-items: center; gap: .25rem; }
.property-features {
  display: flex;
  gap: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-muted);
}
.property-feature { display: flex; align-items: center; gap: .25rem; }
.property-agent { margin-top: .75rem; font-size: .8rem; color: var(--text-muted); }

.loading-indicator { text-align: center; padding: 3rem; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.no-results { text-align: center; padding: 3rem; }
.no-results h3 { margin-bottom: .5rem; color: var(--text); }
.no-results p { color: var(--text-muted); margin-bottom: 1rem; }

.load-more-wrap { text-align: center; padding: 2rem 0; }

/* ZONAS */
.zonas-section { background: var(--surface); padding: 3rem 0; border-top: 1px solid var(--border); }
.zonas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.zona-card {
  padding: 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
  background: var(--bg);
}
.zona-card:hover { border-color: var(--primary); background: #eff6ff; transform: translateY(-2px); }
.zona-card h3 { font-size: 1rem; margin-bottom: .5rem; color: var(--text); }
.zona-card p { font-size: .85rem; color: var(--text-muted); margin-bottom: .75rem; }
.zona-count { font-size: .8rem; font-weight: 600; color: var(--primary); }

/* CTA */
.cta-section { background: linear-gradient(135deg, #1a56db, #0ea5e9); color: #fff; padding: 4rem 0; text-align: center; }
.cta-section h2 { font-size: 2rem; font-weight: 800; margin-bottom: .75rem; }
.cta-section p { font-size: 1.1rem; opacity: .9; margin-bottom: 2rem; }
.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.cta-section .btn-outline { border-color: #fff; color: #fff; }
.cta-section .btn-outline:hover { background: #fff; color: var(--primary); }

/* FOOTER */
.footer { background: #1e293b; color: #94a3b8; padding: 3rem 0 0; }
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
}
.footer-brand .logo { color: #fff; margin-bottom: .75rem; }
.footer-brand .logo strong { color: #60a5fa; }
.footer-brand p { font-size: .85rem; line-height: 1.7; }
.footer-address { margin-top: .5rem; font-size: .85rem; }
.footer-links h4 { color: #fff; font-size: .9rem; margin-bottom: .75rem; }
.footer-links a { display: block; font-size: .85rem; color: #94a3b8; margin-bottom: .4rem; transition: color .2s; }
.footer-links a:hover { color: #fff; }
.footer-links p { font-size: .85rem; margin-bottom: .4rem; }
.footer-links p a { display: inline; }
.footer-bottom {
  border-top: 1px solid #334155;
  padding: 1.25rem 0;
  font-size: .8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-easybroker a { color: #60a5fa; }

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: .5rem; text-align: center; }
}

/* WHATSAPP FLOAT */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 12px rgba(37,211,102,.4);
  z-index: 999;
  transition: transform .2s;
  cursor: pointer;
}
.whatsapp-float:hover { transform: scale(1.1); }

/* BACK TO TOP */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 48px;
  height: 48px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow);
  z-index: 998;
  cursor: pointer;
  transition: all .2s;
  color: var(--text);
}
.back-to-top:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-2px); }
.back-to-top.visible { display: flex; }

/* Skeleton loading */
.skeleton { pointer-events: none; }
.skeleton-img { height: 200px; background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius) var(--radius) 0 0; }
.skeleton-body { padding: 1rem; }
.skeleton-line { height: 14px; background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; margin-bottom: .75rem; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Pagination info */
.pagination-info { text-align: center; padding: 1rem; color: var(--text-muted); font-size: .9rem; }
