/* === S-Canning SSR Pages — Brutalist styling === */

/* Page wrapper */
.page-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 2rem 0;
}

/* === BREADCRUMB === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1.5rem 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.breadcrumb-link {
  color: var(--text3);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb-link:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb-sep {
  color: var(--text3);
  margin: 0 2px;
}

.breadcrumb-current {
  color: var(--text);
}

/* === PAGE HEADER === */
.page-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 2px solid var(--border-bold);
  margin-bottom: 1.5rem;
}

.page-header-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -1.5px;
  text-transform: uppercase;
  line-height: 1.1;
  margin: 0;
}

.page-header-sub {
  color: var(--text2);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* === COMPARE BUTTON (barrio page) === */
.btn-compare-barrio {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border-bold);
  box-shadow: 3px 3px 0 var(--border-bold);
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-compare-barrio:hover {
  background: var(--border-bold);
  color: white;
  box-shadow: 1px 1px 0 var(--border-bold);
  transform: translate(2px, 2px);
}

/* === STATS BAR === */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0;
  border: 2px solid var(--border-bold);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.stat-item {
  padding: 1rem;
  text-align: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.stat-item:last-child {
  border-right: none;
}

.stat-item.stat-highlight {
  background: var(--accent);
  color: white;
}

.stat-item.stat-highlight .stat-value {
  color: white;
}

.stat-item.stat-highlight .stat-label {
  color: rgba(255,255,255,0.7);
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
  font-weight: 700;
}

/* === PAGE BODY (2-column) === */
.page-body {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  margin-bottom: 3rem;
}

.page-col-main {
  min-width: 0;
}

.page-col-side {
  min-width: 0;
}

/* === PAGE SECTIONS === */
.page-section {
  margin-bottom: 2rem;
}

.page-section h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text3);
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.page-description {
  color: var(--text2);
  font-size: 0.95rem;
  line-height: 1.7;
}

.page-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* === AMENITIES GRID === */
.amenities-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.amenity-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text2);
  padding: 6px 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.amenity-item.has {
  border-color: var(--green);
  background: var(--green-light);
}

.amenity-item.no {
  opacity: 0.5;
}

.amenity-icon {
  font-weight: 800;
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.amenity-item.has .amenity-icon {
  color: var(--green);
}

.amenity-item.no .amenity-icon {
  color: var(--text3);
}

/* === PROS/CONS === */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.pros-list h3,
.cons-list h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pros-list h3 { color: var(--green); }
.cons-list h3 { color: var(--red); }

/* pro-item and con-item already styled in style.css */

/* === LISTINGS TABLE === */
.listings-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.listing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.listing-row:hover {
  border-color: var(--border-bold);
  box-shadow: var(--shadow-sm);
  transform: translate(-1px, -1px);
}

.listing-row.current {
  border-color: var(--border-bold);
  background: var(--accent-light);
}

.listing-row-left {
  flex: 1;
  min-width: 0;
}

.listing-row-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-row-meta {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 2px;
}

.listing-row-right {
  text-align: right;
  white-space: nowrap;
  margin-left: 1rem;
}

.listing-row-price {
  font-weight: 800;
  color: var(--green);
  font-size: 0.95rem;
}

.listing-row-m2 {
  font-size: 0.75rem;
  color: var(--text3);
}

/* === SIMILAR BARRIOS LINKS === */
.similar-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.similar-link {
  display: block;
  padding: 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.similar-link:hover {
  border-color: var(--border-bold);
  box-shadow: var(--shadow-sm);
  transform: translate(-1px, -1px);
}

.similar-link-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.similar-link-info {
  font-size: 0.75rem;
  color: var(--text2);
}

/* === BARRIO QUICK STATS (on lote page) === */
.barrio-quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.75rem;
}

.barrio-quick-stats span {
  font-size: 0.8rem;
  padding: 4px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text2);
}

/* === CTA SECTION === */
.cta-section {
  background: var(--accent);
  color: white;
  border: 2px solid var(--border-bold);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  text-align: center;
  margin: 2rem 0;
}

