/* ================================
   PROPERTY LISTING PAGE STYLES
   PropiedadesVE Design System v2
================================ */

:root {
  /* Palette */
  --primary: #1A3C6E;
  --primary-light: #2A5494;
  --primary-dark: #0F2440;
  --accent: #F59E0B;
  --accent-hover: #D97706;
  --success: #16A34A;
  --danger: #EF4444;

  /* Surfaces */
  --bg-page: #FAFAFA;
  --bg-card: #FFFFFF;
  --bg-muted: #F3F4F6;
  --border: #E5E7EB;
  --border-light: #F0F0F0;

  /* Text */
  --text-primary: #111827;
  --text-body: #4B5563;
  --text-muted: #9CA3AF;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07);

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --transition: all 0.2s ease;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-body);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ================================
   HEADER (fallback — nav.css overrides)
================================ */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
}

.logo span { color: var(--accent); }

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.nav-links { display: flex; gap: 8px; }

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-body);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active { background: var(--bg-muted); color: var(--primary); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: inherit;
}

.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-outline { border: 1.5px solid var(--border); color: var(--text-body); background: transparent; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
  gap: 4px;
}

.mobile-menu.show { display: flex; }

.mobile-menu-link {
  padding: 10px 0;
  font-weight: 500;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-light);
}

/* ================================
   PAGE HEADER — compact, white
================================ */
.listing-hero {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.breadcrumb-nav a { color: var(--text-muted); }
.breadcrumb-nav a:hover { color: var(--primary); }
.breadcrumb-nav i { font-size: 0.6rem; }

.listing-hero h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.listing-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ================================
   FILTERS BAR — sticky below nav
================================ */
.filters-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 70px;
  z-index: 90;
  box-shadow: var(--shadow-xs);
}

.filters-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-body);
  background: var(--bg-card);
  cursor: pointer;
  height: 40px;
}

.filter-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 60, 110, 0.08); }

.filter-btn {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  height: 40px;
}

.filter-btn:hover { background: var(--accent-hover); }

/* "Más filtros" outline button */
.filter-btn-outline {
  padding: 8px 16px;
  background: transparent;
  color: var(--text-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  height: 40px;
}
.filter-btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* "Limpiar" link style */
.filters-inner .btn-outline.btn-sm {
  background: transparent;
  border: none;
  padding: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.filters-inner .btn-outline.btn-sm:hover {
  color: var(--primary);
  background: transparent;
}

/* Collapsible extra filters row — smooth expand */
.filters-extra {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}

/* ================================
   LISTING SECTION
================================ */
.listing-section { padding: 32px 0 48px; }

.listing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.listing-count {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ================================
   EMPTY STATE
================================ */
.listing-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.listing-empty i {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
  opacity: 0.4;
}

.listing-empty p { font-size: 1rem; }

/* ================================
   PAGINATION
================================ */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 32px 0 0;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-body);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.page-link:hover { background: var(--bg-muted); color: var(--primary); }
.page-link.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-link.disabled { opacity: 0.4; pointer-events: none; }

/* ================================
   BOTTOM NAV — mobile only
================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 8px 0 env(safe-area-inset-bottom, 0);
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.bottom-nav-item i { font-size: 1.3rem; }
.bottom-nav-item.active,
.bottom-nav-item:hover { color: var(--accent); }

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 992px) {
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links, .nav-actions { display: none; }
  .mobile-menu-btn { display: block; }
  .listing-hero h1 { font-size: 1.25rem; }
  .bottom-nav { display: flex; }
  .listing-section { padding-bottom: 80px; }

  /* Filters: scrollable row on mobile */
  .filters-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; top: 0; }
  .filters-inner { flex-wrap: nowrap; min-width: max-content; }
  .filters-extra { flex-wrap: nowrap; min-width: max-content; }
  .filter-select { min-height: 44px; min-width: 150px; }
  .filter-btn { min-height: 44px; white-space: nowrap; }
  .filter-btn-outline { min-height: 44px; }
}

@media (max-width: 540px) {
  .listing-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .listing-hero { padding: 16px 0; }

  /* Filters stack vertically on very small screens */
  .filters-inner { flex-wrap: wrap; min-width: 0; }
  .filters-extra { flex-wrap: wrap; min-width: 0; }
  .filter-select { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .filter-btn { flex: 1 1 calc(50% - 6px); }
  .filters-extra .filter-select { flex: 1 1 calc(50% - 6px); }
}
