/* ============================================================
   Dom Real Estate Platform — Custom Stylesheet
   Brand Color: #DC2626 (Red)
   Complements Tailwind CSS CDN
   ============================================================ */


/* Prevent horizontal overflow on mobile */
html, body {
  overflow-x: hidden;
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* ------------------------------------------------------------
   1. CSS Custom Properties
   ------------------------------------------------------------ */
:root {
  /* Brand palette */
  --red-primary: #DC2626;
  --red-light: #FEE2E2;
  --red-dark: #B91C1C;
  --red-hover: #C42020;
  --red-50: #FEF2F2;
  --red-100: #FEE2E2;
  --red-200: #FECACA;
  --red-500: #EF4444;
  --red-600: #DC2626;
  --red-700: #B91C1C;
  --red-800: #991B1B;

  /* Neutrals */
  --gray-dark: #1F2937;
  --gray-medium: #6B7280;
  --gray-light: #F9FAFB;
  --gray-border: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Semantic */
  --success: #16A34A;
  --success-light: #DCFCE7;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --info: #2563EB;
  --info-light: #DBEAFE;
  --error: #DC2626;
  --error-light: #FEE2E2;

  /* Layout */
  --navbar-height: 64px;
  --sidebar-width: 280px;
  --container-max: 1280px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 20px 30px -10px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Z-index layers */
  --z-dropdown: 50;
  --z-sticky: 100;
  --z-navbar: 200;
  --z-modal-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
}


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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-dark);
  background-color: var(--gray-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--red-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--red-dark);
}

a.btn-primary,
a.btn-primary:hover,
a.btn-primary:active,
a.btn-primary:visited {
  color: #FFFFFF !important;
}


/* ------------------------------------------------------------
   3. Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  border-radius: var(--border-radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--red-primary);
  outline-offset: 2px;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — red background */
.btn-primary {
  background-color: var(--red-primary);
  color: #FFFFFF;
  border-color: var(--red-primary);
}

.btn-primary:hover {
  background-color: var(--red-dark);
  border-color: var(--red-dark);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  background-color: var(--red-800);
  transform: translateY(0);
  box-shadow: none;
}

/* Secondary — gray outline */
.btn-secondary {
  background-color: transparent;
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn-secondary:hover {
  background-color: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--gray-900);
}

.btn-secondary:active {
  background-color: var(--gray-200);
}

/* Danger — red outline for destructive actions */
.btn-danger {
  background-color: transparent;
  color: var(--red-primary);
  border-color: var(--red-primary);
}

.btn-danger:hover {
  background-color: var(--red-primary);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-danger:active {
  background-color: var(--red-dark);
  transform: translateY(0);
}

/* Ghost — no border, subtle hover */
.btn-ghost {
  background-color: transparent;
  color: var(--gray-500);
  border-color: transparent;
  padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
  background-color: var(--gray-100);
  color: var(--gray-700);
}

/* Size variants */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--border-radius-lg);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
}


/* ------------------------------------------------------------
   4. Property Card
   ------------------------------------------------------------ */
.property-card {
  background: #FFFFFF;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
  border: 1px solid var(--gray-200);
  position: relative;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.property-card__image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 66.67%; /* 3:2 aspect ratio */
  overflow: hidden;
  background-color: var(--gray-100);
}

.property-card__image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.property-card:hover .property-card__image-wrapper img {
  transform: scale(1.05);
}

.property-card__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
}

.property-card__favourite {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
}

.property-card__body {
  padding: 1rem 1.25rem;
}

.property-card__price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.property-card__price .currency {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
}

