html, body { margin: 0; padding: 0; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --cream: #f5f0e8;
  --warm-white: #faf8f4;
  --charcoal: #0e0e0c;
  --dark-gray: #1e1e1b;
  --mid-gray: #7a7a72;
  --light-gray: #c8c4bc;
  --gold: #c9a84c;
  --gold-light: #e2c57a;
  --gold-pale: #f5edda;
  --accent: #7a5c1e;
}
html { scroll-behavior: smooth; }
body { background: var(--warm-white); color: var(--charcoal); font-family: 'DM Sans', sans-serif; font-weight: 300; min-height: 100vh; overflow-x: hidden; }

/* HEADER */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14,14,12,0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(201,168,76,0.25);
  padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
  height: 80px;
}
.logo-wrap { display: flex; align-items: center; gap: 14px; }
.logo-img { height: 56px; width: 56px; object-fit: contain; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem; font-weight: 600;
  letter-spacing: 0.2em;
  background: linear-gradient(135deg, #c9a84c 0%, #e2c57a 50%, #c9a84c 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.logo-sub {
  font-size: 0.6rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(201,168,76,0.6); margin-top: 3px;
}
nav { display: flex; gap: 36px; align-items: center; }
nav a {
  font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase;
  text-decoration: none; color: rgba(255,255,255,0.55); transition: color 0.2s;
}
nav a:hover, nav a.active { color: var(--gold); }

/* HERO */
.hero {
  position: relative; padding: 80px 48px 80px;
  background: var(--charcoal); overflow: hidden;
  display: flex; align-items: center; gap: 0;
}

.hero-agent {
  flex: 0 0 380px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 520px;
  margin-right: -48px;
}
.hero-agent img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: top center;
  /* Safari-compatible gradient mask — single gradient avoids mask-composite issues */
  mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
  filter: contrast(1.02) brightness(1.0);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 80% at 80% 40%, rgba(201,168,76,0.12) 0%, transparent 65%);
}
.hero::after {
  content: ''; position: absolute;
  bottom: -1px; left: 0; right: 0; height: 60px;
  background: linear-gradient(to bottom, transparent, var(--warm-white));
}
.hero-inner { position: relative; z-index: 1; max-width: 600px; flex: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 28px;
  animation: fadeUp 0.6s ease both;
}
.hero-eyebrow::before {
  content: ''; display: block; width: 32px; height: 1px; background: var(--gold);
}
.hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.8rem, 6vw, 5.5rem); font-weight: 300; line-height: 1.05;
  color: #ffffff; animation: fadeUp 0.6s 0.1s ease both;
}
.hero h1 em { font-style: italic; color: var(--gold-light); }
.hero-sub {
  margin-top: 22px; font-size: 0.92rem; color: rgba(255,255,255,0.45);
  line-height: 1.8; max-width: 460px; animation: fadeUp 0.6s 0.2s ease both;
}
.hero-stats {
  display: flex; gap: 40px; margin-top: 48px;
  animation: fadeUp 0.6s 0.3s ease both;
}
.hero-stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem; font-weight: 300; color: var(--gold);
}
.hero-stat-label { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.35); margin-top: 2px; }
.hero-divider { width: 1px; background: rgba(201,168,76,0.3); align-self: stretch; }

