/* MI CASA · Modo Oscuro 1.4.0
   WPResidence | Se aplica exclusivamente si html tiene .micasa-dark.
   NO se invierten imágenes, mapas, videos, fondos fotográficos ni logotipos.
*/
html.micasa-dark {
  color-scheme: dark;
  --mcd-bg: #111820;
  --mcd-surface: #1D2732;
  --mcd-field: #273441;
  --mcd-text: #F3F6FA;
  --mcd-muted: #B7C4D2;
  --mcd-border: #364553;
  --mcd-accent: #C5A46D;
  --mcd-light-ink: #16212c;
  --mcd-footer: #111820;
}

/* 1. Fondo base: evita islas blancas cuando los módulos son transparentes. */
html.micasa-dark,
html.micasa-dark body,
html.micasa-dark #all_wrapper,
html.micasa-dark .website-wrapper,
html.micasa-dark #content_container,
html.micasa-dark #content_wrapper,
html.micasa-dark .content_wrapper,
html.micasa-dark .master_content,
html.micasa-dark .main_wrapper,
html.micasa-dark .page-wrapper,
html.micasa-dark .single-content-wrapper,
html.micasa-dark .property_page_container,
html.micasa-dark .property-page-wrapper,
html.micasa-dark .site-content,
html.micasa-dark .content-area,
html.micasa-dark #primary {
  background-color: var(--mcd-bg) !important;
  color: var(--mcd-text) !important;
}
/* Elementos claros localizados por color real computado en JS, no por etiquetas genéricas.
   Así no se oscurecen fotografías hero, estados de propiedades o mapas. */
html.micasa-dark .mcd-auto-section {
  background-color: var(--mcd-bg) !important;
  background-image: none !important;
  border-color: var(--mcd-border) !important;
  color: var(--mcd-text) !important;
}
html.micasa-dark .mcd-auto-surface {
  background-color: var(--mcd-surface) !important;
  border-color: var(--mcd-border) !important;
  color: var(--mcd-text) !important;
}
/* Texto encontrado con ratio de contraste insuficiente; no se fuerzan iconos. */
html.micasa-dark .mcd-contrast-light { color: var(--mcd-text) !important; -webkit-text-fill-color: var(--mcd-text) !important; }
html.micasa-dark .mcd-contrast-muted { color: var(--mcd-muted) !important; -webkit-text-fill-color: var(--mcd-muted) !important; }
html.micasa-dark .mcd-contrast-dark { color: var(--mcd-light-ink) !important; -webkit-text-fill-color: var(--mcd-light-ink) !important; }

/* 2. Cabecera: conservar logo y fotos; cambiar superficies y textos. */
html.micasa-dark :is(.header_wrapper, .header-wrapper, .master_header, .header_wrapper_inside,
 .sticky_header, .sticky_header_wrapper, .mobile_header, .mobile_header_wrapper,
 .mobilemenu-wrapper, .mobilex-menu, .sub-menu, #access ul ul, .dropdown-menu,
 .wpestate-menu, .header_media) {
  border-color: var(--mcd-border) !important;
}
html.micasa-dark :is(.header_wrapper, .header-wrapper, .master_header,
 .sticky_header, .sticky_header_wrapper, .mobile_header, .mobile_header_wrapper,
 .mobilemenu-wrapper, .mobilex-menu, #access ul ul, .header_wrapper .sub-menu) {
  background-color: var(--mcd-surface) !important;
}
html.micasa-dark :is(.header_wrapper, .header-wrapper, .master_header,
 .mobile_header, .mobile_header_wrapper, .mobilex-menu, #access) a:not(.wpestate_button):not(.elementor-button),
html.micasa-dark :is(.header_wrapper, .header-wrapper, #access) :is(.menu-item, .menu-item span) {
  color: var(--mcd-text) !important;
}
html.micasa-dark :is(.header_wrapper, .header-wrapper, #access) a:hover { color: var(--mcd-accent) !important; }

/* 3. WPResidence, fichas, títulos y bloques de propiedad. */
html.micasa-dark :is(
 .property_listing, .property_listing_content, .property_listing_details, .property-page-overview,
 .property-page-overview-details-wrapper, .property-panel, .property-panel-body,
 .property_page_tab, .property-page-accordion, .property-page-accordion-content,
 .property_page_accordion, .property_page_description, .property-page-description,
 .property-page-description-wrapper, .property_details_wrapper, .property_detail_wrapper,
 .property_descriptiom_text, .wpestate_property_description, .wpestate_property_description_section,
 .property_map_wrapper, .property_map_container, .property_address_wrapper,
 .property_address, .property_features_wrapper, .features_wrapper,
 .property_menu_wrapper, .property_details, .property_content,
 .agent_unit, .agent_unit_widget, .agent_contanct_form, .agent_contact_wrapper,
 .widget-area .widget, .widget-container, .widget_sidebar, .widget,
 .white_back, .panel, .panel-body, .panel-default, .panel-heading,
 .modal-content, .popover, .tab-content, .accordion, .accordion-inner,
 .user_dashboard_content, .wpestate_dashboard_content_wrapper,
 .listing_filters, .listing_filters_head, .featured_property, .blog_unit,
 .contact_form_wrapper, .contact_form, .search_wrapper, .search_wrapper_optimized
 ) {
  background-color: var(--mcd-surface) !important;
  border-color: var(--mcd-border) !important;
  color: var(--mcd-text) !important;
}
/* WPResidence utiliza tarjetas dentro de columnas que ya son oscuras. */
html.micasa-dark :is(.property_listing, .property_listing_content, .property-panel,
 .property-page-overview, .property_details_wrapper, .property_address_wrapper,
 .widget-container, .agent_contact_wrapper) :is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,label,small,strong,b) {
  color: var(--mcd-text) !important;
}
html.micasa-dark :is(.property_listing, .property_listing_content, .property_listing_details,
 .property_details_wrapper, .property_address_wrapper, .property-page-overview,
 .property-panel, .property_detail_wrapper) :is(.listing_detail, .property_detail, .listing_details,
 .property_unit_price_wrapper, .property_listing_details, .property_price, .property_details_item) {
  color: var(--mcd-muted) !important;
}
html.micasa-dark :is(.property_listing, .property_listing_content, .property_address_wrapper,
 .property_details_wrapper, .property-page-overview) a:not(.elementor-button) { color: var(--mcd-text) !important; }
html.micasa-dark .property_listing a:hover { color: var(--mcd-accent) !important; }
/* Estados de venta/vendido y botones dorados: los conserva el tema. */
html.micasa-dark :is(.ribbon-inside, .ribbon-wrapper, .property_status, .property-status,
 .status-wrapper, .property-status-label, .tag-wrapper, .listing-tag,
 .property_badge, .property_label, .featured_div) {
  forced-color-adjust: none;
}

/* 4. Paneles de descripción, mapa y ficha lateral que aparecen en las capturas. */
html.micasa-dark :is(.property-panel-header, .panel-heading,
 .property-page-accordion-title, .accordion-heading, .property_page_tab_title,
 .property-page-overview-title, .property-map-title, .property_map_title,
 .property_content_header, .listing_detail_header) {
  background-color: var(--mcd-surface) !important;
  color: var(--mcd-text) !important;
  border-color: var(--mcd-border) !important;
}
html.micasa-dark :is(.property_map_wrapper, .property_map_container,
 .property-page-description-wrapper, .property-page-overview,
 .property_address_wrapper, .contact_form_wrapper) :is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,label,small,strong,span):not(.ribbon-inside):not(.property_status):not(.leaflet-container *) {
  color: var(--mcd-text) !important;
}