.property-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-card__location {
  font-size: 0.8125rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.property-card__meta {
  display: flex;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.property-card__meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Horizontal card variant (for list view) */
.property-card--horizontal {
  display: grid;
  grid-template-columns: 280px 1fr;
}

.property-card--horizontal .property-card__image-wrapper {
  padding-top: 0;
  height: 100%;
  min-height: 200px;
}

@media (max-width: 640px) {
  .property-card--horizontal {
    grid-template-columns: 1fr;
  }
}


/* ------------------------------------------------------------
   5. Flash Messages / Toasts
   ------------------------------------------------------------ */
.flash-container {
  position: fixed;
  top: calc(var(--navbar-height) + 1rem);
  right: 1rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
  width: 100%;
  pointer-events: none;
}

.flash-message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: flash-slide-in 0.3s ease forwards, flash-fade-out 0.4s ease 4.5s forwards;
  border-left: 4px solid transparent;
}

.flash-message .flash-close {
  margin-left: auto;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
  background: none;
  border: none;
  font-size: 1.125rem;
  line-height: 1;
  color: inherit;
  flex-shrink: 0;
}

.flash-message .flash-close:hover {
  opacity: 1;
}

/* Success */
.flash-message--success {
  background-color: var(--success-light);
  color: #166534;
  border-left-color: var(--success);
}

/* Error */
.flash-message--error {
  background-color: var(--error-light);
  color: #991B1B;
  border-left-color: var(--error);
}

/* Info */
.flash-message--info {
  background-color: var(--info-light);
  color: #1E40AF;
  border-left-color: var(--info);
}

/* Warning */
.flash-message--warning {
  background-color: var(--warning-light);
  color: #92400E;
  border-left-color: var(--warning);
}

@keyframes flash-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes flash-fade-out {
  from {
    opacity: 1;
    max-height: 200px;
    margin-bottom: 0;
  }
  to {
    opacity: 0;
    max-height: 0;
    margin-bottom: -0.5rem;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
  }
}


/* ------------------------------------------------------------
   6. Navbar
   ------------------------------------------------------------ */
.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-navbar);
  height: var(--navbar-height);
  width: 100%;
  overflow: hidden;
  background: #FFFFFF;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.navbar-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-brand img {
  height: 36px;
  width: auto;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.navbar-links a {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.navbar-links a:hover {
  color: var(--gray-900);
  background-color: var(--gray-100);
}

.navbar-links a.btn.btn-primary {
  color: #FFFFFF;
  background-color: var(--red-primary);
}

.navbar-links a.btn.btn-primary:hover {
  color: #FFFFFF;
  background-color: var(--red-dark);
}

.navbar-links a.active {
  color: var(--red-primary);
  background-color: var(--red-50);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Hamburger toggle */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: background-color var(--transition-fast);
}

.hamburger:hover {
  background-color: var(--gray-100);
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--gray-700);
  border-radius: 2px;
  transition: all var(--transition-base);
  transform-origin: center;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: #FFFFFF;
  z-index: var(--z-navbar);
  padding: 1rem;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--transition-slow);
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-700);
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.mobile-menu a:hover,
.mobile-menu a.active {
  background-color: var(--red-50);
  color: var(--red-primary);
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .navbar-links {
    display: none;
  }

  .navbar-actions {
    display: none;
  }

  .mobile-menu {
    display: block;
  }
}


/* ------------------------------------------------------------
   7. Hero Section
   ------------------------------------------------------------ */
.hero-section {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gray-900) 0%, #374151 100%);
  color: #FFFFFF;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/public/images/hero-bg.jpg') center/cover no-repeat;
  opacity: 0.25;
  z-index: 0;
}

.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  padding: 2rem 1.5rem;
}

.hero-content h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-content p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-search {
  background: #FFFFFF;
  border-radius: var(--border-radius-xl);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  margin: 0 auto;
}

.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--gray-800);
  background: transparent;
  min-width: 0;
}

.hero-search input::placeholder {
  color: var(--gray-400);
}

