/* ============================================================
   MAPIOLE THEME SYSTEM
   Shared light/dark compatibility for the public site.
   Brand: Mapiole purple + navy, with accessible neutral surfaces.
   ============================================================ */

:root {
  --mp-ink: #0a2d56;
  --mp-primary-text: #0a2d56;
  --bs-black: #081627;
  --bs-black-rgb: 8, 22, 39;
}

html[data-mapiole-theme="light"] {
  --mp-primary-text: #0a2d56;
  --bs-emphasis-color: #0a2d56;
  --bs-emphasis-color-rgb: 8, 22, 39;
}

body .text-black {
  color: #0a2d56 !important;
}

body .bg-black {
  background-color: #081627 !important;
}

body .border-black {
  border-color: #081627 !important;
}

html[data-mapiole-theme="light"] {
  --mp-page-bg: #fcfcfd;
  --mp-surface: #ffffff;
  --mp-surface-raised: #ffffff;
  --mp-surface-soft: #f8f9fb;
  --mp-heading: #0a2d56;
  --mp-text: #0a2d56;
  --mp-muted: #667085;
  --mp-faint: #98a2b3;
  --mp-border: #e4e7ec;
  --mp-border-strong: rgba(8, 22, 39, 0.16);
  --mp-primary: #b900e5;
  --mp-primary-strong: #d301fd;
  --mp-link: #8b1cc4;
  --mp-success: #047857;
  --mp-shadow: 0 16px 45px rgba(8, 22, 39, 0.08);
  --mp-shadow-lg: 0 28px 80px rgba(8, 22, 39, 0.12);
}

html[data-mapiole-theme="dark"] {
  --mp-primary-text: #f8fafc;
  --mp-page-bg: #081627;
  --mp-surface: #0b1727;
  --mp-surface-raised: #101e31;
  --mp-surface-soft: #15263c;
  --mp-heading: #f8fafc;
  --mp-text: #f8fafc;
  --mp-muted: #c1cad6;
  --mp-faint: #8f9bad;
  --mp-border: #223149;
  --mp-border-strong: rgba(255, 255, 255, 0.2);
  --mp-primary: #dd36ff;
  --mp-primary-strong: #e258ff;
  --mp-link: #dd36ff;
  --mp-success: #34d399;
  --mp-shadow: 0 18px 48px rgba(8, 22, 39, 0.28);
  --mp-shadow-lg: 0 30px 90px rgba(8, 22, 39, 0.4);
}

html,
body {
  background-color: var(--mp-page-bg);
}