/* 5. Textos de las secciones generales / Elementor.
   No imponemos texto blanco sobre portadas con fotos ni sobre botones de colores. */
html.micasa-dark :is(.master_content, .content_wrapper, .entry-content,
 .elementor-widget-heading, .elementor-widget-text-editor,
 .wpb_text_column, .wpb_wrapper) :is(h1,h2,h3,h4,h5,h6) {
  color: var(--mcd-text) !important;
}
html.micasa-dark :is(.master_content, .content_wrapper, .entry-content,
 .elementor-widget-text-editor, .wpb_text_column) :is(p,li,blockquote,dt,dd) {
  color: var(--mcd-muted) !important;
}
html.micasa-dark :is(.elementor-widget-tabs .elementor-tab-content,
 .elementor-widget-tabs .elementor-tab-title, .elementor-accordion .elementor-accordion-item,
 .elementor-accordion .elementor-tab-content, .elementor-toggle .elementor-tab-content,
 .elementor-price-table, .elementor-post__card, .elementor-form .elementor-field-textual,
 .wp-block-group, .wp-block-columns, .wp-block-table, .wp-block-search__input) {
  background-color: var(--mcd-surface) !important;
  color: var(--mcd-text) !important;
  border-color: var(--mcd-border) !important;
}
html.micasa-dark :is(.elementor-accordion .elementor-tab-title,
 .elementor-toggle .elementor-tab-title, .elementor-widget-icon-list .elementor-icon-list-text) {
  color: var(--mcd-text) !important;
}

/* 6. Formularios y desplegables WPResidence / select2, con placeholders visibles. */
html.micasa-dark :is(.adv-search-1, .adv-search-3, .adv_search_slider,
 .advanced_search_shortcode, .advanced_search_container, .advanced_search_wrapper,
 .search_wrapper, .search_wr_elementor, .search_form_wrapper, .searchform,
 .adv-search-wrapper, .search_wrapper_optimized) {
  background-color: var(--mcd-surface) !important;
  color: var(--mcd-text) !important;
  border-color: var(--mcd-border) !important;
}
html.micasa-dark input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
html.micasa-dark textarea,
html.micasa-dark select,
html.micasa-dark .form-control,
html.micasa-dark .select2-container--default .select2-selection--single,
html.micasa-dark .select2-container--default .select2-selection--multiple,
html.micasa-dark .select2-dropdown,
html.micasa-dark .select2-results__option,
html.micasa-dark .bootstrap-select > .dropdown-toggle,
html.micasa-dark .chosen-container-single .chosen-single,
html.micasa-dark .ui-autocomplete,
html.micasa-dark .ui-menu,
html.micasa-dark .wpestate-multiselect-container {
  background-color: var(--mcd-field) !important;
  color: var(--mcd-text) !important;
  border-color: var(--mcd-border) !important;
}
html.micasa-dark :is(input,textarea)::placeholder { color: var(--mcd-muted) !important; opacity:1 !important; }
html.micasa-dark :is(input,textarea,select):focus { border-color: var(--mcd-accent) !important; }
html.micasa-dark :is(.select2-container--default .select2-selection--single .select2-selection__rendered,
 .select2-container--default .select2-results__option, .bootstrap-select .filter-option,
 .dropdown-menu > li > a) { color: var(--mcd-text) !important; }