.hero-search .btn-primary {
  border-radius: var(--border-radius-lg);
  padding: 0.75rem 1.5rem;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .hero-section {
    min-height: 400px;
  }

  .hero-content h1 {
    font-size: 1.875rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .hero-search {
    flex-direction: column;
    border-radius: var(--border-radius-lg);
    padding: 0.75rem;
  }

  .hero-search input {
    width: 100%;
  }

  .hero-search .btn-primary {
    width: 100%;
  }
}


/* ------------------------------------------------------------
   8. Filter Bar
   ------------------------------------------------------------ */
.filter-bar {
  background: #FFFFFF;
  border-radius: var(--border-radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.filter-bar__group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 140px;
}

.filter-bar__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-bar__group select,
.filter-bar__group input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  color: var(--gray-800);
  background: #FFFFFF;
  transition: border-color var(--transition-fast);
  width: 100%;
}

.filter-bar__group select:focus,
.filter-bar__group input:focus {
  border-color: var(--red-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.filter-bar__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* Collapsible filters on mobile */
.filter-bar__toggle {
  display: none;
}

@media (max-width: 768px) {
  .filter-bar {
    flex-direction: column;
  }

  .filter-bar__group {
    min-width: 100%;
  }

  .filter-bar__toggle {
    display: flex;
    width: 100%;
  }

  .filter-bar--collapsed .filter-bar__group:nth-child(n+3) {
    display: none;
  }
}


/* ------------------------------------------------------------
   9. Map Container (Split View)
   ------------------------------------------------------------ */
.map-container {
  width: 100%;
  height: 500px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  background-color: var(--gray-100);
}

.map-container--full {
  height: calc(100vh - var(--navbar-height));
  border-radius: 0;
  border: none;
}

/* Split view layout */
.split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: calc(100vh - var(--navbar-height));
  overflow: hidden;
}

.split-view__list {
  overflow-y: auto;
  padding: 1rem;
  background: var(--gray-light);
}

.split-view__map {
  position: sticky;
  top: 0;
  height: 100%;
}

.split-view__map .map-container {
  height: 100%;
  border-radius: 0;
  border: none;
  border-left: 1px solid var(--gray-200);
}

@media (max-width: 1024px) {
  .split-view {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .split-view__map {
    position: relative;
  }
}

@media (max-width: 640px) {
  .split-view {
    grid-template-rows: 300px 1fr;
  }
}


/* ------------------------------------------------------------
   10. Image Gallery
   ------------------------------------------------------------ */
.image-gallery {
  position: relative;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  background: var(--gray-900);
}

.image-gallery__main {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.image-gallery__thumbnails {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.8);
  -webkit-overflow-scrolling: touch;
}

.image-gallery__thumb {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
  border: 2px solid transparent;
}

.image-gallery__thumb:hover,
.image-gallery__thumb.active {
  opacity: 1;
}

.image-gallery__thumb.active {
  border-color: var(--red-primary);
}

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

.image-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
  color: var(--gray-800);
  z-index: 10;
}

.image-gallery__nav:hover {
  background: #FFFFFF;
  box-shadow: var(--shadow-lg);
  transform: translateY(-50%) scale(1.05);
}

.image-gallery__nav--prev {
  left: 0.75rem;
}

.image-gallery__nav--next {
  right: 0.75rem;
}

.image-gallery__counter {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.7);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  z-index: 10;
}

/* Lightbox overlay */
.image-gallery__lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.image-gallery__lightbox.open {
  opacity: 1;
  visibility: visible;
}

.image-gallery__lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--border-radius);
}


/* ------------------------------------------------------------
   11. Form Inputs
   ------------------------------------------------------------ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
}

.form-label .required {
  color: var(--red-primary);
  margin-left: 0.125rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--gray-800);
  background-color: #FFFFFF;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-input:hover {
  border-color: var(--gray-400);
}

.form-input:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-input--error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-input--error:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--error);
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-top: 0.375rem;
}

/* Textarea */
textarea.form-input {
  min-height: 120px;
  resize: vertical;
}

/* Select */
select.form-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Checkbox / Radio custom */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--red-primary);
  cursor: pointer;
}