.cta-section h2 {
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.cta-subtitle {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.cta-form {
  display: flex;
  gap: 8px;
  max-width: 450px;
  margin: 0 auto 1rem;
}

.cta-input {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 0.9rem;
  font-family: var(--font);
}

.cta-input::placeholder {
  color: rgba(255,255,255,0.5);
}

.cta-input:focus {
  outline: none;
  border-color: white;
  background: rgba(255,255,255,0.15);
}

.cta-submit {
  background: white !important;
  color: var(--accent) !important;
  border-color: white !important;
  white-space: nowrap;
}

.cta-submit:hover {
  background: var(--surface2) !important;
}

.cta-wa {
  display: inline-flex;
  background: #25d366 !important;
  color: white !important;
  border-color: #25d366 !important;
  text-decoration: none;
  margin-top: 0.5rem;
}

.cta-wa:hover {
  background: #1da851 !important;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

.cta-wa svg {
  width: 16px;
  height: 16px;
}

.cta-success {
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1rem;
}

/* === BACK LINK === */
.back-link {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

/* === NEWS ARTICLE PAGE === */
.news-article {
  margin-bottom: 2rem;
}

.news-article-header {
  padding: 2rem 0;
  border-bottom: 2px solid var(--border-bold);
  margin-bottom: 2rem;
}

.news-article-header h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.2;
  margin: 1rem 0 0.75rem;
}

.news-article-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text3);
  font-weight: 600;
}

.news-article-meta a {
  color: var(--text2);
}

.news-article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text2);
  max-width: 750px;
  margin-bottom: 2rem;
}

.news-article-barrios {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.news-article-barrios h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text3);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.related-barrio-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* === COMPARE PAGE === */

/* Selector page */
.compare-selector {
  max-width: 600px;
  margin: 2rem auto 4rem;
}

.compare-search-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.compare-search {
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--border-bold);
  padding: 14px 16px;
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.compare-search:focus {
  outline: none;
  box-shadow: var(--shadow);
  transform: translate(-1px, -1px);
}

.compare-search::placeholder {
  color: var(--text3);
  font-weight: 500;
}

.compare-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 2px solid var(--border-bold);
  border-top: none;
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
}

.compare-dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
}

.compare-dropdown-item:last-child {
  border-bottom: none;
}

.compare-dropdown-item:hover {
  background: var(--accent-light);
}

.compare-dropdown-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.compare-dropdown-meta {
  font-size: 0.75rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.compare-selected {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  min-height: 44px;
}

.compare-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 2px solid var(--border-bold);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.compare-tag-x {
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--text3);
  padding: 0 2px;
  margin-left: 4px;
  transition: color var(--transition);
}

.compare-tag-x:hover {
  color: var(--red);
}

.compare-go {
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: 16px;
}

.compare-go:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Comparison table */
.compare-page .page-header {
  text-align: center;
}

.compare-table-wrap {
  overflow-x: auto;
  margin-bottom: 2rem;
  border: 2px solid var(--border-bold);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  table-layout: fixed;
}

.compare-header-row {
  background: var(--accent);
  color: white;
}

.compare-header-cell {
  padding: 1.25rem 1rem;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.15);
  vertical-align: top;
  width: calc((100% - 160px) / var(--cols));
}

.compare-header-cell:last-child {
  border-right: none;
}

.compare-header-name {
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.compare-header-partido {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.7;
  margin-top: 6px;
}

.compare-header-cell .nb-card-zone {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
  color: white;
}

.compare-label-cell {
  padding: 10px 16px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text3);
  background: var(--surface);
  border-right: 2px solid var(--border-bold);
  white-space: nowrap;
  width: 160px;
  min-width: 160px;
  position: sticky;
  left: 0;
  z-index: 2;
}

.compare-value-cell {
  padding: 10px 16px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  border-right: 1px solid var(--border);
}

