/* =============================================
   PAGE-SPECIFIC STYLES — Juan Carlos Mora × RE/MAX
   ============================================= */

/* ---- HOME: Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(26, 26, 26, 0.82) 0%,
    rgba(26, 26, 26, 0.55) 50%,
    rgba(26, 26, 26, 0.35) 100%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  padding: var(--space-4xl) 0;
}

.hero__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.8s ease both;
}

.hero__label span {
  width: 40px;
  height: 1px;
  background: rgba(255,255,255,0.3);
}

.hero__title {
  font-family: var(--font-serif);
  font-size: var(--fs-display);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.1;
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero__subtitle {
  font-size: var(--fs-body-lg);
  color: rgba(255,255,255,0.75);
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: var(--space-2xl);
  max-width: 520px;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.6s both;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: rgba(255,255,255,0.4);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  animation: float 2.5s ease-in-out infinite;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
}

@media (max-width: 768px) {
  .hero { min-height: 90vh; }
  .hero__content { padding: var(--space-2xl) 0; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
  .hero__scroll { display: none; }
}

/* ---- HOME: Manifesto ---- */
.manifesto {
  padding: var(--space-section) 0;
}

.manifesto__content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: center;
  gap: var(--space-4xl);
  text-align: left;
}

.manifesto__profile {
  position: relative;
}

.manifesto__profile::after {
  content: '';
  position: absolute;
  top: 40px;
  left: -40px;
  width: 100%;
  height: 100%;
  border: 1px solid var(--color-border);
  z-index: -1;
}

.manifesto__image {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  box-shadow: var(--shadow-xl);
  border-radius: var(--border-radius);
}

.manifesto__quote {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  font-style: italic;
  color: var(--color-dark);
  line-height: 1.6;
  margin-bottom: var(--space-xl);
  position: relative;
}

.manifesto__quote::before {
  content: '"';
  font-size: 6rem;
  font-family: var(--font-serif);
  color: var(--color-accent);
  display: block;
  line-height: 0.2;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

.manifesto__author {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-dark);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

@media (max-width: 768px) {
  .manifesto__content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-2xl);
  }
  .manifesto__profile {
    max-width: 300px;
    margin: 0 auto;
  }
  .manifesto__profile::after { display: none; }
  .manifesto__quote::before { line-height: 0.5; }
}

.manifesto__logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3xl);
  margin-top: var(--space-3xl);
  flex-wrap: wrap;
  opacity: 0.4;
}

.manifesto__logos img {
  height: 35px;
  filter: grayscale(100%);
  transition: all var(--transition-base);
}

.manifesto__logos img:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* ---- HOME: Stats ---- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  padding: var(--space-3xl) 0;
}

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

/* ---- HOME: Gold Feed ---- */
.gold-feed {
  padding: var(--space-section) 0;
}

.gold-feed .property-card {
  border: 1px solid rgba(0,0,0,0.12);
}

/* ---- MAP PAGE ---- */
.map-page {
  display: flex;
  height: calc(100vh - var(--navbar-height));
}

.map-sidebar {
  width: 380px;
  flex-shrink: 0;
  background: var(--color-white);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.map-sidebar__header {
  padding: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.map-sidebar__title {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  margin-bottom: var(--space-xs);
}

.map-sidebar__subtitle {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.map-sidebar__filters {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.map-sidebar__results {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.map-sidebar__count {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  padding: var(--space-sm) var(--space-sm);
  margin-bottom: var(--space-sm);
}

.map-result-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-sm);
}

.map-result-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.map-result-card__image {
  width: 100px;
  height: 80px;
  border-radius: var(--border-radius);
  overflow: hidden;
  flex-shrink: 0;
}

.map-result-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-result-card__info {
  flex: 1;
  min-width: 0;
}

.map-result-card__zone {
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 500;
}

.map-result-card__title {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0;
}

.map-result-card__price {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-accent);
}

.map-container {
  flex: 1;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

/* Map popup custom style */
.map-popup {
  min-width: 260px;
}

.map-popup__image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  margin: -15px -20px 12px;
  width: calc(100% + 40px);
}

.map-popup__badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 3px;
  margin-bottom: 6px;
}

.map-popup__title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 4px;
}