html.micasa-dark :is(.select2-results__option--highlighted, .dropdown-menu > li > a:hover) {
  background-color: var(--mcd-border) !important;
}
html.micasa-dark :is(input,select,textarea,button,a):focus-visible {
  outline: 2px solid var(--mcd-accent) !important;
  outline-offset: 2px;
}

/* 7. Tabla, lista, pie de página, popup y zonas generales. */
html.micasa-dark :is(table, .table, table td, table th, .modal-content,
 .woocommerce table.shop_table, .woocommerce ul.products li.product,
 .woocommerce-checkout #payment) {
  background-color: var(--mcd-surface) !important;
  color: var(--mcd-text) !important;
  border-color: var(--mcd-border) !important;
}
html.micasa-dark :is(.footer-wrapper, #colophon, footer.site-footer,
 .sub_footer, #subfooter, .footer_wrapper) {
  background-color: var(--mcd-footer) !important;
  border-color: var(--mcd-border) !important;
  color: var(--mcd-text) !important;
}
html.micasa-dark :is(.footer-wrapper, #colophon, .sub_footer, .footer_wrapper)
 :is(p,li,span,a,small,h2,h3,h4) { color: var(--mcd-text) !important; }
html.micasa-dark :is(.footer-wrapper, #colophon) a:hover { color: var(--mcd-accent) !important; }
html.micasa-dark :is(hr,.border_bottom,.listing_detail,.property_listing,.widget-container,
 .elementor-divider-separator,table td,table th) { border-color: var(--mcd-border) !important; }

/* 8. Leaflet, Google Maps y mapas de pago mantienen colores originales.
   No se aplican filter/invert/brightness a elementos multimedia. */
html.micasa-dark :is(.leaflet-container,.leaflet-pane,.leaflet-control,
 .leaflet-control-container,.gm-style,.gm-style *, .g-recaptcha,
 .grecaptcha-badge) { color-scheme: light; }
html.micasa-dark :is(.leaflet-control input, .leaflet-control select, .gm-style input) {
  background-color: #fff !important; color: #202a33 !important;
  border-color: #ddd !important;
}

/* 9. Botón independiente: permanece legible en ambos modos.
   En versión compacta sólo invade 46x46 px; el título aparece al posar el mouse. */
.mcd-widget {
  --mcd-toggle-bg: #1d2732;
  --mcd-toggle-text: #fff;
  --mcd-toggle-accent: #c5a46d;
  position: relative;
  z-index: 9999;
  color-scheme: dark;
  font: 600 13px/1.2 system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.mcd-widget.mcd-floating {
  position: fixed;
  bottom: max(var(--mcd-offset, 92px), calc(env(safe-area-inset-bottom, 0px) + 14px));
}
.mcd-widget.mcd-bottom-left { left: max(16px, env(safe-area-inset-left, 0px) + 12px); right:auto; }
.mcd-widget.mcd-bottom-right { right: max(16px, env(safe-area-inset-right, 0px) + 12px); left:auto; }
.mcd-widget.mcd-middle-left, .mcd-widget.mcd-middle-right { top: 50%; bottom:auto; transform: translateY(-50%); }
.mcd-widget.mcd-middle-left { left: 9px; right:auto; }
.mcd-widget.mcd-middle-right { right: 9px; left:auto; }
.mcd-widget.mcd-inline { position: relative; display: inline-block; }
.mcd-widget .mcd-toggle {
  box-sizing:border-box !important;
  display: inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap: 8px !important;
  min-width: 46px;
  min-height: 46px;
  padding: 10px 13px !important;
  border: 1px solid #465260 !important;
  border-radius: 100px !important;
  background: var(--mcd-toggle-bg) !important;
  color: var(--mcd-toggle-text) !important;
  box-shadow: 0 6px 23px rgba(0,0,0,.24);
  cursor:pointer;
  font: inherit !important;
  white-space:nowrap;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.mcd-widget .mcd-toggle:hover { border-color: var(--mcd-toggle-accent) !important; box-shadow: 0 8px 22px rgba(0,0,0,.3); }
.mcd-widget .mcd-toggle:focus-visible { outline: 3px solid var(--mcd-toggle-accent) !important; outline-offset: 3px; }
.mcd-widget .mcd-icon { width:20px;height:20px; display:block; flex:0 0 20px; color:var(--mcd-toggle-accent) !important; }
.mcd-widget .mcd-icon-sun { display:none; }
html.micasa-dark .mcd-widget .mcd-icon-sun { display:block; }
html.micasa-dark .mcd-widget .mcd-icon-moon { display:none; }
.mcd-widget.mcd-circle .mcd-toggle,
.mcd-widget.mcd-compact .mcd-toggle { width:46px;height:46px;padding:0 !important; }
.mcd-widget.mcd-circle .mcd-caption,
.mcd-widget.mcd-compact .mcd-caption { display:none; }
/* Un botón compactado siempre tiene descripción accessible y title en HTML. */
@media (max-width:767px) {
  .mcd-widget.mcd-bottom-left { left: 11px; }
  .mcd-widget.mcd-bottom-right { right:11px; }
  .mcd-widget.mcd-floating { bottom:max(var(--mcd-offset, 92px), calc(env(safe-area-inset-bottom,0px) + 12px)); }
  .mcd-widget.mcd-middle-left, .mcd-widget.mcd-middle-right { bottom:auto; }
  .mcd-widget.mcd-floating .mcd-toggle { width:44px; height:44px; min-width:44px; min-height:44px; padding:0 !important; }
  .mcd-widget.mcd-floating .mcd-caption { display:none; }
}
@media (prefers-reduced-motion:reduce) { .mcd-widget .mcd-toggle { transition:none; } }

/* ══════════════════════════════════════════════════════════════════════
   v1.3.0 — Correciones visuales en MI CASA: fotografía/planos/mapas intactos.
   Ajustes para cabeceras WPResidence, títulos claros y tarjetas de la ficha.
   Aplicados exclusivamente a la clase micasa-dark del documento.
   ══════════════════════════════════════════════════════════════════════ */

/* Cabecera con título, precio y cuadro resumen del inmueble, tras la galería. */
html.micasa-dark :is(
  .property-title-wrapper, .property_title_wrapper, .property-title-area,
  .property_title_area, .property-page-header, .property_page_header,
  .property-page-title, .property_page_title, .property-title,
  .property_title, .property-page-overview, .property-page-overview-wrapper,
  .property-page-overview-details-wrapper, .property_overview,
  .property_overview_wrapper, .single-estate_property .property-page-overview,
  .notice_area, .property_header, .listing_title_wrapper
) {
  color: var(--mcd-text) !important;
  border-color: var(--mcd-border) !important;
}
html.micasa-dark :is(
  .property-title-wrapper, .property_title_wrapper,
  .property-title-area, .property_title_area, .property-page-header,
  .property_page_header, .property-page-overview, .property-page-overview-wrapper,
  .property-page-overview-details-wrapper, .property_overview,
  .property_overview_wrapper, .listing_title_wrapper
) :is(h1,h2,h3,h4,h5,h6, .entry-title,.property_title, .property-page-title,
      .property_page_title, .property-title, .listing_title, .prop_title_zone,
      .property-overview-item, .property-overview-item-label,
      .property-overview-item-value, .property_detail, .listing_detail,
      .overview_details, .property-details-item, strong, label, span, p, small) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: currentColor !important;
}
/* WPResidence presenta valores (dormitorios, baños, metros, ID) en pequeñas cajas. */
html.micasa-dark :is(.property-page-overview, .property-page-overview-wrapper,
  .property-page-overview-details-wrapper, .property_overview,
  .property_overview_wrapper, .property-page-header,
  .property_page_header, .listing_title_wrapper) :is(div,li) {
  border-color: var(--mcd-border) !important;
}
html.micasa-dark :is(.property-page-overview, .property-page-header,
  .property_page_header, .listing_title_wrapper, .property_title_area)
  :is(.price_area,.price_label,.property_price,.property-price,.price, .listing-price,
      .property_price_label, .property_price_value, .property-price-value) {
  color: var(--mcd-accent) !important;
  -webkit-text-fill-color: var(--mcd-accent) !important;
}

/* WCAG en áreas negras/azul oscuro: títulos y cifras importantes se aclaran. */
html.micasa-dark .mcd-dark-context :is(h1,h2,h3,h4,h5,h6,
  .property_title,.entry-title,.listing_title,.property-price,.property_price,
  .property-page-overview-item, .property-page-overview-item span) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}

/* Títulos y encabezados de secciones con el fondo claro heredado del tema. */
html.micasa-dark .mcd-home-properties {
  background-color: var(--mcd-bg) !important;
  background-image: none !important; /* sólo esta sección, nunca fotografías */
  color: var(--mcd-text) !important;
}
html.micasa-dark .mcd-home-properties :is(.elementor-heading-title,h1,h2,h3,h4,h5,h6) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}
html.micasa-dark .mcd-home-properties :is(.elementor-widget-wrap,.e-con,.elementor-container,
  .elementor-column,.wpb_wrapper,.vc_column-inner,.vc_row,.widget-container) {
  border-color: var(--mcd-border) !important;
}

/* Mejoras selectivas para tarjetas del lado derecho, condiciones y paneles. */
html.micasa-dark :is(.property-sidebar,.property_sidebar,.property-page-sidebar,
  .property-page-sidebar-wrapper,.wpestate-property-sidebar) :is(
  .widget-container,.widget,.widget-content,.panel,.panel-body) {
  background-color: var(--mcd-surface) !important;
  color: var(--mcd-text) !important;
  border-color: var(--mcd-border) !important;
}
html.micasa-dark :is(.property-sidebar,.property_sidebar,.property-page-sidebar,
  .property-page-sidebar-wrapper,.wpestate-property-sidebar) :is(h1,h2,h3,h4,h5,h6,p,span,li,small,label) {
  color: var(--mcd-text) !important;
}
/* Uso condicional: clase agregada únicamente donde se detecta texto casi ilegible. */
html.micasa-dark .mcd-contrast-light,
html.micasa-dark .mcd-contrast-muted {
  text-shadow: none !important;
}

/* Formularios de búsquedas de inmuebles y el título del placeholder. */
html.micasa-dark :is(.advanced_search_shortcode,.adv-search-1,.adv-search-3,
  .search_wrapper,.advanced_search_wrapper,.search_wrapper_optimized,
  .adv-search-wrapper) :is(input:not([type=submit]), .form-control,
  .select2-selection__rendered,.filter-option,.search-input) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}