.compare-value-cell:last-child {
  border-right: none;
}

.compare-value-cell.compare-best {
  color: var(--green);
  font-weight: 800;
  background: var(--green-light);
}

.compare-row {
  background: var(--surface);
}

.compare-row-alt {
  background: var(--surface2);
}

.compare-row-alt .compare-label-cell {
  background: var(--surface2);
}

.compare-section-divider {
  background: var(--accent);
}

.compare-section-divider td {
  padding: 8px 16px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: white;
  text-align: center;
}

.compare-check {
  color: var(--green);
  font-weight: 800;
  font-size: 1.1rem;
}

.compare-cross {
  color: var(--text3);
  font-weight: 400;
  font-size: 1.1rem;
  opacity: 0.4;
}

.compare-footer-row {
  border-top: 2px solid var(--border-bold);
}

.compare-footer-row .compare-label-cell {
  background: var(--surface);
}

.compare-footer-row .compare-value-cell {
  padding: 1rem;
  background: var(--surface);
}

/* === DISTANCE MAP SECTION === */
.dmap-section {
  margin: 2rem 0;
  border: 2px solid var(--border-bold);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.dmap-header {
  padding: 1.5rem 1.5rem 0;
}

.dmap-header h2 {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  margin: 0 0 4px;
  padding: 0;
  border: none;
}

.dmap-subtitle {
  font-size: 0.8rem;
  color: var(--text3);
  font-weight: 500;
  margin: 0;
}

.dmap-tabs {
  display: flex;
  gap: 0;
  padding: 1rem 1.5rem 0;
  flex-wrap: wrap;
}

.dmap-tab {
  padding: 8px 16px;
  background: var(--surface);
  border: 2px solid var(--border-bold);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
  margin-right: -2px;
}

.dmap-tab:hover {
  background: var(--surface2);
  color: var(--text);
}

.dmap-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--border-bold);
  z-index: 1;
  position: relative;
}

.dmap-map-container {
  margin: 1rem 1.5rem 0;
  border: 2px solid var(--border-bold);
  box-shadow: var(--shadow-sm);
}

.dmap-map {
  height: 380px;
  width: 100%;
  background: var(--surface2);
  z-index: 1;
}

/* Leaflet overrides for brutalist style */
.dmap-map .leaflet-control-zoom a {
  border-radius: 0 !important;
  border: 2px solid var(--border-bold) !important;
  box-shadow: var(--shadow-sm) !important;
}

.dmap-map .leaflet-control-attribution {
  font-family: var(--font);
  font-size: 0.6rem;
  background: rgba(255,255,255,0.85) !important;
}

/* Custom map markers */
.dmap-marker-barrio,
.dmap-marker-dest,
.dmap-marker-nearby {
  background: transparent !important;
  border: none !important;
}

.dmap-marker-dot {
  width: 20px;
  height: 20px;
  border: 3px solid white;
  box-shadow: 0 0 0 2px #1a1a1a, 2px 2px 0 2px rgba(0,0,0,0.2);
}

.dmap-marker-sm {
  width: 10px;
  height: 10px;
  border: 2px solid white;
  box-shadow: 0 0 0 1px #1a1a1a;
}

.dmap-route-info {
  padding: 1rem 1.5rem;
}

.dmap-route-loading {
  font-size: 0.85rem;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dmap-route-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.75rem;
}

.dmap-route-distance {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
}

.dmap-route-sep {
  color: var(--text3);
  font-size: 1.2rem;
}

.dmap-route-time {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text2);
}

.dmap-transport {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dmap-transport-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text2);
}

.dmap-transport-icon {
  font-size: 1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.dmap-nearby {
  border-top: 2px solid var(--border-bold);
  padding: 1.25rem 1.5rem;
}

.dmap-nearby-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text3);
  margin-bottom: 0.75rem;
}

.dmap-nearby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.dmap-nearby-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  transition: all var(--transition);
  cursor: default;
}