body {
  color: var(--mp-text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

html[data-mapiole-theme="light"] body {
  background-color: #fcfcfd !important;
}

html[data-mapiole-theme="dark"] body {
  background-color: #081627 !important;
}

body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
  color: var(--mp-heading);
}

body p,
body .text-secondary,
body .text-muted,
body .form-text {
  color: var(--mp-muted) !important;
}

body a:not(.btn):not([class*="badge"]):not(.mp-btn):not(.mp-card):not(.mp-agent-card) {
  color: inherit;
}

body a:not(.btn):not([class*="badge"]):not(.mp-btn):hover {
  color: var(--mp-primary);
}

/* Bootstrap surfaces */
html[data-mapiole-theme="light"] body {
  --bs-body-bg: #f7f8fb;
  --bs-body-color: #0a2d56;
  --bs-heading-color: #0a2d56;
  --bs-secondary-color: #667085;
  --bs-border-color: rgba(8, 22, 39, 0.12);
}

html[data-mapiole-theme="dark"] body {
  --bs-body-bg: #081627;
  --bs-body-color: #e8edf4;
  --bs-heading-color: #ffffff;
  --bs-secondary-color: #b7c2d0;
  --bs-tertiary-color: #8391a5;
  --bs-border-color: rgba(255, 255, 255, 0.12);
  --bs-border-color-translucent: rgba(255, 255, 255, 0.14);
  --bs-link-color-rgb: 216, 180, 254;
  --bs-link-hover-color-rgb: 232, 121, 249;
}

html[data-mapiole-theme="dark"] body .card,
html[data-mapiole-theme="dark"] body .modal-content,
html[data-mapiole-theme="dark"] body .offcanvas,
html[data-mapiole-theme="dark"] body .accordion-item,
html[data-mapiole-theme="dark"] body .list-group-item:not(.search-category .list-group-item),
html[data-mapiole-theme="dark"] body .dropdown-menu:not(.megaNav) {
  background-color: var(--mp-surface) !important;
  border-color: var(--mp-border) !important;
  color: var(--mp-text);
}

html[data-mapiole-theme="dark"] body .bg-white,
html[data-mapiole-theme="dark"] body .bg-light {
  background-color: var(--mp-surface) !important;
}

html[data-mapiole-theme="dark"] body .text-dark,
html[data-mapiole-theme="dark"] body .text-blue,
html[data-mapiole-theme="dark"] body .card-title,
html[data-mapiole-theme="dark"] body .modal-title {
  color: var(--mp-heading) !important;
  -webkit-text-fill-color: var(--mp-heading) !important;
}

/* Forms. Buttons are intentionally excluded so their brand colors stay intact. */
html[data-mapiole-theme="light"] body input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html[data-mapiole-theme="light"] body select,
html[data-mapiole-theme="light"] body textarea,
html[data-mapiole-theme="light"] body .form-control,
html[data-mapiole-theme="light"] body .form-select {
  background-color: #ffffff !important;
  border-color: rgba(8, 22, 39, 0.14) !important;
  color: #0a2d56 !important;
  -webkit-text-fill-color: #0a2d56 !important;
}

html[data-mapiole-theme="dark"] body input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html[data-mapiole-theme="dark"] body select,
html[data-mapiole-theme="dark"] body textarea,
html[data-mapiole-theme="dark"] body .form-control,
html[data-mapiole-theme="dark"] body .form-select,
html[data-mapiole-theme="dark"] body .input-group-text {
  background-color: var(--mp-surface-raised) !important;
  border-color: var(--mp-border-strong) !important;
  color: var(--mp-text) !important;
  -webkit-text-fill-color: var(--mp-text) !important;
}

html[data-mapiole-theme="light"] body input::placeholder,
html[data-mapiole-theme="light"] body textarea::placeholder {
  color: #98a2b3;
  -webkit-text-fill-color: #98a2b3;
  opacity: 1;
}

html[data-mapiole-theme="dark"] body input::placeholder,
html[data-mapiole-theme="dark"] body textarea::placeholder {
  color: #8391a5;
  -webkit-text-fill-color: #8391a5;
  opacity: 1;
}

html[data-mapiole-theme="dark"] body select option {
  background: #0b1c2e;
  color: #f8fafc;
}

html[data-mapiole-theme="dark"] body .btn-light,
html[data-mapiole-theme="dark"] body .btn-outline-dark {
  background: #ffffff !important;
  border-color: rgba(8, 22, 39, 0.14) !important;
  color: #0a2d56 !important;
  -webkit-text-fill-color: #0a2d56 !important;
}

/* Navigation */
html[data-mapiole-theme="light"] body #navbar {
  background: rgba(255, 255, 255, 0.97) !important;
  border-bottom-color: rgba(8, 22, 39, 0.08) !important;
  box-shadow: 0 10px 32px rgba(8, 22, 39, 0.07) !important;
}

html[data-mapiole-theme="dark"] body #navbar {
  background: rgba(8, 22, 39, 0.96) !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 14px 34px rgba(8, 22, 39, 0.3) !important;
}

html[data-mapiole-theme="light"] body #navbar .mp-nav-link,
html[data-mapiole-theme="light"] body #navbar .mp-nav-svg,
html[data-mapiole-theme="light"] body #navbar .notif-bell-btn,
html[data-mapiole-theme="light"] body #navbar .nav-link {
  color: #0a2d56 !important;
  -webkit-text-fill-color: #0a2d56 !important;
}

html[data-mapiole-theme="dark"] body #navbar .mp-nav-link,
html[data-mapiole-theme="dark"] body #navbar .mp-nav-svg,
html[data-mapiole-theme="dark"] body #navbar .notif-bell-btn,
html[data-mapiole-theme="dark"] body #navbar .nav-link {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-mapiole-theme="light"] body #navbar .mp-translator {
  background: #ffffff !important;
  border-color: rgba(8, 22, 39, 0.14) !important;
  color: #0a2d56 !important;
  box-shadow: none !important;
}

html[data-mapiole-theme="dark"] body #navbar .mp-translator {
  background: #10243a !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
  box-shadow: none !important;
}

html[data-mapiole-theme="light"] body #navbar .mp-translator-select {
  background: transparent !important;
  color: #0a2d56 !important;
  -webkit-text-fill-color: #0a2d56 !important;
}

html[data-mapiole-theme="dark"] body #navbar .mp-translator-select {
  background: transparent !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-mapiole-theme="light"] body #navbar .mp-theme-toggle {
  background: transparent !important;
  border-color: currentColor !important;
  color: #0a2d56 !important;
}