/* ------------------------------------------------------------
   12. Modal
   ------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #FFFFFF;
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-base);
}

.modal-overlay.open .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.modal-close {
  width: 2rem;
  height: 2rem;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  transition: all var(--transition-fast);
  font-size: 1.25rem;
}

.modal-close:hover {
  color: var(--gray-700);
  background-color: var(--gray-100);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
}

/* Size variants */
.modal-content--sm {
  max-width: 24rem;
}

.modal-content--lg {
  max-width: 48rem;
}

.modal-content--xl {
  max-width: 64rem;
}


/* ------------------------------------------------------------
   13. Badges
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 9999px;
  white-space: nowrap;
  text-transform: capitalize;
}

/* Status badges */
.badge--active {
  background-color: var(--success-light);
  color: #166534;
}

.badge--pending {
  background-color: var(--warning-light);
  color: #92400E;
}

.badge--sold {
  background-color: var(--red-100);
  color: var(--red-800);
}

.badge--rented {
  background-color: var(--info-light);
  color: #1E40AF;
}

.badge--draft {
  background-color: var(--gray-100);
  color: var(--gray-500);
}

/* Type badges */
.badge--sale {
  background-color: var(--red-primary);
  color: #FFFFFF;
}

.badge--rent {
  background-color: var(--info);
  color: #FFFFFF;
}

/* Agent badge */
.badge--agent {
  background-color: var(--gray-900);
  color: #FFFFFF;
  font-size: 0.6875rem;
  padding: 0.1875rem 0.5rem;
}

.badge--verified {
  background-color: var(--success);
  color: #FFFFFF;
}

/* Featured badge */
.badge--featured {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
}


/* ------------------------------------------------------------
   14. Pagination
   ------------------------------------------------------------ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.5rem 0;
}

.pagination__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  background: #FFFFFF;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.pagination__item:hover {
  background-color: var(--gray-100);
  border-color: var(--gray-300);
}

.pagination__item--active {
  background-color: var(--red-primary);
  color: #FFFFFF;
  border-color: var(--red-primary);
}

.pagination__item--active:hover {
  background-color: var(--red-dark);
  border-color: var(--red-dark);
}

.pagination__item--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination__ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.875rem;
  color: var(--gray-400);
  user-select: none;
}

.pagination__info {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-left: 1rem;
}


/* ------------------------------------------------------------
   15. Favourite Button
   ------------------------------------------------------------ */
.favourite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  color: var(--gray-400);
  padding: 0;
}

.favourite-btn:hover {
  background: #FFFFFF;
  box-shadow: var(--shadow-md);
  transform: scale(1.1);
}

.favourite-btn svg,
.favourite-btn .heart-icon {
  width: 1.125rem;
  height: 1.125rem;
  transition: all var(--transition-base);
}

.favourite-btn.active {
  color: var(--red-primary);
}

.favourite-btn.active svg,
.favourite-btn.active .heart-icon {
  fill: var(--red-primary);
}

/* Heart pop animation */
.favourite-btn.animating {
  animation: heart-pop 0.4s ease;
}

@keyframes heart-pop {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}


/* ------------------------------------------------------------
   16. Spinner / Loading
   ------------------------------------------------------------ */
.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2.5px solid var(--gray-200);
  border-top-color: var(--red-primary);
  border-radius: 50%;
  animation: spinner-rotate 0.6s linear infinite;
}

.spinner--sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

.spinner--lg {
  width: 2.5rem;
  height: 2.5rem;
  border-width: 3px;
}

.spinner--white {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

/* Full-page loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  z-index: var(--z-modal);
}

.loading-overlay .loading-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
}

/* Skeleton loading placeholders */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--border-radius);
}

.skeleton--text {
  height: 1rem;
  width: 100%;
  margin-bottom: 0.5rem;
}

.skeleton--title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: 0.75rem;
}

.skeleton--image {
  width: 100%;
  padding-top: 66.67%;
}

.skeleton--circle {
  border-radius: 50%;
}

@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}


/* ------------------------------------------------------------
   17. Tabs (Dashboard)
   ------------------------------------------------------------ */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabs__item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  text-decoration: none;
}