.dmap-nearby-item:hover {
  border-color: var(--border-bold);
  box-shadow: var(--shadow-sm);
  transform: translate(-1px, -1px);
}

.dmap-nearby-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.dmap-nearby-name {
  flex: 1;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dmap-nearby-dist {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text3);
  white-space: nowrap;
}

/* === COMPARE BASKET HUD === */
.compare-hud {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--border-bold);
  color: white;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  font-family: var(--font);
}

.compare-hud-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.compare-hud-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.15);
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.compare-hud-chip-x {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 2px;
  line-height: 1;
}
.compare-hud-chip-x:hover { color: white; }

.compare-hud-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.compare-hud-count {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
}

.compare-hud-btn {
  background: #16a34a;
  color: white;
  border: none;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: var(--font);
}
.compare-hud-btn:hover { background: #15803d; }
.compare-hud-btn:disabled { opacity: 0.5; cursor: default; }

.compare-hud-clear {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.6);
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compare-hud-clear:hover { color: white; border-color: white; }

/* === COMPARE CHECKOUT === */
.compare-checkout {
  background: var(--border-bold);
  color: white;
  padding: 2.5rem;
  margin: 2rem 0;
  border: 2px solid var(--border-bold);
}
.compare-checkout h2 {
  font-size: 1.6rem;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}
.compare-checkout-sub {
  opacity: 0.8;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.compare-checkout-chat {
  background: white;
  color: var(--text);
  border: 2px solid rgba(255,255,255,0.2);
  max-height: 400px;
  display: flex;
  flex-direction: column;
}
.compare-checkout-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  max-height: 300px;
}
.compare-checkout-msgs .chat-msg {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
}
.compare-checkout-msgs .chat-msg.bot {
  background: #f3f4f6;
  margin-right: 15%;
}
.compare-checkout-msgs .chat-msg.user {
  background: var(--border-bold);
  color: white;
  margin-left: 15%;
}
.compare-checkout-msgs .chat-msg.typing {
  opacity: 0.6;
  font-style: italic;
}
.compare-checkout-form {
  display: flex;
  gap: 0;
  border-top: 2px solid #e5e7eb;
}
.compare-checkout-input {
  flex: 1;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-family: var(--font);
  outline: none;
}
.compare-checkout-form .btn {
  border: none;
  border-left: 2px solid #e5e7eb;
}
.compare-checkout-lead {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.2);
}
.compare-checkout-lead p {
  opacity: 0.9;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* === BARRIO IMAGE GALLERY === */
.barrio-gallery {
  margin-bottom: 1.5rem;
}
.barrio-gallery-main {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
  border: 2px solid var(--border-bold);
  background: #f0f0f0;
}
.barrio-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.gallery-nav:hover { background: rgba(0,0,0,0.8); }
.gallery-prev { left: 0; }
.gallery-next { right: 0; }
.gallery-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font);
}
.barrio-gallery-thumbs {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.gallery-thumb {
  width: 80px;
  height: 56px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  flex-shrink: 0;
  transition: opacity 0.2s, border-color 0.2s;
}
.gallery-thumb:hover { opacity: 0.9; }
.gallery-thumb.active {
  border-color: var(--border-bold);
  opacity: 1;
}
.gallery-more {
  width: 80px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e5e5e5;
  font-weight: 700;
  font-size: 0.85rem;
  color: #666;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s;
}
.gallery-more:hover {
  background: #d4d4d4;
  color: #333;
}
.gallery-thumb-hidden {
  display: none;
}

/* === MASTERPLAN === */
.masterplan-wrap {
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s;
}
.masterplan-wrap:hover { border-color: var(--border-bold); }
.masterplan-img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: #f5f5f5;
  display: block;
  transition: max-height 0.4s;
}
.masterplan-wrap.expanded .masterplan-img {
  max-height: none;
}
.masterplan-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  pointer-events: none;
  transition: opacity 0.3s;
}
.masterplan-wrap.expanded .masterplan-hint { opacity: 0; }