html[data-mapiole-theme="light"] body #navbar .mp-theme-toggle:hover {
  background: linear-gradient(135deg, #b900e5 0%, #d301fd 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

html[data-mapiole-theme="dark"] body #navbar .mp-theme-toggle {
  background: transparent !important;
  border: 1.5px solid currentColor !important;
  color: #f8fafc !important;
}

html[data-mapiole-theme="dark"] body #navbar .mp-theme-toggle:hover {
  background: linear-gradient(135deg, #b900e5 0%, #d301fd 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

html[data-mapiole-theme="dark"] body #navbar .mp-theme-toggle i,
html[data-mapiole-theme="light"] body #navbar .mp-theme-toggle i {
  color: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-mapiole-theme="light"] body #navbar .mp-logo-home {
  display: none !important;
}

html[data-mapiole-theme="light"] body #navbar .mp-logo-scroll {
  display: inline-block !important;
}

html[data-mapiole-theme="dark"] body #navbar .mp-logo-home {
  display: inline-block !important;
}

html[data-mapiole-theme="dark"] body #navbar .mp-logo-scroll {
  display: none !important;
}

html[data-mapiole-theme="dark"] body #mySidenav,
html[data-mapiole-theme="dark"] body #mySidenav .sn-header,
html[data-mapiole-theme="dark"] body #mySidenav .sn-sub {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-mapiole-theme="dark"] body #mySidenav .sn-row,
html[data-mapiole-theme="dark"] body #mySidenav .sn-flat,
html[data-mapiole-theme="dark"] body #mySidenav .sn-header-title,
html[data-mapiole-theme="dark"] body #mySidenav .sn-header-icon,
html[data-mapiole-theme="dark"] body #mySidenav .sn-close-btn,
html[data-mapiole-theme="dark"] body #mySidenav .sn-card {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-mapiole-theme="dark"] body #mySidenav .sn-sub a,
html[data-mapiole-theme="dark"] body #mySidenav .sn-section-label {
  color: #b7c2d0 !important;
  -webkit-text-fill-color: #b7c2d0 !important;
}

html[data-mapiole-theme="dark"] body #mySidenav .sn-row,
html[data-mapiole-theme="dark"] body #mySidenav .sn-section,
html[data-mapiole-theme="dark"] body #mySidenav .sn-cta-row,
html[data-mapiole-theme="dark"] body #mySidenav .sn-sub a {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-mapiole-theme="dark"] body #mySidenav .sn-row:hover,
html[data-mapiole-theme="dark"] body #mySidenav .sn-flat:hover,
html[data-mapiole-theme="dark"] body #mySidenav .sn-sub a:hover,
html[data-mapiole-theme="dark"] body #mySidenav .sn-header-icon:hover,
html[data-mapiole-theme="dark"] body #mySidenav .sn-close-btn:hover {
  background: #10243a !important;
}

html[data-mapiole-theme="dark"] body #mySidenav .sn-card {
  background: #10243a !important;
}

html[data-mapiole-theme="light"] body .mp-floating-translator {
  background: #ffffff !important;
  border-color: rgba(8, 22, 39, 0.12) !important;
  color: #0a2d56 !important;
}

html[data-mapiole-theme="dark"] body .mp-floating-translator {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
}

html[data-mapiole-theme="dark"] body .mp-floating-translator select,
html[data-mapiole-theme="light"] body .mp-floating-translator select {
  background: transparent !important;
  color: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
}

/* Tables */
html[data-mapiole-theme="dark"] body .table,
html[data-mapiole-theme="dark"] body table:not(.leaflet-container table) {
  --bs-table-bg: #071525;
  --bs-table-color: #e8edf4;
  --bs-table-border-color: rgba(255, 255, 255, 0.12);
  color: var(--mp-text);
}

html[data-mapiole-theme="dark"] body .table-light,
html[data-mapiole-theme="dark"] body thead {
  --bs-table-bg: #10243a;
  --bs-table-color: #ffffff;
}