.tabs__item:hover {
  color: var(--gray-700);
  border-bottom-color: var(--gray-300);
}

.tabs__item.active {
  color: var(--red-primary);
  border-bottom-color: var(--red-primary);
  font-weight: 600;
}

.tabs__item .tabs__count {
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.tabs__item.active .tabs__count {
  background: var(--red-100);
  color: var(--red-primary);
}

.tab-panel {
  display: none;
  padding: 1.5rem 0;
}

.tab-panel.active {
  display: block;
}


/* ------------------------------------------------------------
   18. Custom Scrollbar (Property List)
   ------------------------------------------------------------ */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: var(--gray-300);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: var(--gray-400);
}

/* Horizontal scrollbar */
.custom-scrollbar-x {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

.custom-scrollbar-x::-webkit-scrollbar {
  height: 6px;
}

.custom-scrollbar-x::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar-x::-webkit-scrollbar-thumb {
  background-color: var(--gray-300);
  border-radius: 3px;
}


/* ------------------------------------------------------------
   19. Focus Ring (Accessibility)
   ------------------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--red-primary);
  outline-offset: 2px;
}

/* Remove default outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Skip-to-content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background: var(--red-primary);
  color: #FFFFFF;
  font-weight: 600;
  border-radius: var(--border-radius);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 1rem;
}


/* ------------------------------------------------------------
   20. Utility Classes
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 3rem 0;
}

.section--sm {
  padding: 1.5rem 0;
}

.text-red {
  color: var(--red-primary);
}

.bg-red {
  background-color: var(--red-primary);
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Divider */
.divider {
  border: none;
  height: 1px;
  background-color: var(--gray-200);
  margin: 1.5rem 0;
}

/* Grid helpers */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .property-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}


/* ------------------------------------------------------------
   21. Responsive Overrides
   ------------------------------------------------------------ */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  :root {
    --navbar-height: 56px;
  }

  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 2rem 0;
  }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2rem;
  }

  .modal-content {
    max-width: 100%;
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
    border-radius: var(--border-radius-lg);
  }

  .modal-content--lg,
  .modal-content--xl {
    max-width: 100%;
  }

  .property-card--horizontal {
    grid-template-columns: 1fr;
  }

  .pagination {
    gap: 0.125rem;
  }

  .pagination__item {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.8125rem;
  }

  .pagination__info {
    display: none;
  }

  .tabs {
    gap: 0;
  }

  .tabs__item {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
  }
}

/* Small mobile (max-width: 480px) */
@media (max-width: 480px) {
  .filter-bar {
    padding: 0.75rem;
  }

  .property-card__body {
    padding: 0.75rem 1rem;
  }

  .btn-lg {
    width: 100%;
  }
}


/* ------------------------------------------------------------
   22. Leaflet Overrides & Address Autocomplete
   ------------------------------------------------------------ */

/* Smaller attribution text */
.leaflet-control-attribution {
  font-size: 10px !important;
}

/* Address autocomplete dropdown */
.address-autocomplete {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  background: #FFFFFF;
  border: 1px solid var(--gray-300);
  border-top: none;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
}

.address-autocomplete-item {
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--gray-700);
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background-color var(--transition-fast);
}

.address-autocomplete-item:last-child {
  border-bottom: none;
}

.address-autocomplete-item:hover,
.address-autocomplete-item.active {
  background-color: var(--red-50);
  color: var(--gray-900);
}


/* ------------------------------------------------------------
   23. Print Styles
   ------------------------------------------------------------ */
@media print {
  .navbar,
  .hamburger,
  .mobile-menu,
  .flash-container,
  .filter-bar,
  .pagination,
  .favourite-btn,
  .modal-overlay,
  .loading-overlay {
    display: none !important;
  }

  .property-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  body {
    background: #FFFFFF;
    color: #000000;
  }

  a {
    color: #000000;
    text-decoration: underline;
  }
}