.map-popup__price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 2px;
}

.map-popup__zone {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.map-popup__remax {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  font-weight: 600;
  border-top: 1px solid var(--color-border);
  padding-top: 8px;
  margin-top: 4px;
}

/* Map mobile */
@media (max-width: 900px) {
  .map-page { flex-direction: column; height: auto; display: block; }
  .map-container { 
    height: 60vh; 
    width: 100%; 
  }
  .map-sidebar {
    width: 100%;
    height: auto;
    max-height: none;
    border-right: none;
    border-top: 1px solid var(--color-border);
    overflow: visible;
  }
  .map-sidebar__results {
    overflow-y: visible;
  }
}

/* ---- CAPTACIÓN PAGE ---- */
.captacion-hero {
  background: var(--color-dark);
  color: var(--color-white);
  padding: var(--space-section) 0;
  text-align: center;
}

.captacion-hero h1 {
  color: var(--color-white);
  max-width: 800px;
  margin: 0 auto var(--space-lg);
}

.captacion-hero p {
  color: rgba(255,255,255,0.65);
  max-width: 600px;
  margin: 0 auto;
  font-size: var(--fs-body-lg);
}

.captacion-form-section {
  max-width: 700px;
  margin: 0 auto;
  padding: var(--space-section) var(--space-xl);
}

.captacion-form-section h2 {
  margin-bottom: var(--space-2xl);
}

.captacion-success {
  text-align: center;
  padding: var(--space-3xl);
  display: none;
}

.captacion-success.is-visible {
  display: block;
  animation: fadeInUp 0.5s ease;
}

.captacion-success__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-success-light);
  color: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  font-size: 1.5rem;
}

/* ---- CATALOG PAGE ---- */
.catalog-header {
  padding: var(--space-3xl) 0 var(--space-xl);
}

.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.filter-btn {
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  background: var(--color-white);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.is-active {
  background: var(--color-dark);
  color: var(--color-white);
  border-color: var(--color-dark);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

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

@media (max-width: 600px) {
  .catalog-grid { grid-template-columns: 1fr; }
}

.catalog-empty {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
  color: var(--color-text-muted);
  grid-column: 1 / -1;
}

.catalog-empty__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

/* ---- PROPERTY DETAIL (RE/MAX Redesign) ---- */
.property-detail {
  padding: var(--space-xl) 0 var(--space-section);
}

.property-header-remax {
  background: var(--color-white);
  padding: var(--space-xl) 0;
  margin-bottom: var(--space-md);
}

.property-header-remax__type {
  color: var(--color-accent);
  font-weight: 700;
  font-size: var(--fs-h4);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.property-header-remax__title {
  font-size: var(--fs-h2);
  margin-bottom: 4px;
}

.property-header-remax__id {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.property-gallery-wrapper {
  position: relative;
  margin-bottom: var(--space-xl);
}

.property-gallery {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 10px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  height: 500px;
}

.property-status-bar {
  background: var(--color-accent);
  color: var(--color-white);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-small);
  margin-top: -10px;
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
  position: relative;
  z-index: 10;
}

.property-status-bar__metrics {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
}

.property-status-bar__metric {
  display: flex;
  align-items: center;
  gap: 8px;
}

.property-status-bar__metric svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.property-status-bar__price {
  font-weight: 700;
  font-size: var(--fs-body-lg);
}

.property-info {
  display: grid;
  grid-template-columns: 5fr 2fr;
  gap: var(--space-4xl);
  margin-top: var(--space-2xl);
}

.property-info__section {
  margin-bottom: var(--space-3xl);
}

.property-info__section-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--fs-h3);
  text-transform: uppercase;
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
  margin-bottom: var(--space-xl);
}

.detail-grid-remax {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.detail-item-remax {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.detail-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-icon-circle svg {
  width: 22px;
  height: 22px;
}

.detail-content-remax {
  line-height: 1.2;
}

.detail-label-remax {
  display: block;
  font-size: var(--fs-label);
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.detail-value-remax {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-dark);
}

/* Sidebar Agent Card (RE/MAX Style) */
.agent-card-remax {
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: calc(var(--navbar-height) + var(--space-xl));
}

.agent-card-remax__avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto var(--space-md);
  object-fit: cover;
  border: 3px solid var(--color-white);
  box-shadow: var(--shadow-sm);
}

.agent-card-remax__name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--fs-body);
  margin-bottom: 2px;
}