/* === DOCUMENT LINKS === */
.docs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--border-bold);
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s;
}
.doc-link:hover {
  background: #f5f5f5;
}

/* === LIFESTYLE BANNERS === */
.lifestyle-banner {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  border-top: 2px solid var(--border-bold);
  border-bottom: 2px solid var(--border-bold);
  margin: 2rem 0;
}

.lifestyle-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.85);
}

.lifestyle-banner-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: var(--font);
}

/* === STATUS BADGES === */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 2px solid var(--status-color, #1a1a1a);
  color: var(--status-color, #1a1a1a);
  background: transparent;
}

.barrio-status-desc {
  font-size: 0.85rem;
  color: #666;
  margin: 4px 0 12px;
}

/* === STATUS FILTERS === */
.status-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
  padding: 0;
}

.status-filter {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid #ddd;
  background: white;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}

.status-filter:hover {
  border-color: var(--status-color, #1a1a1a);
  color: var(--status-color, #1a1a1a);
}

.status-filter.active {
  border-color: var(--status-color, #1a1a1a);
  background: var(--status-color, #1a1a1a);
  color: white;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .page-content {
    padding: 70px 1rem 0;
  }

  .page-body {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .barrio-gallery-main {
    height: 240px;
  }
  .gallery-thumb {
    width: 60px;
    height: 42px;
  }
  .gallery-more {
    width: 60px;
    height: 42px;
  }

  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
  }

  .pros-cons {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .status-filters {
    gap: 6px;
  }

  .status-filter {
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  .status-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
  }

  .amenities-grid {
    grid-template-columns: 1fr;
  }

  .cta-form {
    flex-direction: column;
  }

  .cta-section {
    padding: 1.5rem;
  }

  .page-header h1 {
    font-size: 1.8rem;
  }

  .compare-label-cell {
    width: 120px;
    min-width: 120px;
    padding: 8px 10px;
    font-size: 0.65rem;
    letter-spacing: 1px;
  }

  .compare-value-cell {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .compare-header-name {
    font-size: 0.9rem;
  }

  .compare-header-cell {
    padding: 1rem 0.5rem;
  }

  .compare-table {
    min-width: 500px;
  }

  .compare-selector {
    margin: 1.5rem auto 3rem;
  }

  .compare-tag {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .lifestyle-banner {
    height: 220px;
    margin: 1.5rem 0;
  }

  .lifestyle-banner-caption {
    font-size: 0.7rem;
    padding: 10px 12px;
    letter-spacing: 1px;
  }

  /* Distance map responsive */
  .dmap-header {
    padding: 1rem 1rem 0;
  }

  .dmap-tabs {
    padding: 0.75rem 1rem 0;
  }

  .dmap-tab {
    padding: 6px 10px;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
  }

  .dmap-map-container {
    margin: 0.75rem 1rem 0;
  }

  .dmap-map {
    height: 280px;
  }

  .dmap-route-info {
    padding: 0.75rem 1rem;
  }

  .dmap-route-distance {
    font-size: 1.2rem;
  }

  .dmap-nearby {
    padding: 1rem;
  }

  .dmap-nearby-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .breadcrumb {
    font-size: 0.7rem;
    flex-wrap: wrap;
  }

  .dmap-tabs {
    flex-wrap: wrap;
    gap: 4px;
  }

  .dmap-tab {
    margin-right: 0;
    flex: 1;
    text-align: center;
    min-width: calc(33% - 4px);
  }

  .dmap-map {
    height: 240px;
  }
}

/* === ASSISTANT PAGE === */
.assistant-welcome {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px;
}
.assistant-welcome h1 {
  font-size: 2rem;
  font-weight: 900;
  margin: 0 0 8px;
  letter-spacing: -1px;
  text-transform: uppercase;
}
.assistant-subtitle {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text3);
  margin: 0 0 16px;
}
.assistant-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text2);
  margin: 0 0 12px;
}
.assistant-verify {
  margin-top: 32px;
  padding: 24px;
  border: 2px solid var(--border-bold);
  background: var(--surface);
}
.assistant-verify-note {
  font-size: 0.85rem;
  color: var(--text3);
  margin: 0 0 16px;
}
.assistant-phone-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.assistant-phone-row {
  display: flex;
  align-items: center;
  border: 2px solid var(--border-bold);
  flex: 1;
}
.assistant-phone-prefix {
  padding: 10px 12px;
  background: var(--surface2);
  font-weight: 700;
  font-size: 0.9rem;
  border-right: 2px solid var(--border-bold);
}
.assistant-input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  background: transparent;
}
.assistant-code-form {
  margin-top: 16px;
}
.assistant-code-form p {
  font-size: 0.9rem;
  color: var(--text2);
  margin: 0 0 10px;
}
.assistant-code-form form {
  display: flex;
  gap: 8px;
}
.assistant-code-form input {
  border: 2px solid var(--border-bold);
  padding: 10px 14px;
  font-size: 1.1rem;
  font-family: var(--font);
  letter-spacing: 0.2em;
  text-align: center;
  width: 140px;
}
.assistant-error {
  margin-top: 12px;
  padding: 8px 14px;
  border: 2px solid #dc2626;
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Assistant Layout: Chat + Canvas — locked viewport, panels scroll internally */
body.assistant-active { overflow: hidden; }
body.assistant-active .footer,
body.assistant-active .whatsapp-fab { display: none; }

.assistant-layout {
  display: flex;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  height: calc(100vh - 110px);
  position: relative;
  overflow: hidden;
}
.assistant-chat {
  flex: 1;
  min-width: 0;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  max-width: 720px;
  height: 100%;
  overflow: hidden;
}
.assistant-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.assistant-msg {
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 85%;
}
.assistant-msg-user {
  align-self: flex-end;
  background: var(--border-bold);
  color: white;
  border: 2px solid var(--border-bold);
}
.assistant-msg-assistant {
  align-self: flex-start;
  background: var(--surface2);
  border: 2px solid var(--border);
}
.assistant-msg a.assistant-barrio-link {
  color: var(--accent, #2563eb);
  text-decoration: underline;
  font-weight: 600;
}
.assistant-typing {
  color: var(--text3);
  font-style: italic;
}
.assistant-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  border-top: 2px solid var(--border);
}
.assistant-input-bar input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border-bold);
  font-size: 0.95rem;
  font-family: var(--font);
}
.assistant-limit {
  padding: 20px;
  border: 2px solid #f59e0b;
  background: #fffbeb;
  text-align: center;
}
.assistant-limit p { margin: 0 0 12px; font-size: 0.9rem; color: var(--text2); }
.assistant-limit form { display: flex; gap: 8px; justify-content: center; }
.assistant-limit input { padding: 10px 14px; border: 2px solid var(--border-bold); font-family: var(--font); }

/* Canvas Panel */
.canvas-panel {
  width: 420px;
  border-left: 2px solid var(--border-bold);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  width: 0;
  min-width: 0;
  height: 100%;
}
.canvas-panel.open {
  width: 420px;
  min-width: 420px;
  opacity: 1;
}
.canvas-header {
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--border);
  padding: 0 4px 0 0;
  min-height: 44px;
}
.canvas-tabs {
  flex: 1;
  display: flex;
  overflow-x: auto;
  gap: 0;
}
.canvas-tab {
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  color: var(--text3);
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.canvas-tab:hover { color: var(--text1); }
.canvas-tab.active {
  color: var(--text1);
  border-bottom-color: var(--border-bold);
}
.canvas-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  flex-shrink: 0;
}
.canvas-close:hover { color: var(--text1); }
.canvas-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.canvas-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  text-align: center;
}
.canvas-empty p { color: var(--text3); font-size: 0.85rem; line-height: 1.5; max-width: 260px; }

