/* =========================================================
   R&C Inmobiliaria – CSS Maestro (V5.0 Final Corregido)
   ========================================================= */

/* ---------- 1. Variables ---------- */
:root{
  --brand: #de5829;
  --ink: #24282b;
  --ink-70: rgba(36,40,43,.7);
  --ink-40: rgba(36,40,43,.4);
  --bg: #ffffff;
  --bg-soft: #f7f7f7;
  --radius-xl: 1.2rem;
  --radius-lg: .9rem;
  --radius-md: .6rem;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 6px 20px rgba(0,0,0,.12);
  --container: 1200px;
  --header-h: 80px; 
}

/* ---------- 2. Reset & Base ---------- */
*,*::before,*::after{ box-sizing:border-box; }

html,body{ height:100%; }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:"Outfit",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  font-size:16px; line-height:1.6;
}

a{ color:var(--brand); text-decoration:none; transition: opacity .2s; }
a:hover{ opacity:.85; }

.container{ max-width:var(--container); margin:0 auto; padding:0 1.25rem; }

/* ---------- 3. Header ---------- */
.site-header{
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid #eee;
  backdrop-filter: saturate(120%) blur(10px);
}

.header-inner {
  display: flex; justify-content: space-between; align-items: center;
  height: var(--header-h);
}

.logo img { height: 45px; display: block; }