html.micasa-dark :is(.advanced_search_shortcode,.adv-search-1,.adv-search-3,
  .search_wrapper,.advanced_search_wrapper,.search_wrapper_optimized,
  .adv-search-wrapper) :is(input,textarea)::placeholder {
  color: var(--mcd-muted) !important;
  -webkit-text-fill-color: var(--mcd-muted) !important;
  opacity: 1 !important;
}

/* Prioridad máxima al mapa, imágenes de galería y planos adjuntos. */
html.micasa-dark :is(.leaflet-container,.gm-style,.property_slider,.property_listing_image,
 .property_image,.property-page-gallery,.property-gallery,.floor-plans-wrapper) img,
html.micasa-dark :is(.leaflet-container,.gm-style) :is(canvas,svg) {
  filter: none !important;
  mix-blend-mode: normal !important;
}

/* Accesibilidad: contraste y foco para el interruptor flotante. */
.mcd-widget.mcd-floating { z-index: 9960; }
.mcd-widget.mcd-floating .mcd-toggle { touch-action: manipulation; }
@media (max-width: 767px) {
  html.micasa-dark .mcd-home-properties { background-position: center center; }
}

/* Resumen del inmueble: variables concretas para precio y valores. */
html.micasa-dark :is(.property-title-wrapper,.property_title_wrapper,.property-page-header,
 .property_page_header,.listing_title_wrapper) :is(.price_area,.price_label,.property_price,
 .property-price,.listing-price,.property_price_value,.property_price_label) {
 color: var(--mcd-accent) !important;
 -webkit-text-fill-color: var(--mcd-accent) !important;
}
html.micasa-dark :is(.property-page-overview,.property-page-overview-wrapper,
 .property-page-overview-details-wrapper,.property_overview,.property_overview_wrapper)
 :is(div,span,li,dt,dd,strong,small,label,p) {
 color: var(--mcd-text) !important;
 -webkit-text-fill-color: var(--mcd-text) !important;
}

