/* ================================================
   Inmobiliaria Ovalles — Sistema de Bienes Raíces
   Diseño moderno 2026
   ================================================ */

:root {
  --primary: #1a2e3b;
  --primary-light: #1e5070;
  --accent: #e66c3c;
  --accent-dark: #c4522a;
  --dark: #0f172a;
  --dark2: #1e293b;
  --gray: #64748b;
  --gray-light: #e2e8f0;
  --white: #ffffff;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.18);
  --transition: .25s cubic-bezier(.4,0,.2,1);
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: #f8fafc;
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

/* ========== NAVBAR ========== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(15,23,42,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding: 0 2rem;
  height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  transition: background var(--transition);
}
.navbar.scrolled { background: rgba(15,23,42,.99); }
.navbar-brand { display: flex; align-items: center; gap: 10px; }
.navbar-brand .logo-text { font-size: 1.4rem; font-weight: 800; color: var(--white); letter-spacing: -.5px; }
.navbar-brand .logo-text span { color: var(--accent); }
.navbar-brand .logo-icon { width: 38px; height: 38px; background: linear-gradient(135deg, var(--primary-light), var(--accent)); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.navbar-logo { height: 60px; width: auto; display: block; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a { color: rgba(255,255,255,.8); font-weight: 500; font-size: .95rem; transition: color var(--transition); }
.nav-links a:hover { color: var(--accent); }
.nav-cta { background: var(--accent); color: var(--dark)!important; padding: .5rem 1.2rem; border-radius: 8px; font-weight: 700!important; }
.nav-cta:hover { background: var(--accent-dark); color: var(--dark)!important; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.nav-toggle span { width: 24px; height: 2px; background: white; border-radius: 2px; transition: var(--transition); }

/* ========== HERO ========== */
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1a2e3b 60%, #0f172a 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; overflow: hidden; padding: 8rem 2rem 4rem;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url('/assets/img/hero-bg.jpg') center/cover no-repeat;
  opacity: .18;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(15,23,42,.7) 0%, rgba(15,23,42,.5) 60%, rgba(15,23,42,.9) 100%);
}
.hero-content { position: relative; text-align: center; max-width: 820px; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(230,108,60,.15); border: 1px solid rgba(230,108,60,.4); color: var(--accent); font-size: .8rem; font-weight: 600; padding: .35rem .9rem; border-radius: 50px; margin-bottom: 1.5rem; letter-spacing: .5px; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 900; color: var(--white); line-height: 1.1; margin-bottom: 1.2rem; letter-spacing: -1px; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.15rem; color: rgba(255,255,255,.72); max-width: 580px; margin: 0 auto 2.5rem; }
.hero-stats { display: flex; gap: 2.5rem; justify-content: center; margin-bottom: 3rem; }
.hero-stat .num { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.hero-stat .lbl { font-size: .78rem; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .5px; }

/* ========== SEARCH BOX ========== */
.search-box {
  background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem 2rem;
  max-width: 900px; width: 100%;
  position: relative; z-index: 10;
}
.search-tabs { display: flex; gap: .5rem; margin-bottom: 1.2rem; }
.search-tab { padding: .5rem 1.2rem; border-radius: 8px; border: none; cursor: pointer; font-size: .9rem; font-weight: 600; transition: var(--transition); background: var(--gray-light); color: var(--gray); }
.search-tab.active { background: var(--primary); color: white; }
.search-fields { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 1rem; align-items: end; }
.sf-group label { font-size: .75rem; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: .4rem; }
.sf-group select, .sf-group input {
  width: 100%; padding: .75rem 1rem; border: 2px solid var(--gray-light); border-radius: 10px;
  font-size: .95rem; color: var(--dark); background: #f8fafc;
  transition: border-color var(--transition); outline: none;
}
.sf-group select:focus, .sf-group input:focus { border-color: var(--primary-light); background: white; }
.btn-search {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white; border: none; padding: .78rem 2rem; border-radius: 10px;
  font-size: 1rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: var(--transition); display: flex; align-items: center; gap: .5rem;
}
.btn-search:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(30,80,112,.4); }

/* ========== SECTIONS ========== */
.section { padding: 5rem 2rem; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-tag { font-size: .8rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: .5rem; }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; color: var(--dark); letter-spacing: -.5px; }
.section p.subtitle { color: var(--gray); font-size: 1.05rem; max-width: 550px; margin: .7rem auto 0; }