/* FILTERS */
.filters-bar {
  background: #f5f0e8; border-bottom: 1px solid #ede9e2;
  padding: 18px 48px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  box-shadow: 0 2px 20px rgba(0,0,0,0.04);
}
.filter-label { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mid-gray); white-space: nowrap; }
.filter-sep { width: 1px; height: 24px; background: #ded9d0; }
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group select, .filter-group input {
  background: #f5f0e8; border: 1px solid #ddd8cf;
  padding: 9px 14px; font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem; color: var(--charcoal); outline: none; cursor: pointer;
  transition: border-color 0.2s; border-radius: 0;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.filter-group select {
  background-color: #f5f0e8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a7a72'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.filter-group select option { background: #f5f0e8; color: var(--charcoal); }
.filter-group select:focus, .filter-group input:focus { border-color: var(--gold); }
.filter-group input::placeholder { color: #a09a92; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 26px; font-family: 'DM Sans', sans-serif; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; border: none; cursor: pointer; transition: all 0.2s; }
.btn-gold { background: var(--gold); color: white; }
.btn-gold:hover { background: var(--accent); }
.btn-outline { background: transparent; border: 1px solid #d0cbc2; color: var(--mid-gray); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* RESULTS */
.results-header { padding: 32px 48px 8px; display: flex; align-items: baseline; gap: 14px; justify-content: space-between; }
.results-left { display: flex; align-items: baseline; gap: 10px; }
.results-count { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; font-weight: 300; color: var(--charcoal); }
.results-label { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mid-gray); }

/* GRID */
.properties-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px; padding: 24px 48px 80px;
}

/* CARD */
.property-card {
  background: white; cursor: pointer; position: relative;
  border: 1px solid #ede9e2; transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 0.5s ease both;
}
.property-card:hover { transform: translateY(-5px); box-shadow: 0 20px 60px rgba(0,0,0,0.1); z-index: 2; }

.card-img-wrap { position: relative; height: 265px; overflow: hidden; background: #f0ece4; }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.property-card:hover .card-img-wrap img { transform: scale(1.05); }

.img-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.img-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: background 0.2s; }
.img-dot.active { background: white; width: 16px; border-radius: 3px; }

.img-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity 0.2s; border: none; font-size: 16px; color: var(--charcoal); }
.img-nav.prev { left: 10px; }
.img-nav.next { right: 10px; }
.property-card:hover .img-nav { opacity: 1; }

.badges { position: absolute; top: 14px; left: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 4px 10px; font-weight: 400; }
.badge-sale { background: var(--charcoal); color: white; }
.badge-available { background: linear-gradient(135deg, #c9a84c, #e2c57a); color: white; }
.badge-sold { background: #6b3535; color: white; }
.badge-featured { background: rgba(14,14,12,0.8); color: var(--gold); border: 1px solid var(--gold); }

.card-body { padding: 20px 22px 18px; }
.card-location { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 7px; display: flex; align-items: center; gap: 4px; }
.card-title { font-family: 'Cormorant Garamond', serif; font-size: 1.18rem; font-weight: 400; color: var(--charcoal); line-height: 1.3; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-address { font-size: 0.76rem; color: var(--mid-gray); margin-bottom: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-specs { display: flex; gap: 16px; margin-bottom: 15px; flex-wrap: wrap; }
.spec-item { display: flex; align-items: center; gap: 5px; font-size: 0.76rem; color: var(--mid-gray); }
.spec-item svg { color: var(--gold); flex-shrink: 0; }
.card-features { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.feature-tag { font-size: 0.62rem; letter-spacing: 0.08em; padding: 3px 8px; background: var(--gold-pale); color: var(--accent); text-transform: uppercase; }

.card-price { display: flex; align-items: flex-end; justify-content: space-between; padding-top: 14px; border-top: 1px solid #f0ece4; }
.price-label { font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid-gray); margin-bottom: 2px; }
.price-main { font-family: 'Cormorant Garamond', serif; font-size: 1.55rem; font-weight: 600; color: var(--charcoal); }
.card-area { font-size: 0.76rem; color: var(--light-gray); padding-bottom: 2px; }

/* Card share button */
.card-share-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0;
  background: transparent; border: 1px solid rgba(201,168,76,0.35);
  border-radius: 50%; cursor: pointer; color: var(--gold);
  transition: all 0.2s; padding: 0;
}
.card-share-btn:hover {
  background: rgba(201,168,76,0.12); border-color: var(--gold);
  transform: scale(1.1);
}

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(8,8,6,0.8); backdrop-filter: blur(8px); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; animation: fadeIn 0.25s ease; }
.modal { background: var(--warm-white); max-width: 920px; width: 100%; max-height: 92vh; overflow-y: auto; position: relative; animation: scaleIn 0.3s ease; }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 10; background: rgba(14,14,12,0.7); border: none; width: 38px; height: 38px; font-size: 16px; cursor: pointer; color: white; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.modal-close:hover { background: var(--charcoal); }

.modal-gallery {
  position: relative; height: 520px; overflow: hidden;
  background: var(--charcoal); cursor: zoom-in;
}
.modal-gallery img {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity 0.28s ease, transform 0.28s ease;
  will-change: opacity, transform;
  user-select: none; pointer-events: none;
}
.modal-gallery img.fading { opacity: 0; transform: scale(1.03); }
.modal-gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; justify-content: space-between; width: 100%;
  padding: 0 14px; pointer-events: none;
}
.modal-gallery-btn {
  pointer-events: all;
  background: rgba(14,14,12,0.55); border: 1px solid rgba(255,255,255,0.18);
  color: white; width: 52px; height: 52px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; transition: background 0.18s, transform 0.12s;
  backdrop-filter: blur(4px);
}
.modal-gallery-btn:hover { background: rgba(201,168,76,0.75); transform: scale(1.07); }
.modal-gallery-counter {
  position: absolute; bottom: 74px; right: 14px;
  background: rgba(14,14,12,0.65); color: rgba(255,255,255,0.7);
  font-size: 0.7rem; letter-spacing: 0.12em; padding: 4px 10px;
  backdrop-filter: blur(4px);
}
.modal-gallery-expand {
  position: absolute; top: 12px; right: 12px;
  background: rgba(14,14,12,0.6); border: 1px solid rgba(255,255,255,0.18);
  color: white; width: 38px; height: 38px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; transition: background 0.18s;
  backdrop-filter: blur(4px); pointer-events: all; z-index: 5;
  title: "Ver en pantalla completa";
}
.modal-gallery-expand:hover { background: rgba(201,168,76,0.8); }
.modal-gallery-thumbs {
  display: flex; gap: 4px; padding: 8px 10px;
  background: rgba(14,14,12,0.92); overflow-x: auto;
  scroll-behavior: smooth; scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.4) transparent;
}
.modal-gallery-thumbs::-webkit-scrollbar { height: 3px; }
.modal-gallery-thumbs::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.4); }
.modal-thumb {
  width: 90px; height: 64px; object-fit: cover;
  opacity: 0.42; cursor: pointer; flex-shrink: 0;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
  border: 2px solid transparent; border-radius: 1px;
}
.modal-thumb:hover { opacity: 0.75; transform: scale(1.04); }
.modal-thumb.active { opacity: 1; border-color: var(--gold); transform: scale(1.04); }

.modal-content { padding: 36px 40px 44px; }
.modal-badges { display: flex; gap: 8px; margin-bottom: 16px; }
.modal-title { font-family: 'Cormorant Garamond', serif; font-size: 1.9rem; font-weight: 400; color: var(--charcoal); margin-bottom: 6px; line-height: 1.2; }
.modal-location { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.modal-address { font-size: 0.84rem; color: var(--mid-gray); }

.modal-grid { display: grid; grid-template-columns: 1fr 290px; gap: 40px; margin-top: 32px; }
.modal-specs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 28px; }
.modal-spec { background: var(--cream); padding: 14px; text-align: center; }
.modal-spec-value { font-family: 'Cormorant Garamond', serif; font-size: 1.7rem; font-weight: 300; color: var(--charcoal); }
.modal-spec-label { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid-gray); margin-top: 3px; }

.modal-obs { font-size: 0.87rem; color: #3a3a35; line-height: 1.8; margin-bottom: 22px; }
.modal-features-title { font-size: 0.66rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--mid-gray); margin-bottom: 10px; }
.modal-features-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.modal-feature { font-size: 0.72rem; padding: 5px 12px; background: var(--gold-pale); color: var(--accent); letter-spacing: 0.05em; }

.modal-sidebar {}
.modal-price-box { background: var(--charcoal); padding: 24px; position: relative; overflow: hidden; }
.modal-price-box::before { content: ''; position: absolute; top: -30px; right: -30px; width: 100px; height: 100px; border-radius: 50%; background: rgba(201,168,76,0.08); }
.modal-price-type { font-size: 0.65rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.modal-price-value { font-family: 'Cormorant Garamond', serif; font-size: 2.1rem; font-weight: 300; color: white; }

.modal-info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0ece4; font-size: 0.8rem; }
.modal-info-row:last-child { border: none; }
.modal-info-key { color: var(--mid-gray); }
.modal-info-val { color: var(--charcoal); font-weight: 400; text-align: right; }
.modal-video-link { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); text-decoration: none; padding: 12px 16px; border: 1px solid rgba(201,168,76,0.3); transition: all 0.2s; }
.modal-video-link:hover { background: var(--gold); color: white; }