/* ========================================================================
   v1.4.0 — Revisión de capturas reales MI CASA, WPResidence/Elementor.
   Correcciones acotadas al modo oscuro: no afectan las fotografías, planos,
   vídeos, mapas, botones dorados ni el diseño claro del tema.
   ======================================================================== */

/* La página debe utilizar todo el viewport, sin bandas de otro color a los
   lados ni scroll horizontal generado por sus envoltorios principales. */
html.micasa-dark,
html.micasa-dark body {
  background: var(--mcd-bg) !important;
  overflow-x: clip;
}
html.micasa-dark :is(#all_wrapper,.website-wrapper,#content_container,
  #content_wrapper,.content_wrapper,.master_content,.main_wrapper,.site-content,
  .page-wrapper,.property_page_container,.property-page-wrapper) {
  box-sizing: border-box;
  background-color: var(--mcd-bg) !important;
  max-width: 100%;
}
/* Sólo si JS detecta un envoltorio principal de anchura superior al viewport. */
html.micasa-dark .mcd-layout-bound {
  width: 100% !important;
  max-width: 100vw !important;
  margin-inline: 0 !important;
  box-sizing: border-box !important;
}
html.micasa-dark :is(.mcd-home-properties-area,.mcd-home-properties) {
  background: var(--mcd-bg) !important;
  border-color: var(--mcd-border) !important;
}
html.micasa-dark :is(.mcd-home-title,.mcd-home-properties h1,
  .mcd-home-properties h2,.mcd-home-properties h3,
  .mcd-home-properties-area .elementor-heading-title) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Texto del encabezado de propiedad (debajo de la galería): títulos, cifras y
   los rótulos Dormitorios, Baños, Construcción e ID. */
html.micasa-dark body.single-estate_property :is(
  .mcd-property-title,.notice_area h1,.notice_area h2,.notice_area .prop_title_zone,
  .property_page_header h1,.property_page_header h2,
  .property-page-header h1,.property-page-header h2,
  .listing_title_wrapper h1,.listing_title_wrapper h2,
  .property_categs, .property_categs a,
  .property-page-overview,.property-page-overview *,
  .property_page_overview,.property_page_overview *,
  .property_overview,.property_overview *,
  .property_overview_wrapper,.property_overview_wrapper *,
  .property_overview_wrapper .listing_detail,
  .notice_area .property_title, .notice_area .prop_title_zone,
  .notice_area .listing_detail,.property_title_area .listing_detail) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
  opacity: 1 !important;
}
html.micasa-dark body.single-estate_property :is(
  .notice_area .price_area,.property_title_area .price_area,
  .property-page-header .price_area,.property_page_header .price_area,
  .listing_title_wrapper .price_area,
  .property_price,.property-price,.property_price_value) {
  color: var(--mcd-accent) !important;
  -webkit-text-fill-color: var(--mcd-accent) !important;
}
/* Cajas de características personalizadas: el icono dorado conserva su color;
   sólo los números y descripciones reciben color claro. */
html.micasa-dark body.single-estate_property :is(
  .property_detail,.property_details_item,.listing_detail,
  .property-page-overview-item,.property_page_overview_item,
  .property-overview-item,.property_header_details) :is(
  span,strong,b,small,label,p,div):not(.ribbon-inside):not(.property_status) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}