/* ========== PROPERTY CARDS ========== */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  max-width: 1400px; margin: 0 auto;
}
.prop-card {
  background: white; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,.07); transition: var(--transition);
  position: relative;
}
.prop-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.prop-img { position: relative; height: 220px; overflow: hidden; background: linear-gradient(135deg,#e8edf2,#d1d9e0); }
.prop-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; display: block; }
.prop-img img[src=""], .prop-img img:not([src]) { display: none; }
.prop-card:hover .prop-img img { transform: scale(1.06); }
.prop-badge {
  position: absolute; top: 12px; left: 12px;
  padding: .3rem .8rem; border-radius: 6px; font-size: .75rem; font-weight: 700; text-transform: uppercase;
}
.btn-fav {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(255,255,255,.88); backdrop-filter: blur(4px);
  border: none; border-radius: 50%; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.btn-fav:hover { transform: scale(1.15); background: white; }
.btn-fav svg { width: 16px; height: 16px; color: var(--gray); transition: .2s; }
.btn-fav.activo svg { fill: #ef4444; stroke: #ef4444; color: #ef4444; }
.btn-fav.activo { background: white; }
.badge-venta { background: var(--primary); color: white; }
.badge-alquiler { background: var(--success); color: white; }
.badge-destacado { background: var(--accent); color: var(--dark); }
.prop-media-count {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,.65); color: white; font-size: .78rem; font-weight: 600;
  padding: .25rem .6rem; border-radius: 6px; display: flex; align-items: center; gap: 4px;
}
.prop-body { padding: 1.2rem 1.4rem 1rem; }
.prop-price { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin-bottom: .3rem; line-height: 1.2; }
.prop-price small { font-size: .8rem; color: var(--gray); font-weight: 400; }
/* Dual currency toggle — por defecto muestra MXN */
.price-cur { display: none; }
.price-MXN { display: inline; }
body.show-usd .price-MXN { display: none; }
body.show-usd .price-USD { display: inline; }
/* Pill selector de moneda */
.currency-pill {
  display: flex; align-items: center; gap: 3px;
  background: rgba(0,0,0,.55); backdrop-filter: blur(8px);
  border-radius: 30px; padding: 4px;
}
.currency-pill button {
  background: transparent; color: rgba(255,255,255,.7);
  border: none; border-radius: 24px;
  padding: .35rem .9rem; font-size: .78rem; font-weight: 700;
  cursor: pointer; letter-spacing: .04em; transition: all .2s;
}
.currency-pill button.active {
  background: white; color: var(--primary);
}
.currency-pill button:hover:not(.active) { color: white; }
.prop-title { font-size: 1rem; font-weight: 600; color: var(--dark); margin-bottom: .4rem; line-height: 1.3; }
.prop-location { font-size: .85rem; color: var(--gray); display: flex; align-items: center; gap: 6px; margin-bottom: .9rem; }
.prop-location svg { width: 28px; height: 28px; flex-shrink: 0; }


.prop-features { display: flex; gap: 1rem; padding-top: .9rem; border-top: 1px solid var(--gray-light); }
.feat { display: flex; align-items: center; gap: 5px; font-size: .82rem; color: var(--gray); }
.feat svg { width: 16px; height: 16px; flex-shrink: 0; }
.prop-footer { padding: .8rem 1.4rem 1rem; display: flex; justify-content: space-between; align-items: center; }
.btn-ver { font-size: .85rem; font-weight: 600; color: var(--primary-light); display: flex; align-items: center; gap: 4px; transition: gap var(--transition); }
.btn-ver:hover { gap: 8px; color: var(--accent); }
.btn-wa { background: #25d366; color: white; border: none; border-radius: 8px; padding: .4rem .9rem; font-size: .82rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 5px; transition: var(--transition); }
.btn-wa:hover { background: #128c7e; transform: scale(1.05); }

/* ========== FILTERS SIDEBAR ========== */
.listings-layout { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; max-width: 1400px; margin: 0 auto; }
.filters-panel { background: white; border-radius: var(--radius-lg); padding: 1.5rem; height: fit-content; box-shadow: var(--shadow); position: sticky; top: 90px; }
.filter-group { margin-bottom: 1.5rem; }
.filter-group label { font-size: .8rem; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: .6rem; }
.filter-group select, .filter-group input { width: 100%; padding: .65rem .9rem; border: 2px solid var(--gray-light); border-radius: 8px; font-size: .9rem; color: var(--dark); background: #f8fafc; outline: none; transition: border-color var(--transition); }
.filter-group select:focus, .filter-group input:focus { border-color: var(--primary-light); background: white; }
.price-range { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.btn-filter { width: 100%; background: var(--primary); color: white; border: none; padding: .75rem; border-radius: 8px; font-weight: 700; cursor: pointer; transition: var(--transition); }
.btn-filter:hover { background: var(--primary-light); }
.btn-reset { width: 100%; background: transparent; color: var(--gray); border: 2px solid var(--gray-light); padding: .6rem; border-radius: 8px; font-weight: 600; cursor: pointer; margin-top: .5rem; transition: var(--transition); font-size: .9rem; }
.btn-reset:hover { border-color: var(--danger); color: var(--danger); }

/* ========== MAP ========== */
#mapa-propiedades { height: 520px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.leaflet-popup-content-wrapper { border-radius: 12px!important; box-shadow: var(--shadow-lg)!important; }
.map-popup img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.map-popup .mp-title { font-weight: 700; font-size: .9rem; margin-bottom: 3px; }
.map-popup .mp-price { color: var(--primary); font-weight: 800; font-size: 1rem; }
.map-popup a { display: block; text-align: center; background: var(--primary); color: white; border-radius: 6px; padding: .3rem .6rem; margin-top: 6px; font-size: .8rem; font-weight: 600; }

/* ========== PROPERTY DETAIL ========== */
.prop-detail { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.prop-gallery { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 300px 200px; gap: 8px; margin-bottom: 2rem; border-radius: var(--radius-lg); overflow: hidden; }
.gallery-main { grid-row: 1 / 3; position: relative; cursor: pointer; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-main:hover img { transform: scale(1.03); }
.gallery-thumb { position: relative; cursor: pointer; overflow: hidden; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-thumb:hover img { transform: scale(1.06); }
.gallery-more { position: absolute; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; color: white; font-size: 1.1rem; font-weight: 700; }
.prop-detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; }
.prop-info h1 { font-size: 1.8rem; font-weight: 800; color: var(--dark); margin-bottom: .3rem; }
.prop-info .location { font-size: 1rem; color: var(--gray); display: flex; align-items: center; gap: 5px; margin-bottom: 1.2rem; }
.prop-price-big { font-size: 2.2rem; font-weight: 900; color: var(--primary); margin-bottom: 1.5rem; }
.prop-specs { display: flex; gap: 1.5rem; flex-wrap: wrap; padding: 1.2rem; background: var(--gray-light); border-radius: var(--radius); margin-bottom: 1.5rem; }
.spec-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.spec-icon { font-size: 1.3rem; }
.spec-val { font-size: 1.1rem; font-weight: 700; color: var(--dark); }
.spec-lbl { font-size: .72rem; color: var(--gray); text-transform: uppercase; }
.prop-desc { margin-bottom: 2rem; }
.prop-desc h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .8rem; color: var(--dark); }
.prop-desc p { color: var(--gray); line-height: 1.8; }
.features-list { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.feature-item { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--dark); padding: .4rem .6rem; background: #f1f5f9; border-radius: 6px; }
.feature-item::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }
.contact-card { background: white; border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow); position: sticky; top: 90px; }
.contact-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.2rem; }
.contact-card .form-group { margin-bottom: 1rem; }
.contact-card input, .contact-card textarea { width: 100%; padding: .7rem 1rem; border: 2px solid var(--gray-light); border-radius: 8px; font-size: .9rem; resize: vertical; outline: none; transition: border-color var(--transition); font-family: var(--font); }
.contact-card input:focus, .contact-card textarea:focus { border-color: var(--primary-light); }
.btn-primary { width: 100%; background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: white; border: none; padding: .85rem; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: var(--transition); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(30,80,112,.4); }
.btn-whatsapp { width: 100%; background: #25d366; color: white; border: none; padding: .85rem; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: .7rem; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-whatsapp:hover { background: #128c7e; transform: translateY(-2px); }
.agent-mini { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: #f8fafc; border-radius: 10px; margin-top: 1.2rem; }
.agent-mini img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.agent-mini .an { font-weight: 700; font-size: .95rem; }
.agent-mini .ar { font-size: .8rem; color: var(--gray); }

/* ========== FEATURES SECTION ========== */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; max-width: 1200px; margin: 0 auto; }
.feature-card { background: white; border-radius: var(--radius-lg); padding: 2rem 1.5rem; text-align: center; box-shadow: 0 2px 16px rgba(0,0,0,.06); transition: var(--transition); border: 2px solid transparent; }
.feature-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.feature-icon { width: 60px; height: 60px; border-radius: 14px; background: linear-gradient(135deg, var(--primary-light)22, var(--accent)22); display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.6rem; }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; color: var(--dark); }
.feature-card p { font-size: .9rem; color: var(--gray); line-height: 1.6; }

/* ========== AI CHATBOT ========== */
.chat-bubble {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 2000;
}
.chat-btn {
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 6px 24px rgba(30,80,112,.5); display: flex; align-items: center; justify-content: center;
  transition: var(--transition); position: relative; overflow: hidden; padding: 10px;
}
.chat-btn:hover { transform: scale(1.1); }
.chat-btn img { width: 100%; height: 100%; object-fit: contain; filter: brightness(0) invert(1); }
.chat-btn svg { display: none; }
.chat-pulse { position: absolute; top: -3px; right: -3px; width: 18px; height: 18px; background: var(--accent); border-radius: 50%; border: 2px solid white; display: flex; align-items: center; justify-content: center; font-size: .65rem; font-weight: 700; color: var(--dark); }
.chat-window {
  position: fixed; bottom: 5.5rem; right: 1.5rem; z-index: 2001;
  width: 380px; max-height: 560px; background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); display: none; flex-direction: column;
  overflow: hidden; animation: slideUp .3s ease;
}
.chat-window.open { display: flex; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.chat-header { background: linear-gradient(135deg, var(--primary), var(--primary-light)); padding: 1rem 1.2rem; display: flex; align-items: center; gap: .9rem; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; padding: 4px; }
.chat-avatar img { width: 100%; height: 100%; object-fit: contain; filter: brightness(0) invert(1); }
.chat-header-info .cn { font-weight: 700; color: white; font-size: .95rem; }
.chat-header-info .cs { font-size: .75rem; color: rgba(255,255,255,.7); display: flex; align-items: center; gap: 4px; }
.chat-header-info .cs::before { content: ''; width: 8px; height: 8px; background: var(--success); border-radius: 50%; display: inline-block; }
.chat-close { margin-left: auto; background: none; border: none; color: rgba(255,255,255,.7); cursor: pointer; font-size: 1.3rem; transition: color var(--transition); }
.chat-close:hover { color: white; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .8rem; scroll-behavior: smooth; }
.msg { max-width: 85%; }
.msg.bot { align-self: flex-start; display: flex; align-items: flex-end; gap: .5rem; }
.msg.user { align-self: flex-end; }
.msg-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); flex-shrink: 0; overflow: hidden; padding: 3px; display: flex; align-items: center; justify-content: center; }
.msg-avatar img { width: 100%; height: 100%; object-fit: contain; filter: brightness(0) invert(1); }
.msg-content { display: flex; flex-direction: column; }
.msg-bubble { padding: .7rem 1rem; border-radius: 16px; font-size: .9rem; line-height: 1.5; }
.msg.bot .msg-bubble { background: #f1f5f9; color: var(--dark); border-bottom-left-radius: 4px; }
.msg.user .msg-bubble { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: white; border-bottom-right-radius: 4px; }
.msg-time { font-size: .72rem; color: var(--gray); margin-top: 3px; }
.msg.user .msg-time { text-align: right; }
.chat-suggestions { padding: .5rem 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.suggestion { background: var(--gray-light); border: none; border-radius: 20px; padding: .35rem .8rem; font-size: .8rem; color: var(--dark); cursor: pointer; transition: var(--transition); }
.suggestion:hover { background: var(--primary); color: white; }
.chat-input-area { padding: .8rem 1rem; border-top: 1px solid var(--gray-light); display: flex; gap: .6rem; align-items: flex-end; }
.chat-input { flex: 1; border: 2px solid var(--gray-light); border-radius: 12px; padding: .6rem .9rem; font-size: .9rem; resize: none; max-height: 80px; outline: none; transition: border-color var(--transition); font-family: var(--font); }
.chat-input:focus { border-color: var(--primary-light); }
.chat-send { background: var(--primary); color: white; border: none; border-radius: 10px; width: 40px; height: 40px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: var(--transition); }
.chat-send:hover { background: var(--primary-light); transform: scale(1.05); }
.chat-wa-btn { width: calc(100% - 2rem); margin: .5rem 1rem 1rem; background: #25d366; color: white; border: none; border-radius: 10px; padding: .7rem; font-size: .9rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; transition: var(--transition); }
.chat-wa-btn:hover { background: #128c7e; }
.chat-wa-link { display: inline-flex; align-items: center; gap: 5px; background: #25d366; color: white !important; text-decoration: none; padding: .45rem 1rem; border-radius: 20px; font-weight: 700; font-size: .85rem; margin-top: .35rem; transition: background .2s; }
.chat-wa-link:hover { background: #128c7e; }
.typing-indicator { display: flex; align-items: center; gap: 4px; padding: .8rem 1rem; background: #f1f5f9; border-radius: 16px; width: fit-content; }
.typing-indicator span { width: 8px; height: 8px; background: var(--gray); border-radius: 50%; animation: typing .8s ease-in-out infinite; }
.typing-indicator span:nth-child(2) { animation-delay: .15s; }
.typing-indicator span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%,80%,100% { transform: scale(.7); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

/* ========== LIGHTBOX ========== */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.95); z-index: 3000; display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 8px; object-fit: contain; }
.lightbox video { max-width: 90vw; max-height: 85vh; border-radius: 8px; }
.lb-close { position: absolute; top: 1rem; right: 1.5rem; color: white; font-size: 2rem; cursor: pointer; background: none; border: none; line-height: 1; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); color: white; font-size: 2rem; cursor: pointer; background: rgba(255,255,255,.1); border: none; padding: 1rem .8rem; border-radius: 8px; transition: background var(--transition); }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.2); }

/* ========== PAGINATION ========== */
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2.5rem; }
.page-btn { width: 40px; height: 40px; border-radius: 8px; border: 2px solid var(--gray-light); background: white; font-weight: 600; cursor: pointer; transition: var(--transition); font-size: .9rem; display: flex; align-items: center; justify-content: center; color: var(--dark); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn:hover:not(.active) { border-color: var(--primary-light); color: var(--primary-light); }

/* ========== ADMIN ========== */
.admin-layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--dark); color: white; padding: 1.5rem 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-logo { padding: 0 1.5rem 1.5rem; font-size: 1.2rem; font-weight: 800; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 1rem; }
.admin-logo span { color: var(--accent); }
.admin-nav a { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.5rem; color: rgba(255,255,255,.65); font-size: .9rem; font-weight: 500; transition: var(--transition); }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.08); color: white; border-right: 3px solid var(--accent); }
.admin-nav .nav-section { padding: .5rem 1.5rem; font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.3); margin-top: 1rem; }
.admin-content { padding: 2rem; background: #f8fafc; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.admin-header h1 { font-size: 1.5rem; font-weight: 800; color: var(--dark); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.2rem; margin-bottom: 2rem; }
.stat-card { background: white; border-radius: var(--radius); padding: 1.3rem 1.5rem; box-shadow: 0 1px 10px rgba(0,0,0,.06); border-left: 4px solid var(--primary-light); }
.stat-card .sv { font-size: 2rem; font-weight: 800; color: var(--dark); }
.stat-card .sl { font-size: .82rem; color: var(--gray); margin-top: .2rem; }
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 10px rgba(0,0,0,.06); }
.data-table th { background: var(--dark); color: white; padding: .85rem 1rem; text-align: left; font-size: .82rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.data-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--gray-light); font-size: .9rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }
.badge-status { padding: .25rem .7rem; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.badge-disponible { background: #d1fae5; color: #065f46; }
.badge-reservado { background: #fef3c7; color: #92400e; }
.badge-vendido, .badge-alquilado { background: #fee2e2; color: #991b1b; }
.btn-sm { padding: .35rem .75rem; border-radius: 6px; font-size: .8rem; font-weight: 600; cursor: pointer; border: none; transition: var(--transition); }
.btn-edit { background: var(--primary-light); color: white; }
.btn-delete { background: var(--danger); color: white; }
.btn-sm:hover { opacity: .85; }
.form-card { background: white; border-radius: var(--radius-lg); padding: 2rem; box-shadow: 0 1px 10px rgba(0,0,0,.06); margin-bottom: 1.5rem; }
.form-card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.5rem; padding-bottom: .8rem; border-bottom: 1px solid var(--gray-light); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
.form-full { grid-column: 1 / -1; }
.form-group label { font-size: .8rem; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: .4rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: .7rem 1rem; border: 2px solid var(--gray-light); border-radius: 8px; font-size: .9rem; outline: none; transition: border-color var(--transition); font-family: var(--font); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary-light); }
.upload-zone { border: 2px dashed var(--gray-light); border-radius: var(--radius); padding: 2.5rem; text-align: center; cursor: pointer; transition: var(--transition); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary-light); background: #eef2ff; }
.upload-zone .icon { font-size: 2.5rem; margin-bottom: .5rem; }
.upload-zone p { color: var(--gray); font-size: .9rem; }
.upload-preview { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.preview-item { position: relative; width: 100px; height: 80px; border-radius: 8px; overflow: hidden; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item .remove-btn { position: absolute; top: 3px; right: 3px; background: var(--danger); color: white; border: none; border-radius: 4px; width: 20px; height: 20px; font-size: .8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn-success { background: var(--success); color: white; }

/* ========== COMPARISON TABLE ========== */
.comparison-table { overflow-x: auto; margin: 0 auto 2rem; max-width: 1300px; }
.comparison-table table { width: 100%; border-collapse: collapse; min-width: 900px; }
.comparison-table th { background: var(--dark); color: white; padding: 1rem; text-align: center; font-size: .85rem; }
.comparison-table th:first-child { text-align: left; }
.comparison-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--gray-light); font-size: .85rem; }
.comparison-table td:first-child { font-weight: 600; color: var(--dark); }
.comparison-table tr:nth-child(even) td { background: #f8fafc; }
.comparison-table .check { color: var(--success); font-size: 1rem; }
.comparison-table .cross { color: var(--danger); font-size: 1rem; }
.comparison-table .partial { color: var(--accent); font-size: .9rem; }
.comparison-table th.highlight { background: var(--primary-light); position: relative; }
.comparison-table th.highlight::after { content: '⭐ Nuestra Plataforma'; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--dark); font-size: .7rem; padding: .15rem .6rem; border-radius: 4px; white-space: nowrap; font-weight: 800; }

/* ========== FOOTER ========== */
footer { background: var(--dark); color: rgba(255,255,255,.65); padding: 4rem 2rem 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 3rem; max-width: 1200px; margin: 0 auto 3rem; }
.footer-brand .logo-text { font-size: 1.4rem; font-weight: 800; color: white; }
.footer-brand p { margin-top: .8rem; font-size: .9rem; line-height: 1.7; }
footer h4 { color: white; font-size: .9rem; font-weight: 700; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .5px; }
footer ul { list-style: none; }
footer ul li { margin-bottom: .5rem; }
footer ul li a { font-size: .88rem; color: rgba(255,255,255,.55); transition: color var(--transition); }
footer ul li a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: 1.5rem; text-align: center; font-size: .82rem; max-width: 1200px; margin: 0 auto; }
.social-links { display: flex; gap: .8rem; margin-top: .8rem; }
.social-link { width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.65); transition: var(--transition); font-size: .9rem; }
.social-link:hover { background: var(--accent); color: var(--dark); }

/* ========== ALERTS / TOAST ========== */
.toast { position: fixed; top: 1.5rem; right: 1.5rem; z-index: 5000; padding: 1rem 1.4rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-weight: 600; font-size: .92rem; animation: fadeInDown .3s; display: flex; align-items: center; gap: .7rem; }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-15px); } to { opacity: 1; transform: none; } }
.toast-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.toast-error { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }

/* ========== MOBILE FILTER TOGGLE ========== */
.btn-filter-toggle {
  display: none;
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: .85rem 1.4rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}
.btn-filter-toggle svg { transition: transform .3s ease; flex-shrink: 0; }
.btn-filter-toggle.open svg { transform: rotate(180deg); }
@media (max-width: 1024px) {
  .filters-panel.collapsed { display: none; }
}

/* ========== ADMIN MOBILE SIDEBAR ========== */
.admin-mobile-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 900;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.admin-mobile-toggle:hover { background: var(--primary-light); transform: scale(1.08); }
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 998;
  backdrop-filter: blur(2px);
}
@keyframes slideInLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .listings-layout { grid-template-columns: 1fr; }
  .filters-panel { position: static; }
  .prop-detail-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .btn-filter-toggle { display: flex; }
  .admin-mobile-toggle { display: flex; }
  body.admin-sidebar-open .admin-sidebar {
    display: block !important;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 999;
    width: 260px;
    overflow-y: auto;
    animation: slideInLeft .25s ease;
  }
  body.admin-sidebar-open .admin-sidebar-overlay { display: block; }
}
@media (max-width: 768px) {
  .nav-links { display: none; position: fixed; top: 72px; left: 0; right: 0; background: var(--dark); flex-direction: column; padding: 1rem; gap: .5rem; z-index: 990; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .search-fields { grid-template-columns: 1fr; }
  .hero { padding: 5.5rem 1.2rem 3rem; }
  .hero-stats { flex-wrap: wrap; gap: 1rem; }
  .hero-stat .num { font-size: 1.6rem; }
  .prop-gallery { grid-template-columns: 1fr; grid-template-rows: auto; }
  .gallery-main { height: 240px; }
  .chat-window { width: calc(100vw - 2rem); right: .5rem; bottom: 5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .comparison-table th.highlight::after { display: none; }
  /* Touch targets */
  .btn-filter, .btn-reset, .btn-search, .btn-primary, .btn-whatsapp, .btn-filter-toggle { min-height: 44px; }
  .page-btn { width: 44px; height: 44px; }
  .nav-links a { min-height: 44px; display: flex; align-items: center; }
  /* Property detail */
  .features-list { grid-template-columns: 1fr; }
  .prop-specs { gap: .8rem; }
  .prop-price-big { font-size: 1.8rem; }
  .contact-card { position: static; margin-top: 1.5rem; }
  /* Search box */
  .search-box { padding: 1rem 1.2rem; border-radius: var(--radius); }
  /* Chat bubble */
  .chat-bubble { bottom: 1rem; right: 1rem; }
}
@media (max-width: 480px) {
  .properties-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.9rem; }
  .hero p { font-size: .95rem; }
  .prop-gallery { border-radius: var(--radius); }
  .gallery-main { height: 210px; }
  .admin-content { padding: 1rem; }
  .admin-header { flex-direction: column; align-items: flex-start; gap: .7rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .form-grid { grid-template-columns: 1fr; }
  .prop-detail { padding: 1rem; }
  footer { padding: 3rem 1.2rem 1rem; }
}

/* ============ COMPARTIR ============ */
.btn-share { background: var(--gray-light); color: var(--gray); border: none; border-radius: 8px; padding: .4rem .65rem; font-size: .82rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 4px; transition: var(--transition); line-height: 1; }
.btn-share:hover { background: #e2e8f0; color: var(--dark); }
#share-popup-float { background: white; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.22); padding: .4rem; display: flex; flex-direction: column; gap: .15rem; min-width: 168px; z-index: 9999; }
.spi { display: flex; align-items: center; gap: .55rem; padding: .5rem .85rem; border-radius: 8px; font-size: .84rem; font-weight: 600; text-decoration: none; transition: opacity .15s; border: none; cursor: pointer; width: 100%; box-sizing: border-box; }
.spi:hover { opacity: .85; }
.spi-wa { background: #25d366; color: white; }
.spi-fb { background: #1877f2; color: white; }
.spi-tw { background: #0f1419; color: white; }
.spi-tg { background: #2aabee; color: white; }
.spi-copy { background: var(--gray-light); color: var(--dark); }
.share-bar { display: flex; gap: .5rem; flex-wrap: wrap; }
#admin-share-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 2000; align-items: center; justify-content: center; padding: 1rem; }
.admin-share-box { background: white; border-radius: 18px; padding: 1.8rem; max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.share-plat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1.2rem; }
.spl-btn { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-radius: 10px; font-size: .88rem; font-weight: 700; text-decoration: none; color: white; transition: opacity .15s; }
.spl-btn:hover { opacity: .85; }
.spl-wa { background: #25d366; }
.spl-fb { background: #1877f2; }
.spl-tw { background: #0f1419; }
.spl-li { background: #0a66c2; }
.spl-tg { background: #2aabee; }
.spl-em { background: #6b7280; }
.spi-ig { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); color: white; }
.spl-ig { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
