/**
 * APD 508 — last-owner mobile corrections.
 */
/* APD535 retires this historical search-only block. The listing block below
   remains active and unchanged. */
@media (max-width: 0px) {
  /* Expanded Alojamientos destination editor: no collapsed summary row above it. */
  html body.apd186-search-modal-open #apd5-search[data-apd-location-mode="expanded"] > [data-search-field],
  html body.apd186-search-modal-open #apd5-search[data-apd-location-mode="expanded"] > .apd5-search-separator,
  html body.apd186-search-modal-open #apd5-search[data-apd-location-mode="expanded"] > .apd5-search-submit {
    display: none !important;
    visibility: hidden !important;
  }

  /* The canonical rendered destination list already includes its own heading +
     nearby row. Hide the older direct pair while expanded so it appears once. */
  html body.apd186-search-modal-open #apd5-search[data-apd-location-mode="expanded"]
  > .apd5-location-panel > .apd26-destination-section-title,
  html body.apd186-search-modal-open #apd5-search[data-apd-location-mode="expanded"]
  > .apd5-location-panel > .apd5-destination-option.is-nearby {
    display: none !important;
  }

  /* Servicios reference geometry: title + input + divider/chevron only. */
  html body.apd186-search-modal-open #apd5-search.apd380-context-services[data-active-panel="location"][data-apd-location-mode="compact"]
  > .apd5-location-panel {
    box-sizing: border-box !important;
    flex: 0 0 190px !important;
    flex-basis: 190px !important;
    height: 190px !important;
    min-height: 190px !important;
    max-height: 190px !important;
    overflow: hidden !important;
  }

  html body.apd186-search-modal-open #apd5-search.apd380-context-services[data-active-panel="location"][data-apd-location-mode="compact"]
  > .apd5-location-panel :is(#apd26-recent-destinations,.apd26-destination-section-title,.apd5-destination-option.is-nearby,#apd5-destination-list,.apd226-smart-results) {
    display: none !important;
  }

  /* APD508 owns the right-hand empty values in Servicios. This deliberately
     bypasses legacy hidden strong/pseudo owners that were painting blank text. */
  html body.apd186-search-modal-open #apd5-search.apd380-context-services[data-active-panel="location"]
  > [data-search-field="dates"] > button:first-child::after,
  html body.apd186-search-modal-open #apd5-search.apd380-context-services[data-active-panel="location"]
  > [data-search-field="service"] > button:first-child::after {
    content: attr(data-apd508-summary) !important;
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 72% !important;
    margin-left: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #222 !important;
    font-size: 16px !important;
    line-height: 1.15 !important;
    font-weight: 650 !important;
    text-align: right !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

@media (max-width: 991px) {
  /* One real gallery owner. The APD416 cloned hero can retain a lazy-load
     placeholder forever because it is created after the site's image observer.
     Keep the server-rendered gallery and its original image nodes instead. */
  html body.single-listing .apd416-mobile-hero {
    display: none !important;
  }
  html body.single-listing.apd416-mobile-hero-ready .apd52-gallery,
  html body.single-listing .apd52-gallery[data-apd-gallery] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  html body.single-listing .apd52-gallery[data-apd-gallery] .apd52-gallery-item,
  html body.single-listing .apd52-gallery[data-apd-gallery] .apd52-gallery-item img {
    visibility: visible !important;
    opacity: 1 !important;
  }
}