/* Condiciones de publicación, prestaciones y bloques laterales personalizados. */
html.micasa-dark body.single-estate_property :is(
  .property_features_wrapper h2,.property_features_wrapper h3,
  .property_features_wrapper p,.property_features_wrapper li,
  .property_features_wrapper label,.property_features_wrapper .feature_name,
  .property_features,.property_features .listing_detail,
  .property-panel,.property-panel .panel-heading,
  .widget-container h2,.widget-container h3,
  .widget h2,.widget h3,
  .contact_form_wrapper h2,.contact_form_wrapper h3,
  .property_sidebar h2,.property_sidebar h3,
  .property-page-sidebar h2,.property-page-sidebar h3,
  .listing_detail .feature_label,
  .property_page_accordion .panel-title,
  .property-page-accordion .panel-title,
  .mortgage_calculator h3,.mortgage_calculator h4) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}
/* Los rótulos de estado de la propiedad (Disponible, Vendido, Venta) y los
   botones dorados mantienen los colores originales del tema. */

/* Comprobación automática del contraste sobre texto suelto en div/span. */
html.micasa-dark .mcd-contrast-light {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}
html.micasa-dark .mcd-contrast-dark {
  color: var(--mcd-light-ink) !important;
  -webkit-text-fill-color: var(--mcd-light-ink) !important;
}

/* El usuario siempre puede leer los placeholders del buscador y del formulario. */
html.micasa-dark :is(input[type="search"],input[type="text"],input[type="email"],
  input[type="tel"],input[type="number"],textarea,select) {
  caret-color: var(--mcd-text);
}
html.micasa-dark :is(input[type="search"],input[type="text"],input[type="email"],
  input[type="tel"],input[type="number"],textarea)::placeholder {
  opacity: 1 !important;
  color: var(--mcd-muted) !important;
  -webkit-text-fill-color: var(--mcd-muted) !important;
}

/* No tocar los píxeles de medios ni la interfaz dibujada por Leaflet/Google. */
html.micasa-dark :is(img,picture,video,canvas,.leaflet-container,.leaflet-pane,
  .gm-style,.floor-plans-wrapper img,.property-page-gallery img) {
  filter: none !important;
}

/* Botón independiente, más discreto y sin ocultar la flecha volver arriba. */
.mcd-widget.mcd-floating { z-index: 9960; }
.mcd-widget.mcd-bottom-right {right: max(18px, env(safe-area-inset-right,0px) + 12px);}
@media (max-width:767px) {
  .mcd-widget.mcd-bottom-right { right: 13px; }
}

/* Los rótulos de Leaflet (que pueden heredar text-fill-color de su panel
   oscuro) conservan el esquema claro, incluidos enlaces de atribución. */
html.micasa-dark .leaflet-container,
html.micasa-dark .leaflet-container * {
  -webkit-text-fill-color: currentColor !important;
}

/* ========================================================================
   v1.5.0 — SOLO PORTADA (MI CASA / WPResidence + Visual Composer).
   La franja blanca exterior no es un problema de las tarjetas: corresponde
   a envoltorios/padding del listado. Oscurecemos sólo los padres del módulo
   "Propiedades", sin alterar dimensiones, imágenes o el modo claro.
   ======================================================================== */
html.micasa-dark body.home .mcd-home-properties-shell {
  background-color: var(--mcd-bg) !important;
  background-image: none !important;
  background-blend-mode: normal !important;
  border-color: var(--mcd-border) !important;
}
/* Algunos temas dibujan adornos/triángulos blancos con pseudo-elementos. */
html.micasa-dark body.home .mcd-home-properties-shell::before,
html.micasa-dark body.home .mcd-home-properties-shell::after {
  background-color: transparent !important;
  background-image: none !important;
}
/* El módulo interno mantiene las tarjetas tal como ya quedaron correctas. */
html.micasa-dark body.home .mcd-home-properties-shell .mcd-home-properties {
  background-color: var(--mcd-bg) !important;
  background-image: none !important;
}
html.micasa-dark body.home .mcd-home-title {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}

/* Separadores realmente vacíos entre el listado y el pie de página. */
html.micasa-dark body.home .mcd-home-blank-spacer,
html.micasa-dark body.home .mcd-home-blank-spacer::before,
html.micasa-dark body.home .mcd-home-blank-spacer::after {
  background-color: var(--mcd-bg) !important;
  background-image: none !important;
}


/* ========================================================================
   v1.6.0 — Ajustes selectivos solicitados sobre capturas 19/oct/2026.
   Sólo afecta modo oscuro. No modifica fotos, mapas, logos, galerías ni la
   ficha de datos que ya funciona; evita alterar cajas blancas con logos.
   ======================================================================== */
/* Titulares omitidos por selectores generales de WPResidence: Otras
   Propiedades, Calculadora de Pago, Nuestra Misión y Nuestra Visión. */