.agent-card-remax__role {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.agent-card-remax__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qr-section {
  text-align: center;
  margin-top: var(--space-3xl);
  padding-top: var(--space-3xl);
  border-top: 1px solid var(--color-border);
}

.qr-section img {
  width: 140px;
  margin: 0 auto var(--space-md);
  background: white;
}

@media (max-width: 900px) {
  .property-gallery { height: 300px; grid-template-columns: 1fr; }
  .property-gallery__side { display: none; }
  .property-status-bar { flex-direction: column; gap: 10px; text-align: center; }
  .property-status-bar__metrics { gap: var(--space-md); justify-content: center; flex-wrap: wrap; }
  .property-info { grid-template-columns: 1fr; }
  .detail-grid-remax { grid-template-columns: repeat(2, 1fr); }
  .agent-card-remax { position: static; margin-top: var(--space-3xl); }
}

/* ---- ADMIN PAGE ---- */
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-base);
  padding: var(--space-xl);
}

.admin-login__card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-3xl);
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.admin-login__card h2 {
  margin-bottom: var(--space-sm);
}

.admin-login__card p {
  color: var(--color-text-muted);
  font-size: var(--fs-small);
  margin-bottom: var(--space-2xl);
}

.admin-dashboard {
  min-height: 100vh;
  background: var(--color-base);
}

.admin-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  font-size: var(--fs-h3);
}

.admin-content {
  padding: var(--space-2xl);
  max-width: 1200px;
  margin: 0 auto;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

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

.admin-stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
}

.admin-stat-card__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.admin-stat-card__value {
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--color-dark);
}

.admin-table-wrapper {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
}

.admin-table-header {
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
}

.admin-table-header h3 {
  font-size: var(--fs-h4);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-base);
}

.admin-table td {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--fs-small);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: var(--color-base);
}

.admin-table__image {
  width: 60px;
  height: 45px;
  border-radius: var(--border-radius);
  object-fit: cover;
}

.admin-table__actions {
  display: flex;
  gap: var(--space-sm);
}

.admin-table__actions button {
  padding: 6px 12px;
  font-size: var(--fs-xs);
  border-radius: var(--border-radius);
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}

.admin-table__actions button:hover {
  border-color: var(--color-dark);
}

.admin-table__actions .btn-delete:hover {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}

/* Admin Form Modal */
.admin-form-modal {
  max-width: 800px;
}

.admin-form-modal h2 {
  margin-bottom: var(--space-2xl);
}

#admin-minimap {
  height: 200px;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-md);
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--color-base-alt);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  transition: all var(--transition-fast);
}

.toggle__slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle__slider {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.toggle input:checked + .toggle__slider::before {
  transform: translateX(20px);
}

/* ---- NEW ADMIN IMPROVEMENTS ---- */
.tab-btn {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.tab-btn.is-active {
    color: var(--color-dark);
}

.tab-btn.is-active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent);
}

.form-fieldset {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
    background: var(--color-white);
}

.form-fieldset legend {
    font-weight: 700;
    text-transform: uppercase;
    font-size: var(--fs-xs);
    letter-spacing: 0.1em;
    padding: 0 var(--space-sm);
    color: var(--color-accent);
}

.form-section {
    border-left: 4px solid var(--color-accent);
}

.badge-available { background: var(--color-success-light); color: var(--color-success); }
.badge-rented { background: var(--color-danger-light); color: var(--color-danger); }
.badge-sold { background: var(--color-dark); color: white; }

/* Scrollbar for modal */
.admin-form-modal::-webkit-scrollbar {
    width: 6px;
}
.admin-form-modal::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 10px;
}
.property-gallery__main, .property-gallery__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: filter var(--transition-base);
}

.property-gallery__main:hover, .property-gallery__thumb:hover {
  filter: brightness(0.9);
}

.property-gallery__side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