/* STATES */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 100px 48px; gap: 20px; }
.spinner { width: 36px; height: 36px; border: 2px solid #ede9e2; border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
.loading-text { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; color: var(--mid-gray); font-style: italic; }
.empty-state { text-align: center; padding: 80px 48px; }
.empty-state h3 { font-family: 'Cormorant Garamond', serif; font-size: 2rem; font-weight: 300; color: var(--mid-gray); margin-bottom: 10px; }
.empty-state p { color: var(--light-gray); font-size: 0.88rem; }
.error-note { background: #fff9ee; border-left: 3px solid var(--gold); margin: 0 48px 20px; padding: 16px 20px; font-size: 0.82rem; color: var(--accent); }

/* ─── PAGINATION ─── */
.pagination-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 32px 48px 60px; flex-wrap: wrap;
}
.page-btn {
  min-width: 42px; height: 42px; padding: 0 12px;
  display: flex; align-items: center; justify-content: center;
  background: white; border: 1px solid #ede9e2;
  font-family: 'DM Sans', sans-serif; font-size: 0.82rem;
  cursor: pointer; color: var(--charcoal); transition: all 0.2s;
  border-radius: 0;
}
.page-btn:hover { border-color: var(--gold); color: var(--gold); }
.page-btn.active { background: var(--charcoal); color: var(--gold); border-color: var(--charcoal); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-btn.prev-btn, .page-btn.next-btn { font-size: 1.1rem; padding: 0 16px; }
.page-dots { color: var(--mid-gray); padding: 0 4px; line-height: 42px; }
@media (max-width: 768px) {
  .pagination-wrap { padding: 20px 16px 40px; gap: 6px; }
  .page-btn { min-width: 36px; height: 36px; font-size: 0.78rem; }
}

/* ─── LIGHTBOX ─── */
.lightbox-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.95); backdrop-filter: blur(12px);
  align-items: center; justify-content: center;
  animation: fadeIn 0.22s ease;
}
.lightbox-overlay.open { display: flex; }
.lightbox-inner {
  position: relative; max-width: 98vw; max-height: 96vh;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-img {
  max-width: 96vw; max-height: 92vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  animation: scaleIn 0.25s ease;
  touch-action: pinch-zoom;
  user-select: none;
}
.lightbox-close {
  position: fixed; top: 18px; right: 18px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  color: white; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer; border-radius: 0;
  transition: background 0.2s; z-index: 1010;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }
.lightbox-nav-btn {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: white; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; cursor: pointer; border-radius: 0;
  transition: background 0.2s; z-index: 1010;
}
.lightbox-nav-btn:hover { background: rgba(255,255,255,0.25); }
.lightbox-nav-btn.lb-prev { left: 16px; }
.lightbox-nav-btn.lb-next { right: 16px; }
.lightbox-counter {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.6); font-size: 0.78rem; letter-spacing: 0.12em;
  font-family: 'DM Sans', sans-serif; z-index: 1010;
}
@media (max-width: 768px) {
  .lightbox-nav-btn { width: 44px; height: 44px; font-size: 20px; }
  .lightbox-nav-btn.lb-prev { left: 8px; }
  .lightbox-nav-btn.lb-next { right: 8px; }
}