html.micasa-dark .mcd-v16-title,
html.micasa-dark .mcd-v16-title :is(span,strong,b,em),
html.micasa-dark .mcd-v16-accordion-label,
html.micasa-dark .mcd-v16-accordion-label :is(span,strong,b,em),
html.micasa-dark .mcd-v16-feature-label,
html.micasa-dark .mcd-v16-feature-label :is(span,strong,b,em),
html.micasa-dark .mcd-v16-contact-title {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
/* Encabezado plegable de calculadora: mantener el fondo del acordeón y
   sólo corregir tipografía y el icono [+], sin interferir con el clic. */
html.micasa-dark .mcd-v16-accordion-label::before,
html.micasa-dark .mcd-v16-accordion-label::after,
html.micasa-dark .mcd-v16-accordion-label :is(i,svg):not(svg) {
  color: var(--mcd-accent) !important;
  -webkit-text-fill-color: var(--mcd-accent) !important;
}
html.micasa-dark .mcd-v16-accordion-label :is(a,button) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}
/* Tarjetas propias de Misión/Visión: en modo oscuro la tipografía de su
   contenido debe leerse. No aplicar un fondo oscuro a los recursos gráficos. */
html.micasa-dark .mcd-v16-about-panel {
  background-color: var(--mcd-surface) !important;
  border-color: var(--mcd-border) !important;
  color: var(--mcd-text) !important;
}
html.micasa-dark .mcd-v16-about-panel :is(h1,h2,h3,h4,h5,h6,p,li,blockquote,small,em,strong):not(.elementor-button):not(.wpestate_button),
html.micasa-dark .mcd-v16-about-panel .mcd-v16-title {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}
/* Texto sin contraste en módulos de pago y características del inmueble. */
html.micasa-dark body.single-estate_property :is(
  .mortgage_calculator,.mortgage_calculator_wrapper,.mortgage-calculator,
  .property_mortgage,.property-page-accordion,.property_page_accordion)
  :is(.panel-title,.accordion-toggle,.accordion-title,h2,h3,h4,label) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}
html.micasa-dark body.single-estate_property :is(
  .property_features_wrapper,.features_wrapper,.property-features,
  .listing_wrapper,.property-panel,.property-panel-body)
  :is(.feature_name,.feature_label,.property_feature,label) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}
/* Tarjeta gris de condiciones: sin afectar la tarjeta informativa BLANCA
   de confianza y seguridad que debe permanecer en modo claro. */
html.micasa-dark .mcd-v16-conditions {
  background-color: var(--mcd-surface) !important;
  border-color: var(--mcd-border) !important;
}
html.micasa-dark .mcd-v16-conditions :is(h1,h2,h3,h4,p,li,span,strong,small) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}
/* Navegación lateral de propiedades (siguiente/anterior): si el tema pone
   letra negra sobre azul, aclarar sólo los enlaces del panel lateral. */
html.micasa-dark :is(
  .next_property,.prev_property,.next_prop,.prev_prop,
  .property_navigation,.property_navi,.property-navigation,
  .next_property_slider,.next_property_title,.prev_property_title,
  .next_item,.prev_item,.wpestate-next-property,.wpestate-prev-property)
  :is(a,span,strong,small,p,h3,h4) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
}
html.micasa-dark .mcd-v16-next-link,
html.micasa-dark .mcd-v16-next-link :is(span,b,strong,small) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
  opacity: 1 !important;
}
/* El texto 'Vendido' no es una etiqueta de tarjeta en el lateral de la
   ficha; usar acento dorado conservando el diseño de badges existentes. */
html.micasa-dark .mcd-v16-sold-title {
  color: var(--mcd-accent) !important;
  -webkit-text-fill-color: var(--mcd-accent) !important;
  opacity: 1 !important;
}
/* Contraste correcto de los textos originales en el buscador. */
html.micasa-dark :is(.search_wrapper,.advanced_search_wrapper,.adv-search-1,
  .adv-search-3,.search_wrapper_optimized,.advanced_search_shortcode)
  :is(input[type=text],input[type=search],.form-control)::placeholder {
  color: var(--mcd-muted) !important;
  -webkit-text-fill-color: var(--mcd-muted) !important;
  opacity: 1 !important;
}


/* ========================================================================
   v1.7.0 — Automatización día/noche, transición suave y correcciones finas
   solicitadas el 19/oct/2026. Sólo modo oscuro.
   ======================================================================== */

/* Transición suave sólo en fondos/bordes estructurales: nunca colores
   de números, blog ni imágenes. El contraste debe ser inmediato y estable. */
html.mcd-transitions-ready :is(body,#all_wrapper,.website-wrapper,
  #content_container,#content_wrapper,.content_wrapper,.master_content,
  .main_wrapper,.page-wrapper,.single-content-wrapper,.property_page_container,
  .property-page-wrapper,.site-content,.content-area,#primary,
  .mcd-auto-section,.mcd-auto-surface,.property_listing,.property_listing_content,
  .property-page-overview,.property_details_wrapper,.property_detail_wrapper,
  .property_page_tab,.property-page-description,.property-page-description-wrapper,
  .wpestate_property_description,.widget,.widget-container,.panel,.panel-body,
  .search_wrapper,.search_wrapper_optimized,.advanced_search_wrapper,
  .adv-search-1,.adv-search-3,.advanced_search_shortcode) {
  transition: background-color .38s ease, border-color .38s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  html.mcd-transitions-ready :is(body,#all_wrapper,.mcd-auto-section,
    .mcd-auto-surface,.property_listing,.property-page-overview) {
    transition: none !important;
  }
}

/* El botón manual queda oculto temporalmente. */
.mcd-widget, [data-mcd-toggle] { display: none !important; }