/* Product listing */
html[data-mapiole-theme="light"] body .mp-listing-page {
  background:
    radial-gradient(circle at top left, rgba(211, 1, 253, 0.07), transparent 30%),
    radial-gradient(circle at top right, rgba(34, 78, 106, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #f6f7f4 100%) !important;
}

html[data-mapiole-theme="dark"] body .mp-listing-page {
  background:
    radial-gradient(circle at top left, rgba(211, 1, 253, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(34, 78, 106, 0.2), transparent 28%),
    linear-gradient(180deg, #081627 0%, #061321 100%) !important;
}

html[data-mapiole-theme="dark"] body .mp-listing-title h1,
html[data-mapiole-theme="dark"] body .mp-listing-title h1 span {
  color: #e43bff !important;
  -webkit-text-fill-color: #e43bff !important;
}

html[data-mapiole-theme="dark"] body .mp-listing-title p {
  color: #b7c2d0 !important;
}

html[data-mapiole-theme="light"] body .mp-listing-search .search-filter-form,
html[data-mapiole-theme="light"] body .mp-listing-search .search-bar,
html[data-mapiole-theme="light"] body .mp-listing-search .gradient-border .form-control,
html[data-mapiole-theme="light"] body .mp-listing-search .gradient-border .form-select,
html[data-mapiole-theme="light"] body .mp-listing-search .gradient-border button,
html[data-mapiole-theme="light"] body .mp-listing-search .search-category .list-group-item {
  background: #ffffff !important;
  color: #0a2d56 !important;
  -webkit-text-fill-color: #0a2d56 !important;
}

html[data-mapiole-theme="dark"] body .mp-listing-search .search-filter-form,
html[data-mapiole-theme="dark"] body .mp-listing-search .search-bar {
  background: rgba(7, 21, 37, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 24px 70px rgba(8, 22, 39, 0.34) !important;
}

html[data-mapiole-theme="dark"] body .mp-listing-search .gradient-border .form-control,
html[data-mapiole-theme="dark"] body .mp-listing-search .gradient-border .form-select {
  background: #0b1c2e !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-mapiole-theme="dark"] body .mp-listing-search .filter-section-label {
  color: #b7c2d0 !important;
}

html[data-mapiole-theme="dark"] body .mp-listing-search .search-category .list-group-item {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-mapiole-theme="dark"] body .mp-listing-search .search-category .list-group-item.bt-active {
  background: rgba(211, 1, 253, 0.16) !important;
  color: #e43bff !important;
  -webkit-text-fill-color: #e43bff !important;
}

html[data-mapiole-theme="light"] body #pl-map-toggle,
html[data-mapiole-theme="light"] body .mp-country-pill {
  background: #ffffff !important;
  color: #0a2d56 !important;
}

html[data-mapiole-theme="dark"] body #pl-map-toggle,
html[data-mapiole-theme="dark"] body .mp-country-pill {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #e8edf4 !important;
}

html[data-mapiole-theme="dark"] body #pl-nearby-btn {
  background: rgba(4, 120, 87, 0.18) !important;
  border-color: rgba(52, 211, 153, 0.38) !important;
  color: #6ee7b7 !important;
}

html[data-mapiole-theme="light"] body .mp-product-col .prop-card {
  background: #ffffff !important;
  border-color: rgba(8, 22, 39, 0.1) !important;
}

html[data-mapiole-theme="dark"] body .mp-product-col .prop-card {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 18px 48px rgba(8, 22, 39, 0.28) !important;
}

html[data-mapiole-theme="dark"] body .mp-product-col .prop-card__title,
html[data-mapiole-theme="dark"] body .mp-product-col .prop-card__price-amount {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-mapiole-theme="dark"] body .mp-product-col .prop-card__location,
html[data-mapiole-theme="dark"] body .mp-product-col .prop-card__total,
html[data-mapiole-theme="dark"] body .mp-product-col .prop-card__meta {
  color: #b7c2d0 !important;
  -webkit-text-fill-color: #b7c2d0 !important;
}

html[data-mapiole-theme="dark"] body .mp-product-col .prop-card__badge {
  background: rgba(7, 21, 37, 0.9) !important;
  color: #e43bff !important;
}

html[data-mapiole-theme="dark"] body .custom-dropdown-content {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-mapiole-theme="dark"] body .custom-dropdown-content a {
  color: #e8edf4 !important;
}

html[data-mapiole-theme="dark"] body .custom-dropdown-content a:hover {
  background: rgba(211, 1, 253, 0.16) !important;
  color: #e43bff !important;
}

/* Shared filter modal */
html[data-mapiole-theme="dark"] body #filterOptionsModal .modal-content,
html[data-mapiole-theme="dark"] body #filterOptionsModal .modal-header,
html[data-mapiole-theme="dark"] body #filterOptionsModal .modal-footer {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-mapiole-theme="dark"] body #filterOptionsModal .sf-amenity-chip label {
  background: #0b1c2e !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #e8edf4 !important;
}

/* Professionals and professional details */
html[data-mapiole-theme="dark"] body .pros-page,
html[data-mapiole-theme="dark"] body .mp-professional-page {
  background:
    radial-gradient(circle at top left, rgba(211, 1, 253, 0.14), transparent 30%),
    linear-gradient(180deg, #081627 0%, #061321 100%) !important;
  color: #e8edf4 !important;
}

html[data-mapiole-theme="dark"] body .pros-filter-card,
html[data-mapiole-theme="dark"] body .pros-card,
html[data-mapiole-theme="dark"] body .pros-summary-card,
html[data-mapiole-theme="dark"] body .mp-pro-card,
html[data-mapiole-theme="dark"] body .mp-pro-section,
html[data-mapiole-theme="dark"] body .mp-profile-empty {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e8edf4 !important;
  box-shadow: var(--mp-shadow) !important;
}

/* LandFlex, package and common public page surfaces */
html[data-mapiole-theme="dark"] body .lfx-page,
html[data-mapiole-theme="dark"] body .pkg-section {
  background: #081627 !important;
  color: #e8edf4 !important;
}

html[data-mapiole-theme="dark"] body .lfx-card,
html[data-mapiole-theme="dark"] body .lfx-table td,
html[data-mapiole-theme="dark"] body .lfx-table th,
html[data-mapiole-theme="dark"] body .pkg-pub-card {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e8edf4 !important;
}

html[data-mapiole-theme="dark"] body .lfx-metric {
  background: linear-gradient(135deg, rgba(211, 1, 253, 0.15), rgba(34, 78, 106, 0.25)) !important;
}

html[data-mapiole-theme="dark"] body .lfx-metric strong,
html[data-mapiole-theme="dark"] body .lfx-form label {
  color: #f8fafc !important;
}

html[data-mapiole-theme="dark"] body .lfx-outline {
  background: #0b1c2e !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #f8fafc !important;
}

/* Property details */
html[data-mapiole-theme="dark"] body .ab-title,
html[data-mapiole-theme="dark"] body .ab-subtitle,
html[data-mapiole-theme="dark"] body .ab-subtitle a,
html[data-mapiole-theme="dark"] body .ab-action-btn,
html[data-mapiole-theme="dark"] body .ab-keyfact-value,
html[data-mapiole-theme="dark"] body .ab-highlight-icon,
html[data-mapiole-theme="dark"] body .ab-highlight-text h4,
html[data-mapiole-theme="dark"] body .ab-description,
html[data-mapiole-theme="dark"] body .ab-show-more,
html[data-mapiole-theme="dark"] body .ab-section-title,
html[data-mapiole-theme="dark"] body .ab-amenity,
html[data-mapiole-theme="dark"] body .ab-amenity i,
html[data-mapiole-theme="dark"] body .ab-detail-row .ab-dv,
html[data-mapiole-theme="dark"] body .ab-sidebar-price,
html[data-mapiole-theme="dark"] body .ab-nearby-item .ab-nb-value,
html[data-mapiole-theme="dark"] body .ab-floorplan-toggle,
html[data-mapiole-theme="dark"] body .ab-share-dropdown a,
html[data-mapiole-theme="dark"] body .mp-rent-live-card h6 {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-mapiole-theme="dark"] body .ab-keyfact-label,
html[data-mapiole-theme="dark"] body .ab-highlight-text p,
html[data-mapiole-theme="dark"] body .ab-detail-row .ab-dl,
html[data-mapiole-theme="dark"] body .ab-sidebar-price .ab-price-suffix,
html[data-mapiole-theme="dark"] body .ab-terms,
html[data-mapiole-theme="dark"] body .ab-nearby-item .ab-nb-label {
  color: #b7c2d0 !important;
  -webkit-text-fill-color: #b7c2d0 !important;
}

html[data-mapiole-theme="dark"] body .ab-keyfact,
html[data-mapiole-theme="dark"] body .ab-sidebar-card,
html[data-mapiole-theme="dark"] body .ab-share-dropdown,
html[data-mapiole-theme="dark"] body .mp-rent-live-card,
html[data-mapiole-theme="dark"] body .ab-review-card {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: var(--mp-shadow) !important;
}

html[data-mapiole-theme="dark"] body .ab-floorplan-toggle,
html[data-mapiole-theme="dark"] body .ab-nearby-item,
html[data-mapiole-theme="dark"] body .ab-action-btn:hover,
html[data-mapiole-theme="dark"] body .ab-share-dropdown a:hover {
  background: #10243a !important;
}

html[data-mapiole-theme="dark"] body .ab-divider,
html[data-mapiole-theme="dark"] body .ab-amenity,
html[data-mapiole-theme="dark"] body .ab-detail-row,
html[data-mapiole-theme="dark"] body .ab-related,
html[data-mapiole-theme="dark"] body .ab-sidebar-divider {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-mapiole-theme="dark"] body .ab-description.collapsed::after {
  background: linear-gradient(transparent, #081627) !important;
}

html[data-mapiole-theme="dark"] body .ab-show-all-btn,
html[data-mapiole-theme="dark"] body .ab-btn-outline,
html[data-mapiole-theme="dark"] body .ab-gallery-show-all {
  background: #0b1c2e !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #f8fafc !important;
}

/* Dynamic service pages */
html[data-mapiole-theme="dark"] body .sd-content,
html[data-mapiole-theme="dark"] body .sd-sidebar-card,
html[data-mapiole-theme="dark"] body .sd-nav-strip {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: var(--mp-shadow) !important;
}

html[data-mapiole-theme="dark"] body .sd-content h1,
html[data-mapiole-theme="dark"] body .sd-content h2,
html[data-mapiole-theme="dark"] body .sd-content h3,
html[data-mapiole-theme="dark"] body .sd-content strong,
html[data-mapiole-theme="dark"] body .sd-sidebar-card__title {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-mapiole-theme="dark"] body .sd-content p,
html[data-mapiole-theme="dark"] body .sd-content ul,
html[data-mapiole-theme="dark"] body .sd-content ol,
html[data-mapiole-theme="dark"] body .sd-svc-list a,
html[data-mapiole-theme="dark"] body .sd-nav-link,
html[data-mapiole-theme="dark"] body .sd-contact-form label {
  color: #b7c2d0 !important;
  -webkit-text-fill-color: #b7c2d0 !important;
}

/* Buy, sell, rent and build landing pages */
html[data-mapiole-theme="dark"] body .cat-stats {
  background: linear-gradient(135deg, rgba(211, 1, 253, 0.13), rgba(34, 78, 106, 0.22)) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-mapiole-theme="dark"] body .cat-props,
html[data-mapiole-theme="dark"] body .cat-services,
html[data-mapiole-theme="dark"] body .svc-dash {
  background: #081627 !important;
}

html[data-mapiole-theme="dark"] body .cat-svc-card,
html[data-mapiole-theme="dark"] body .svc-blog-featured,
html[data-mapiole-theme="dark"] body .svc-blog-card,
html[data-mapiole-theme="dark"] body .svc-grid-card {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: var(--mp-shadow) !important;
}

html[data-mapiole-theme="dark"] body .cat-props__title,
html[data-mapiole-theme="dark"] body .cat-svc-card__title,
html[data-mapiole-theme="dark"] body .svc-dash__title,
html[data-mapiole-theme="dark"] body .svc-blog-featured__title,
html[data-mapiole-theme="dark"] body .svc-blog-card__title,
html[data-mapiole-theme="dark"] body .svc-grid-card__title {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-mapiole-theme="dark"] body .cat-stat__label,
html[data-mapiole-theme="dark"] body .cat-svc-card__desc,
html[data-mapiole-theme="dark"] body .svc-dash__count,
html[data-mapiole-theme="dark"] body .svc-blog-featured__desc,
html[data-mapiole-theme="dark"] body .svc-blog-card__desc,
html[data-mapiole-theme="dark"] body .svc-grid-card__desc {
  color: #b7c2d0 !important;
  -webkit-text-fill-color: #b7c2d0 !important;
}

/* Legacy pages that still use inline white/light panels. Restrict the
   compatibility selector to structural elements so buttons and badges keep
   their intended colors. */
html[data-mapiole-theme="dark"] body div[style*="background: white"]:not(#footer *),
html[data-mapiole-theme="dark"] body div[style*="background:white"]:not(#footer *),
html[data-mapiole-theme="dark"] body section[style*="background: white"],
html[data-mapiole-theme="dark"] body section[style*="background:white"],
html[data-mapiole-theme="dark"] body div[style*="background: #F9FAFB"],
html[data-mapiole-theme="dark"] body div[style*="background:#F9FAFB"],
html[data-mapiole-theme="dark"] body div[style*="background: #f8fafc"],
html[data-mapiole-theme="dark"] body div[style*="background:#f8fafc"] {
  background: #071525 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e8edf4 !important;
}

html[data-mapiole-theme="dark"] body small[style*="#081627"],
html[data-mapiole-theme="dark"] body small[style*="#420654"] {
  color: #b7c2d0 !important;
  -webkit-text-fill-color: #b7c2d0 !important;
}

/* Mobile bottom navigation */
html[data-mapiole-theme="light"] body .icon-buttons {
  background: rgba(255, 255, 255, 0.96) !important;
  border-top-color: rgba(8, 22, 39, 0.1) !important;
}

html[data-mapiole-theme="dark"] body .icon-buttons {
  background: rgba(7, 21, 37, 0.96) !important;
  border-top-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 -12px 34px rgba(8, 22, 39, 0.28) !important;
}

html[data-mapiole-theme="light"] body .icon-button {
  color: #0a2d56 !important;
}

html[data-mapiole-theme="dark"] body .icon-button {
  color: #b7c2d0 !important;
}

html[data-mapiole-theme="dark"] body .icon-button.active,
html[data-mapiole-theme="dark"] body .icon-button.activeBtn,
html[data-mapiole-theme="dark"] body .icon-button:hover {
  color: #e43bff !important;
}

/* The footer is intentionally a stable dark brand surface in both modes. */
body #footer.footer {
  background: linear-gradient(135deg, #071525 0%, #10243a 55%, #173b63 100%) !important;
}

body #footer.footer,
body #footer.footer p,
body #footer.footer a,
body #footer.footer span,
body #footer.footer strong,
body #footer.footer b,
body #footer.footer h1,
body #footer.footer h2,
body #footer.footer h3,
body #footer.footer h4,
body #footer.footer h5,
body #footer.footer h6 {
  color: rgba(255, 255, 255, 0.86) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.86) !important;
}

body #footer.footer a:hover {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body #footer.footer .downloadBtn,
body #footer.footer .downloadBtn span {
  color: #9200b5 !important;
  -webkit-text-fill-color: #9200b5 !important;
}

body #footer.footer input {
  background: transparent !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body #footer.footer input::placeholder {
  color: rgba(255, 255, 255, 0.58) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.58) !important;
}

body #footer.footer .list-group,
body #footer.footer .list-group-item,
body #footer.footer .list-group-item-action,
body #footer.footer .bg-transparent {
  background: transparent !important;
  background-color: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* White buttons always use the Mapiole primary text color. */
body .btn-light:not(:hover),
body .btn-white:not(.active),
body .btn.bg-white,
body .btn-dark:not(:hover),
body .btn-outline-dark:not(:hover),
body .btn-secondary:not(:hover),
body .btn-outline-secondary:not(:hover),
body .mp-btn-white,
body .mp-btn-secondary:not(:hover),
body .mn-btn-outline,
body .mn-market-btn,
body .mn-market-close,
body .mn-tab:not(.active),
body .mp-filter-btn,
body .mp-pl-filter-btn,
body .mp-pl-icon-btn,
body .mp-pl-alert-btn,
body .pros-btn-reset,
body .ab-show-all-btn,
body .ab-btn-outline,
body .ab-action-btn,
body .sd-cta-card__btn,
body .mp-secondary-pill:not(:hover),
body .home-landflex-btn.secondary,
body .amb-btn:not(.amb-btn-primary),
body a[class*="btn"][style*="background:#fff"],
body a[class*="btn"][style*="background: #fff"],
body a[class*="btn"][style*="background:white"],
body a[class*="btn"][style*="background: white"],
body a[class*="btn"][style*="background-color:#fff"],
body a[class*="btn"][style*="background-color: #fff"],
body a[class*="btn"][style*="background-color:white"],
body a[class*="btn"][style*="background-color: white"],
body button[class*="btn"][style*="background:#fff"],
body button[class*="btn"][style*="background: #fff"],
body button[class*="btn"][style*="background:white"],
body button[class*="btn"][style*="background: white"],
body button[class*="btn"][style*="background-color:#fff"],
body button[class*="btn"][style*="background-color: #fff"],
body button[class*="btn"][style*="background-color:white"],
body button[class*="btn"][style*="background-color: white"] {
  background-color: #ffffff;
  color: #0a2d56 !important;
  -webkit-text-fill-color: #0a2d56 !important;
}

body .btn-light:not(:hover) *,
body .btn-white:not(.active) *,
body .btn.bg-white *,
body .btn-dark:not(:hover) *,
body .btn-outline-dark:not(:hover) *,
body .btn-secondary:not(:hover) *,
body .btn-outline-secondary:not(:hover) *,
body .mp-btn-white *,
body .mp-btn-secondary:not(:hover) *,
body .mn-btn-outline *,
body .mn-tab:not(.active) *,
body .mp-filter-btn *,
body .mp-pl-filter-btn *,
body .mp-pl-icon-btn *,
body .mp-pl-alert-btn *,
body .pros-btn-reset *,
body .ab-show-all-btn *,
body .ab-btn-outline *,
body .ab-action-btn *,
body .sd-cta-card__btn *,
body .mp-secondary-pill:not(:hover) *,
body .home-landflex-btn.secondary *,
body .amb-btn:not(.amb-btn-primary) * {
  color: #0a2d56 !important;
  -webkit-text-fill-color: #0a2d56 !important;
}

/* Purple brand buttons always keep readable white labels and icons. */
body .btn-primary,
body .orangeBtn,
body .addPropertyBtn,
body .btn-dark:hover,
body .btn-outline-dark:hover,
body .btn-dark.active,
body .btn-outline-dark.active,
body .btn-check:checked + .btn-dark,
body .btn-check:checked + .btn-outline-dark,
body .btn-secondary:hover,
body .btn-outline-secondary:hover,
body .btn-secondary.active,
body .btn-outline-secondary.active,
body .btn-check:checked + .btn-secondary,
body .btn-check:checked + .btn-outline-secondary,
body .mp-btn-primary,
body .mp-btn-secondary:hover,
body .mp-btn-outline:hover,
body .mn-btn-primary,
body .mn-tab.active,
body .sn-cta-btn,
body .ab-btn-primary,
body .amb-btn-primary,
body .home-landflex-btn.primary,
body .mp-search-btn,
body .mp-link-pill,
body .mp-pl-cta-btn.primary,
body .mp-pl-plan:first-child button,
body :is(a, button, input[type="submit"], input[type="button"], .btn, .mp-btn)[style*="background" i][style*="var(--primary" i],
body :is(a, button, input[type="submit"], input[type="button"], .btn, .mp-btn)[style*="background" i][style*="#b900e5" i],
body :is(a, button, input[type="submit"], input[type="button"], .btn, .mp-btn)[style*="background" i][style*="#d301fd" i],
body :is(a, button, input[type="submit"], input[type="button"], .btn, .mp-btn)[style*="background" i][style*="#c026d3" i],
body :is(a, button, input[type="submit"], input[type="button"], .btn, .mp-btn)[style*="background" i][style*="#7c3aed" i] {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body .btn-primary *,
body .orangeBtn *,
body .addPropertyBtn *,
body .btn-dark:hover *,
body .btn-outline-dark:hover *,
body .btn-dark.active *,
body .btn-outline-dark.active *,
body .btn-check:checked + .btn-dark *,
body .btn-check:checked + .btn-outline-dark *,
body .btn-secondary:hover *,
body .btn-outline-secondary:hover *,
body .btn-secondary.active *,
body .btn-outline-secondary.active *,
body .btn-check:checked + .btn-secondary *,
body .btn-check:checked + .btn-outline-secondary *,
body .mp-btn-primary *,
body .mp-btn-secondary:hover *,
body .mp-btn-outline:hover *,
body .mn-btn-primary *,
body .mn-tab.active *,
body .sn-cta-btn *,
body .ab-btn-primary *,
body .amb-btn-primary *,
body .home-landflex-btn.primary *,
body .mp-search-btn *,
body .mp-link-pill *,
body .mp-pl-cta-btn.primary *,
body .mp-pl-plan:first-child button *,
body :is(a, button, .btn, .mp-btn)[style*="background" i][style*="var(--primary" i] *,
body :is(a, button, .btn, .mp-btn)[style*="background" i][style*="#b900e5" i] *,
body :is(a, button, .btn, .mp-btn)[style*="background" i][style*="#d301fd" i] *,
body :is(a, button, .btn, .mp-btn)[style*="background" i][style*="#c026d3" i] *,
body :is(a, button, .btn, .mp-btn)[style*="background" i][style*="#7c3aed" i] * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Scrollbars and selection follow the active theme. */
html[data-mapiole-theme="light"] ::-webkit-scrollbar-track {
  background: #eef1f5;
}

html[data-mapiole-theme="light"] ::-webkit-scrollbar-thumb {
  background: #b9c1cc;
}

html[data-mapiole-theme="dark"] ::-webkit-scrollbar-track {
  background: #081627;
}

html[data-mapiole-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #30465e;
}

html[data-mapiole-theme="dark"] ::selection {
  background: rgba(217, 70, 239, 0.34);
  color: #ffffff;
}

@media (max-width: 991.98px) {
  body .mp-listing-page {
    padding-top: 20px !important;
  }

  body .mp-listing-search .search-filter-form {
    border-radius: 0 0 20px 20px !important;
  }
}