/* ─── TOUCH SWIPE on cards ─── */
.card-img-wrap { touch-action: pan-y; cursor: grab; }
.card-img-wrap:active { cursor: grabbing; }

/* FOOTER */
footer { background: var(--charcoal); padding: 56px 48px 32px; border-top: 1px solid rgba(201,168,76,0.15); }
.footer-inner { display: grid; grid-template-columns: 1.8fr 1fr 1fr; gap: 48px; margin-bottom: 40px; align-items: start; }
.footer-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-logo img { height: 40px; opacity: 0.85; }
.footer-logo-text { font-family: 'Cormorant Garamond', serif; font-size: 1rem; letter-spacing: 0.2em; color: var(--gold); }
.footer-tagline { font-size: 0.78rem; color: rgba(255,255,255,0.38); line-height: 1.7; max-width: 280px; letter-spacing: 0.04em; }
.footer-contact { display: flex; flex-direction: column; gap: 12px; }
.footer-contact-item { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: rgba(255,255,255,0.55); letter-spacing: 0.04em; text-decoration: none; transition: color 0.2s; }
.footer-contact-item:hover { color: var(--gold-light); }
.footer-contact-item svg { flex-shrink: 0; opacity: 0.6; }
.footer-col-title { font-family: 'Cormorant Garamond', serif; font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
.footer-social { display: flex; gap: 14px; margin-top: 4px; }
.footer-social a { width: 36px; height: 36px; border: 1px solid rgba(201,168,76,0.25); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.45); text-decoration: none; transition: all 0.25s; font-size: 0.75rem; }
.footer-social a:hover { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,0.08); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 28px; border-top: 1px solid rgba(255,255,255,0.06); }
.footer-copy { font-size: 0.68rem; color: rgba(255,255,255,0.22); letter-spacing: 0.08em; }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: 0.68rem; color: rgba(255,255,255,0.22); letter-spacing: 0.06em; text-decoration: none; transition: color 0.2s; }
.footer-legal a:hover { color: rgba(255,255,255,0.5); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }


/* ─── ADMIN PANEL ─── */
.admin-panel { display: none; padding: 48px; max-width: 1000px; margin: 0 auto; }
.admin-panel.visible { display: block; }
.admin-title { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; font-weight: 300; color: var(--charcoal); margin-bottom: 6px; }
.admin-sub { font-size: 0.82rem; color: var(--mid-gray); margin-bottom: 36px; }

.form-section { margin-bottom: 32px; }
.form-section-title { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--gold-pale); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1 / -1; }

.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid-gray); }
.form-field input, .form-field select, .form-field textarea {
  background: white; border: 1px solid #e0dbd2;
  padding: 11px 14px; font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem; color: var(--charcoal); outline: none;
  transition: border-color 0.2s; border-radius: 0; resize: vertical;
  width: 100%;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.form-field select {
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a7a72'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-field select option { background: white; color: var(--charcoal); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--gold); outline: none; }
.form-field input::placeholder { color: #b0aba3; }
.form-field textarea { min-height: 100px; }

/* Photo Upload Zone */
.photo-zone {
  border: 2px dashed #d0cbc2; padding: 32px; text-align: center;
  cursor: pointer; transition: all 0.2s; background: white; position: relative;
}
.photo-zone:hover, .photo-zone.drag-over { border-color: var(--gold); background: var(--gold-pale); }
.photo-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.photo-zone-icon { font-size: 2rem; margin-bottom: 10px; opacity: 0.4; }
.photo-zone-text { font-size: 0.84rem; color: var(--mid-gray); }
.photo-zone-sub { font-size: 0.72rem; color: var(--light-gray); margin-top: 4px; }

.photo-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.photo-preview-item { position: relative; width: 100px; height: 80px; }
.photo-preview-item img { width: 100%; height: 100%; object-fit: cover; border: 2px solid #ede9e2; }
.photo-preview-item .remove-photo {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px;
  background: #c0392b; color: white; border: none; border-radius: 50%;
  font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.photo-preview-item .main-badge {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(201,168,76,0.9); color: white;
  font-size: 0.6rem; letter-spacing: 0.08em; text-align: center; padding: 2px;
}

.features-input-wrap { display: flex; gap: 8px; }
.features-input-wrap input { flex: 1; }
.features-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.features-tag-item {
  display: flex; align-items: center; gap: 5px;
  background: var(--gold-pale); color: var(--accent);
  font-size: 0.72rem; padding: 4px 10px;
}
.features-tag-item button { background: none; border: none; cursor: pointer; color: var(--accent); font-size: 14px; line-height: 1; padding: 0; }

.form-actions { display: flex; gap: 12px; margin-top: 36px; padding-top: 24px; border-top: 1px solid #ede9e2; }
.btn-lg { padding: 14px 40px; font-size: 0.8rem; }

/* Saved properties list in admin */
.saved-props-list { margin-top: 48px; }
.saved-prop-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid #f0ece4;
  animation: fadeUp 0.3s ease both;
}
.saved-prop-thumb { width: 60px; height: 48px; object-fit: cover; flex-shrink: 0; background: var(--cream); }
.saved-prop-info { flex: 1; }
.saved-prop-title { font-size: 0.88rem; font-weight: 400; color: var(--charcoal); }
.saved-prop-meta { font-size: 0.74rem; color: var(--mid-gray); margin-top: 2px; }
.saved-prop-price { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; color: var(--gold); }
.saved-prop-actions { display: flex; gap: 8px; }
.btn-sm { padding: 7px 16px; font-size: 0.7rem; }
.btn-danger { background: transparent; border: 1px solid #d0cbc2; color: #c0392b; }
.btn-danger:hover { border-color: #c0392b; background: #fff5f5; }

.toast {
  position: fixed; bottom: 32px; right: 32px; z-index: 999;
  background: var(--charcoal); color: white;
  padding: 14px 24px; font-size: 0.84rem;
  border-left: 3px solid var(--gold);
  animation: fadeUp 0.3s ease;
  display: none;
}
.toast.show { display: block; }

/* ─── GLOBAL SEARCH BAR ─── */
.search-bar-wrap {
  background: var(--charcoal);
  border-bottom: 1px solid rgba(201,168,76,0.2);
  padding: 12px 48px;
  display: flex; align-items: center; gap: 12px;
}
.search-bar-inner {
  display: flex; align-items: center; gap: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(201,168,76,0.25);
  flex: 1; max-width: 600px;
  transition: border-color 0.2s;
}
.search-bar-inner:focus-within { border-color: var(--gold); }
.search-bar-icon {
  padding: 0 14px; color: rgba(201,168,76,0.6); display: flex; align-items: center; flex-shrink: 0;
}
.search-bar-input {
  flex: 1; background: transparent; border: none; outline: none;
  padding: 11px 0; font-family: 'DM Sans', sans-serif;
  font-size: 0.84rem; color: rgba(255,255,255,0.85);
  letter-spacing: 0.02em;
}
.search-bar-input::placeholder { color: rgba(255,255,255,0.3); }
.search-bar-clear {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.3); padding: 0 14px; font-size: 18px;
  line-height: 1; transition: color 0.2s; display: none;
}
.search-bar-clear:hover { color: var(--gold); }
.search-bar-clear.visible { display: flex; align-items: center; }
.search-bar-label {
  font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.3); white-space: nowrap; margin-left: 4px;
}
@media (max-width: 768px) {
  .search-bar-wrap { padding: 10px 16px; }
  .search-bar-label { display: none; }
}

/* ─── VISIT COUNTER — EYE BUTTON (header inline) ─── */
.eye-btn-wrap {
  position: relative;
  display: none;
  align-items: center;
  margin-left: 6px;
}
.eye-btn-wrap.admin-visible { display: flex; }

#eyeVisitBtn {
  display: flex;
  width: 32px; height: 32px;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.45);
  border-radius: 50%;
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}
#eyeVisitBtn:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.15);
}
#eyeVisitBtn svg { color: var(--gold); }

#visitCounterBadge {
  display: none;
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 9999;
  background: var(--charcoal);
  border: 1px solid rgba(201,168,76,0.35);
  padding: 16px 20px; min-width: 200px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border-radius: 2px;
  animation: fadeUp 0.3s ease;
  transform-origin: top right;
}
#visitCounterBadge.panel-visible { display: block; }
.vcb-title {
  font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.vcb-title::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 6px var(--gold); animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.vcb-row { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
.vcb-row:last-child { border: none; }
.vcb-key { font-size: 0.7rem; color: rgba(255,255,255,0.4); }
.vcb-val { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; color: white; font-weight: 300; }
.vcb-note { font-size: 0.6rem; color: rgba(201,168,76,0.5); margin-top: 10px; letter-spacing: 0.05em; }

/* ─── MODAL ACTION BUTTONS ─── */
.modal-action-btns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px;
}
.modal-btn-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 10px; background: #25D366; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: white;
  transition: all 0.2s; text-decoration: none;
}
.modal-btn-whatsapp:hover { background: #1da851; transform: translateY(-1px); }
.modal-btn-share {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 10px; background: transparent;
  border: 1px solid rgba(201,168,76,0.4); cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold);
  transition: all 0.2s;
}
.modal-btn-share:hover { background: rgba(201,168,76,0.1); border-color: var(--gold); transform: translateY(-1px); }

/* ═══════════════════════════════════════
   RESPONSIVE — TABLET & MOBILE
═══════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
  header { padding: 0 24px; }
  .hero { padding: 60px 24px; }
  .hero-agent { flex: 0 0 300px; height: 420px; }
  .properties-grid { padding: 20px 24px 60px; grid-template-columns: repeat(2, 1fr); }
  .admin-panel { padding: 36px 24px; }
}

/* Mobile — eye button stays small but visible */
@media (max-width: 768px) {
  .eye-btn-wrap { margin-left: 6px; }
  #visitCounterBadge { right: -16px; min-width: 170px; }
  /* Header */
  header {
    padding: 0 16px;
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .logo-wrap { flex-shrink: 0; }
  .logo-img { height: 40px; width: 40px; }
  .logo-name { font-size: 1.1rem; }
  .logo-sub { font-size: 0.5rem; }
  nav {
    display: flex;
    gap: 0;
    width: 100%;
    justify-content: space-around;
    border-top: 1px solid rgba(201,168,76,0.15);
    padding-top: 8px;
    padding-bottom: 4px;
  }
  nav a {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    padding: 6px 10px;
    color: rgba(255,255,255,0.7);
  }
  nav a.active { color: var(--gold); }

  /* Hero */
  .hero {
    padding: 40px 16px 40px;
    flex-direction: column-reverse;
    gap: 0;
  }
  .hero-inner { max-width: 100%; }
  .hero h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .hero-sub { font-size: 0.84rem; max-width: 100%; }
  .hero-stats { gap: 24px; margin-top: 28px; }
  .hero-stat-num { font-size: 1.5rem; }
  .hero-agent {
    flex: none;
    width: 100%;
    height: 260px;
    margin-right: 0;
    margin-bottom: -20px;
  }
  .hero-agent img {
    object-position: top center;
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  }

  /* Filters */
  .filters-bar {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px;
    background: #f5f0e8;
  }
  .filter-label { width: 100%; font-size: 0.68rem; margin-bottom: 2px; }
  .filter-group {
    flex: 1 1 calc(50% - 8px);
    min-width: calc(50% - 8px);
    max-width: calc(50% - 8px);
  }
  .filter-group input,
  .filter-group select {
    width: 100% !important;
    font-size: 0.82rem;
    background: #f5f0e8 !important;
    background-color: #f5f0e8 !important;
  }
  .filter-sep { display: none; }
  .filters-bar .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: calc(50% - 8px);
    padding: 11px;
    font-size: 0.72rem;
    justify-content: center;
  }

  /* Grid */
  .results-header { padding: 20px 16px 8px; }
  .properties-grid { padding: 12px 16px 48px; grid-template-columns: 1fr; gap: 16px; }

  /* Cards */
  .card-img-wrap { height: 220px; }

  /* Modal */
  .modal-content { padding: 20px 16px 28px; max-height: 90vh; }
  .modal-gallery { height: 300px; }
  .modal-thumbs { gap: 6px; }
  .modal-thumb { width: 68px; height: 50px; }
  .modal-grid { grid-template-columns: 1fr; gap: 16px; }
  .modal-specs-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-close { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 1.2rem; }

  /* Admin form */
  .admin-panel { padding: 20px 16px; }
  .admin-title { font-size: 1.6rem; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .btn-lg { width: 100%; text-align: center; padding: 14px 20px; }
  .saved-prop-row { flex-wrap: wrap; gap: 10px; }
  .saved-prop-actions { width: 100%; justify-content: flex-end; }
  .features-input-wrap { flex-direction: column; }

  /* Footer */
  footer { padding: 40px 16px 24px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; margin-bottom: 28px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .footer-legal { justify-content: center; }

  /* Toast */
  .toast { bottom: 16px; right: 16px; left: 16px; font-size: 0.8rem; }
}

/* Small phones */
@media (max-width: 380px) {
  .logo-name { font-size: 0.95rem; }
  nav a { font-size: 0.6rem; padding: 4px 6px; }
  .hero h1 { font-size: 1.8rem; }
}

/* ─── LOGIN MODAL ─── */
.login-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.login-overlay.open { opacity: 1; pointer-events: all; }
.login-box {
  background: white; width: 100%; max-width: 400px; margin: 20px;
  padding: 40px 36px 36px;
  animation: fadeUp 0.3s ease;
}
.login-logo {
  text-align: center; margin-bottom: 28px;
}
.login-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem; font-weight: 300;
  color: var(--charcoal); text-align: center; margin-bottom: 4px;
}
.login-sub {
  font-size: 0.75rem; color: var(--mid-gray);
  text-align: center; margin-bottom: 28px; letter-spacing: 0.08em;
}
.login-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.login-field label { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid-gray); }
.login-field input {
  border: 1px solid #e0dbd2; padding: 12px 14px;
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
  color: var(--charcoal); outline: none; transition: border-color 0.2s;
}
.login-field input:focus { border-color: var(--gold); }
.login-error {
  background: #fff5f5; border-left: 3px solid #c0392b;
  color: #c0392b; font-size: 0.78rem;
  padding: 10px 14px; margin-bottom: 16px; display: none;
}
.login-error.show { display: block; }
.login-btn {
  width: 100%; padding: 14px;
  background: var(--charcoal); color: white;
  border: none; cursor: pointer; font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem; letter-spacing: 0.15em; text-transform: uppercase;
  transition: background 0.2s; margin-top: 8px;
}
.login-btn:hover { background: var(--gold); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: var(--mid-gray); line-height: 1;
}
.login-box { position: relative; }

  .whatsapp-flotante {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    animation: wpp-entrada 0.5s ease forwards;
  }

  @keyframes wpp-entrada {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .whatsapp-flotante .wpp-tooltip {
    background: #fff;
    color: #111;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
  }

  .whatsapp-flotante:hover .wpp-tooltip {
    opacity: 1;
    transform: translateX(0);
  }

  .whatsapp-flotante .wpp-icono {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
  }

  .whatsapp-flotante:hover .wpp-icono {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.7);
  }

  .whatsapp-flotante .wpp-icono svg {
    width: 32px;
    height: 32px;
    fill: #fff;
  }

  /* Pulso animado */
  .wpp-pulso {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.4);
    animation: pulso 2s infinite;
    right: 30px;
    bottom: 30px;
    z-index: 9999;
  }

  @keyframes pulso {
    0%   { transform: scale(1);   opacity: 0.7; }
    70%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
  }

  .whatsapp-flotante {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    animation: wpp-entrada 0.5s ease forwards;
  }

  @keyframes wpp-entrada {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .whatsapp-flotante .wpp-tooltip {
    background: #fff;
    color: #111;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
  }

  .whatsapp-flotante:hover .wpp-tooltip {
    opacity: 1;
    transform: translateX(0);
  }

  .whatsapp-flotante .wpp-icono {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
  }

  .whatsapp-flotante:hover .wpp-icono {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.7);
  }

  .whatsapp-flotante .wpp-icono svg {
    width: 32px;
    height: 32px;
    fill: #fff;
  }

  /* Pulso animado */
  .wpp-pulso {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.4);
    animation: pulso 2s infinite;
    right: 30px;
    bottom: 30px;
    z-index: 9999;
  }

  @keyframes pulso {
    0%   { transform: scale(1);   opacity: 0.7; }
    70%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
  }