/* HERO / BUSCADOR: eliminar el recuadro negro interno y suavizar el campo. */
html.micasa-dark :is(.search_wrapper,.advanced_search_wrapper,.adv-search-1,
  .adv-search-3,.search_wrapper_optimized,.advanced_search_shortcode,
  .search_wr_elementor,.adv-search-wrapper) :is(input[type=text],input[type=search],
  .form-control,.search-input,.bootstrap-select > .dropdown-toggle,
  .select2-selection--single,.select2-selection--multiple) {
  background-color: rgba(255,255,255,.08) !important;
  background-image: none !important;
  border: 1px solid rgba(197,164,109,.18) !important;
  box-shadow: none !important;
}
html.micasa-dark :is(.search_wrapper,.advanced_search_wrapper,.adv-search-1,
  .adv-search-3,.search_wrapper_optimized,.advanced_search_shortcode,
  .search_wr_elementor,.adv-search-wrapper) :is(.form-group,.adv-search-field,
  .search_element,li,ul,fieldset,form) {
  background-image: none !important;
  box-shadow: none !important;
}

/* Descripción y cajas de contenido: unificar fondo y quitar el contorno negro interno. */
html.micasa-dark body.single-estate_property :is(
  .property-page-description-wrapper,.property_page_description,
  .property-page-description,.property_details_wrapper,.property_detail_wrapper,
  .wpestate_property_description,.property_descriptiom_text,.white_back) {
  box-shadow: none !important;
}
html.micasa-dark body.single-estate_property :is(
  .property-page-description-wrapper,.property_page_description,
  .property-page-description,.property_details_wrapper,.property_detail_wrapper,
  .wpestate_property_description,.property_descriptiom_text,.white_back)
  > :is(.wpestate_property_description,.property_descriptiom_text,.property_description,
      .property-page-description,.panel-body,.elementor-widget-container,.wpb_wrapper) {
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
}


/* ========================================================================
   v1.8.0 | Reparaciones puntuales, no rediseño de las demás secciones.
   ======================================================================== */

/* 1. Valores del resumen de propiedad: las cifras no deben alternar de blanco
   a negro cuando el escáner recalcula el contraste o termina la transición. */
html.micasa-dark body.single-estate_property .mcd-v18-stat,
html.micasa-dark body.single-estate_property .mcd-v18-stat :is(div,span,p,strong,b,small,label,a),
html.micasa-dark .mcd-v18-stat,
html.micasa-dark .mcd-v18-stat :is(div,span,p,strong,b,small,label,a) {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
  transition: none !important;
  opacity: 1 !important;
}

/* 2. Campo central del buscador de portada: sin rectángulo interior opaco.
   Se mantiene el fondo del formulario, el texto y el botón Buscar intactos. */
html.micasa-dark .mcd-v18-search-field,
html.micasa-dark .mcd-v18-search-inner {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  outline-color: transparent;
}
html.micasa-dark .mcd-v18-search-field {
  color: var(--mcd-text) !important;
  -webkit-text-fill-color: var(--mcd-text) !important;
  border-color: transparent !important;
}
html.micasa-dark .mcd-v18-search-field::placeholder {
  color: var(--mcd-muted) !important;
  -webkit-text-fill-color: var(--mcd-muted) !important;
  opacity: 1 !important;
}
html.micasa-dark .mcd-v18-search-field:focus-visible {
  outline: 2px solid var(--mcd-accent) !important;
  outline-offset: 3px;
}

/* 3. Plantilla WPResidence blog_unit3: fotografía con texto superpuesto.
   Su fecha/título/enlace siempre deben ser blancos sobre la foto, sin parpadeo.
   No afecta blog_unit normal ni imágenes/filtros. */
html.micasa-dark :is(.blog3v .blog_unit_content_v3,
  .blog3v .blog_unit_content_v3 :is(h1,h2,h3,h4,h5,h6,p,a,span,time,small,em,strong,b,div),
  .blog_unit_content_v3,
  .blog_unit_content_v3 :is(h1,h2,h3,h4,h5,h6,p,a,span,time,small,em,strong,b,div)) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  transition: none !important;
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
}

/* 4. Plano: sólo se elimina la barra vacía identificada antes de la imagen,
   no el enlace que envuelve el plano, ni otros campos de la propiedad. */
html.micasa-dark .mcd-v18-empty-plan-bar { display: none !important; }


/* ========================================================================
   v1.8.1 — Corrección EXCLUSIVA del diseño diurno.
   En la v1.8.0 la protección contra el desbordamiento sólo se aplicaba con
   html.micasa-dark; por el día regresaba la barra horizontal y el espacio
   sobrante a la derecha. No se cambian colores, fondos ni elementos internos.
   ======================================================================== */
html:not(.micasa-dark),
html:not(.micasa-dark) body {
  overflow-x: clip;
}
html:not(.micasa-dark) :is(
  #all_wrapper,.website-wrapper,#content_container,#content_wrapper,
  .content_wrapper,.master_content,.main_wrapper,.site-content,
  .page-wrapper,.property_page_container,.property-page-wrapper
) {
  box-sizing: border-box;
  max-width: 100%;
}
/* Solo afecta al envoltorio que realmente se desborda, detectado por JS. */
html:not(.micasa-dark) .mcd-day-layout-bound {
  width: 100% !important;
  max-width: 100vw !important;
  margin-inline: 0 !important;
  box-sizing: border-box !important;
}