.site-nav ul {
  display: flex; gap: 2rem; list-style: none; margin: 0; padding: 0; align-items: center;
}
.site-nav a { color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover { color: var(--brand); }

.nav-toggle {
  display: none; background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--ink); padding: 0;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; width: 100%;
    background: #fff; border-bottom: 1px solid #eee; padding: 1.5rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
  }
  .site-nav.is-open { display: block; animation: slideDown 0.3s ease; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 1rem; }
  .site-nav a { display: block; padding: 0.5rem 0; border-bottom: 1px solid #f5f5f5; }
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 4. Botones ---------- */
.btn{
  padding:.7rem 1.2rem; border-radius:.7rem; border:1px solid var(--brand);
  color:#fff; background:var(--brand); box-shadow:var(--shadow-sm);
  font-weight: 600; display: inline-block; cursor: pointer;
}
.btn:hover{ transform:translateY(-1px); color:#fff; }
.btn-ghost{ border-color:var(--ink-40); color:var(--ink); background:transparent; box-shadow: none; }
.btn-ghost:hover{ background: rgba(0,0,0,0.03); color: var(--brand); border-color: var(--brand); }

/* ---------- 5. Hero ---------- */
.hero{ padding:4rem 0 3rem; background:#fff; }
.hero-grid{ display:grid; grid-template-columns:1.1fr .9fr; gap:2rem; align-items:center; }
.h1{ font-size:clamp(2rem,4vw,3.2rem); line-height:1.1; margin:.5rem 0 1rem; font-weight:800; letter-spacing: -1px; }
.hero p{ color:var(--ink-70); font-size: 1.1rem; }
.hero-cta{ display:flex; gap:.75rem; margin-top:1.5rem; flex-wrap:wrap; }
.hero-cta .btn{ min-width:180px; text-align:center; }
.badge{
  display:flex; gap:.75rem; flex-wrap:wrap; border:1px dashed var(--ink-40);
  color:var(--ink-70); padding:.6rem 1rem; border-radius:.6rem; font-size:.9rem; margin-top:1.5rem;
}
.hero--center .hero-grid{ grid-template-columns:1fr; justify-items:center; text-align:center; }
.hero--center .hero-grid > div{ max-width:760px; }
.hero--center .hero-cta{ justify-content:center; }
.hero--center .badge{ justify-content:center; gap:1rem; }

/* ---------- 6. Secciones ---------- */
.section{ padding:4rem 0; background:var(--bg); }
.section h2{ font-size:clamp(1.8rem,3vw,2.4rem); margin:0 0 .5rem; font-weight: 700; letter-spacing: -0.5px; }
.section p.lead{ color:var(--ink-70); margin:0 0 2.5rem; font-size: 1.1rem; max-width: 600px; }
#propiedades{ background:var(--bg-soft); }
#servicios, #contacto{ background:var(--bg); }
#nosotros{ background:var(--bg-soft); }
#propiedades, #servicios, #nosotros, #contacto{ scroll-margin-top: calc(var(--header-h) + 20px); }

/* ---------- 7. Cards Servicios ---------- */
.cards{ display:grid; grid-template-columns:repeat(3,1fr); gap:1.5rem; }
.card{
  background:#fff; border:1px solid #eee; border-radius:var(--radius-lg);
  overflow:hidden; box-shadow:var(--shadow-sm); transition: transform 0.2s;
}
.card:hover{ transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .media{ height: 180px; overflow: hidden; border-bottom: 1px solid #eee; }
.card .media img{ width:100%; height:100%; object-fit: cover; display:block; transition: transform 0.5s; }
.card:hover .media img{ transform: scale(1.05); }
.card .body{ padding:1.5rem; }
.chip{ display:inline-block; font-size:.75rem; color:#fff; background:var(--brand); padding:.25rem .7rem; border-radius:999px; margin-bottom: 0.5rem; }
.card h3 { margin: 0.5rem 0; font-size: 1.25rem; }

/* ---------- 8. Filtros ---------- */
.filters-bar {
  display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center;
  background: #fff; padding: 1.2rem 1.5rem; border-radius: var(--radius-lg);
  border: 1px solid #e0e0e0; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  margin-bottom: 2.5rem; max-width: 900px;
}
.filter-group { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; min-width: 200px; }
.filter-group label { font-size: 0.8rem; font-weight: 700; color: var(--ink-70); text-transform: uppercase; letter-spacing: 0.5px; }
.select-wrapper select {
  width: 100%; padding: 0.75rem 1rem; font-size: 1rem; color: var(--ink);
  background-color: var(--bg-soft); border: 1px solid #ddd; border-radius: var(--radius-md);
  cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324282b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 1rem center; background-size: 1em;
  transition: all 0.2s ease;
}
.select-wrapper select:hover { border-color: var(--brand); background-color: #fff; }
.select-wrapper select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(222, 88, 41, 0.15); }
@media (max-width: 600px) { .filters-bar { flex-direction: column; align-items: stretch; gap: 1rem; padding: 1rem; } }

/* ---------- 9. PROPIEDADES (ESTILO NUEVO / ESTÁNDAR) ---------- */
.props { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 2rem; 
}

.prop-card { 
    background: white; 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    transition: transform 0.2s; 
    text-decoration: none; 
    color: inherit; 
    display: flex; 
    flex-direction: column; 
    border: 1px solid #eee;
}

.prop-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
}

.prop-img-container { 
    position: relative; 
    height: 220px; 
    background: #f4f4f4; 
}

.prop-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.prop-tag { 
    position: absolute; top: 15px; left: 15px; 
    background: rgba(30,30,30,0.9); color: white; 
    padding: 5px 12px; border-radius: 6px; 
    font-size: 0.75rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px;
}

.prop-body { 
    padding: 1.5rem; 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
}

.prop-price { 
    font-size: 1.6rem; 
    color: var(--brand); 
    font-weight: 700; 
    margin: 5px 0; 
}

.prop-title { 
    font-size: 1.15rem; 
    margin: 0 0 10px; 
    font-weight: 600; 
    line-height: 1.3; 
    color: #222;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.prop-location { 
    font-size: 0.9rem; 
    color: #666; 
    margin-bottom: 15px; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
}

.prop-meta { 
    display: flex; 
    gap: 15px; 
    font-size: 0.85rem; 
    color: #777; 
    margin-top: auto; 
    border-top: 1px solid #f0f0f0; 
    padding-top: 12px; 
}

.prop-meta span { display: flex; align-items: center; gap: 6px; }
.prop-meta .material-icons-round { font-size: 18px; color: #aaa; }


/* ---------- 10. Nosotros & Contacto ---------- */
.about{ display:grid; grid-template-columns:1fr 1fr; gap:3rem; align-items:center; }
.about .panel{ background:#fff; border:1px solid #eee; border-radius:var(--radius-xl); padding:2rem; box-shadow: var(--shadow-sm); }
.list li { margin-bottom: 0.5rem; }

.contact{ display:grid; grid-template-columns:1.1fr .9fr; gap:2rem; align-items:start; }
form{ background:#fff; border:1px solid #eee; border-radius:var(--radius-xl); padding:2rem; box-shadow: var(--shadow-sm); }
label{ display:block; font-weight:600; margin-top:1rem; font-size: 0.9rem; }
input,textarea,select{ width:100%; padding:.8rem 1rem; border:1px solid #e0e0e0; border-radius:.6rem; font:inherit; background: #fafafa; }
input:focus, textarea:focus { background: #fff; outline: 2px solid var(--brand); border-color: transparent; }
textarea{ min-height:140px; resize:vertical; }
form button[type="submit"]{ margin-top:1.5rem; width: 100%; }
.quick-actions{ display:flex; flex-wrap:wrap; gap:.75rem; margin:1rem 0 2rem; }

/* ---------- 11. Footer ---------- */
.site-footer{
  border-top: 1px solid #eee; padding: 3rem 0;
  background: #fff; color: var(--ink-70); font-size: 0.95rem; margin-top: 2rem;
}
.foot-grid{
  display: flex; justify-content: space-between; align-items: center; gap: 2rem;
}
.foot-left{
  display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start;
}
.foot-logo{ height: 40px; display: block; }
.foot-right{ 
  text-align: right; display: flex; flex-direction: column; gap: 0.8rem; align-items: flex-end; 
}
.social-links{ display: flex; gap: 1.2rem; font-size: 1.6rem; }
.back-top { color: var(--brand); font-weight: 600; font-size: 0.9rem; }

@media (max-width: 768px){
  .about, .contact, .cards { grid-template-columns:1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .foot-grid { flex-direction: column; text-align: center; gap: 2rem; }
  .foot-left, .foot-right { align-items: center; width: 100%; }
}

/* ---------- 12. Componentes Flotantes (CORREGIDO) ---------- */

/* Botón Flotante WhatsApp */
.floating-wa {
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    z-index: 9999;
    background: #25D366; 
    color: white; 
    width: 60px; 
    height: 60px;
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
    transition: transform 0.3s ease;
    text-decoration: none;
}
.floating-wa:hover { 
    transform: scale(1.1); 
    background: #128C7E; 
}
.floating-wa svg { 
    width: 35px; 
    height: 35px; 
    fill: white; 
}

/* Botón Volver Arriba */
.fab-top{
  position: fixed; right: 28px; bottom: 100px; /* Un poco más arriba del WhatsApp */
  width:44px; height:44px; border-radius:50%; border:none;
  background:#fff; color:var(--ink);
  box-shadow:0 4px 12px rgba(0,0,0,.15); cursor:pointer; z-index: 9990;
  display:none; place-items:center; font-size: 1.2rem;
  transition: opacity 0.3s;
}
.fab-top.is-visible{ display:grid; }