/* Canvas barrio card content */
.canvas-barrio { display: flex; flex-direction: column; gap: 16px; }
.canvas-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.canvas-title-row h3 { font-size: 1.2rem; font-weight: 900; margin: 0; letter-spacing: -0.5px; }
.canvas-status {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 2px solid;
  letter-spacing: 0.5px;
}
.canvas-meta { font-size: 0.8rem; color: var(--text3); }
.canvas-map { margin: 4px 0; }
.canvas-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.canvas-stat {
  padding: 10px;
  border: 2px solid var(--border);
  background: var(--surface2);
}
.canvas-stat-val { font-size: 0.85rem; font-weight: 800; letter-spacing: -0.3px; }
.canvas-stat-label { font-size: 0.6rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.canvas-section { display: flex; flex-direction: column; gap: 6px; }
.canvas-section h4 {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  margin: 0;
}
.canvas-desc { font-size: 0.82rem; line-height: 1.5; color: var(--text2); margin: 0; }
.canvas-amenities { display: flex; flex-wrap: wrap; gap: 6px; }
.canvas-amenity {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border: 2px solid var(--border);
  background: var(--surface2);
}
.canvas-pro { font-size: 0.82rem; color: #16a34a; }
.canvas-con { font-size: 0.82rem; color: #dc2626; }
.canvas-listing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 2px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.canvas-listing:hover { border-color: var(--border-bold); }
.canvas-listing-price { font-weight: 800; font-size: 0.85rem; }
.canvas-listing-area { font-size: 0.8rem; color: var(--text3); }
.canvas-listing-src { font-size: 0.7rem; color: var(--text3); margin-left: auto; text-transform: uppercase; }
.canvas-full-link {
  display: block;
  text-align: center;
  padding: 12px;
  border: 2px solid var(--border-bold);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text1);
  transition: background 0.15s;
}
.canvas-full-link:hover { background: var(--surface2); }

.canvas-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

@media (max-width: 960px) {
  .assistant-layout { flex-direction: column; }
  .assistant-chat { max-width: 100%; }
  .canvas-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    min-width: 100% !important;
    max-height: 70vh;
    border-left: none;
    border-top: 2px solid var(--border-bold);
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
  }
  .canvas-panel.open {
    transform: translateY(0);
    opacity: 1;
  }
  .canvas-overlay.open { display: block; }
}
@media (min-width: 961px) {
  .canvas-overlay { display: none !important; }
}
@media (max-width: 768px) {
  .assistant-welcome { padding: 20px 16px; }
  .assistant-welcome h1 { font-size: 1.4rem; }
  .assistant-phone-form { flex-direction: column; }
  .assistant-phone-row { width: 100%; }
  .assistant-msg { max-width: 92%; }
}

/* === VISIT MODAL === */
.visit-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.visit-modal {
  background: var(--bg2);
  border: 2px solid var(--border-bold);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}
.visit-modal h2 {
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}
.visit-modal-sub {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 1.5rem;
}
.visit-modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text3);
  line-height: 1;
}
.visit-modal-close:hover { color: var(--text); }
.visit-form-row {
  margin-bottom: 1rem;
}
.visit-form-row label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: var(--text2);
}
.visit-form-row input:not([type="checkbox"]),
.visit-form-row textarea,
.visit-form-row select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  background: var(--bg);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color var(--transition);
}
.visit-form-row input:not([type="checkbox"]):focus,
.visit-form-row textarea:focus,
.visit-form-row select:focus {
  outline: none;
  border-color: var(--border-bold);
}
.visit-submit {
  width: 100%;
  margin-top: 0.5rem;
}
.visit-success {
  text-align: center;
  padding: 2rem 0;
}
.visit-success h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.visit-success p {
  color: var(--text2);
  margin-bottom: 1rem;
}
.cta-note {
  font-size: 0.8rem;
  color: var(--text3);
  margin-top: 1rem;
}

/* === CONSTRUCTOR REGISTRATION === */
.constructor-reg-form .visit-form-row {
  margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
  .visit-modal {
    padding: 1.5rem;
    max-height: 95vh;
  }
}
