/**
 * APD 435 — hard layout owner for the first Dónde step.
 *
 * Why this file exists:
 * several historical rules still set flex growth/min-height on the location
 * panel.  The old rules can survive through plugin/theme output even after the
 * legacy APD stylesheet handle is dequeued.  This file therefore does not
 * depend on body generation classes; it keys only off the canonical form.
 */
@media (max-width: 767px) {
  /* The active Dónde panel never participates as a flex-grow blank sheet. */
  #apd5-search[data-active-panel="location"][data-apd-location-mode="compact"] > .apd5-location-panel {
    box-sizing: border-box !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
  }

  #apd5-search.apd380-context-stays[data-active-panel="location"][data-apd-location-mode="compact"] > .apd5-location-panel {
    flex-basis: 414px !important;
    height: 414px !important;
    min-height: 414px !important;
    max-height: 414px !important;
  }

  #apd5-search.apd380-context-experiences[data-active-panel="location"][data-apd-location-mode="compact"] > .apd5-location-panel {
    flex-basis: 180px !important;
    height: 180px !important;
    min-height: 180px !important;
    max-height: 180px !important;
  }

  #apd5-search.apd380-context-services[data-active-panel="location"][data-apd-location-mode="compact"] > .apd5-location-panel {
    flex-basis: 370px !important;
    height: 370px !important;
    min-height: 370px !important;
    max-height: 370px !important;
  }

  /* Fechas + Viajeros / ¿Qué? are genuine siblings under Dónde. */
  #apd5-search[data-active-panel="location"] > [data-search-field="dates"],
  #apd5-search.apd380-context-stays[data-active-panel="location"] > [data-search-field="guests"],
  #apd5-search.apd380-context-experiences[data-active-panel="location"] > [data-search-field="guests"],
  #apd5-search.apd380-context-services[data-active-panel="location"] > [data-search-field="service"] {
    box-sizing: border-box !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    flex: 0 0 64px !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    overflow: visible !important;
  }

  #apd5-search.apd380-context-stays[data-active-panel="location"] > [data-search-field="service"],
  #apd5-search.apd380-context-experiences[data-active-panel="location"] > [data-search-field="service"],
  #apd5-search.apd380-context-services[data-active-panel="location"] > [data-search-field="guests"] {
    display: none !important;
  }

  /* Empty row labels are visible on first paint, exactly like the reference. */
  #apd5-search[data-active-panel="location"] > [data-search-field="dates"] > button:first-child,
  #apd5-search[data-active-panel="location"] > [data-search-field="guests"] > button:first-child,
  #apd5-search[data-active-panel="location"] > [data-search-field="service"] > button:first-child {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 64px !important;
  }

  #apd5-search[data-active-panel="location"] > [data-search-field="guests"] #apd5-guest-summary,
  #apd5-search[data-active-panel="location"] > [data-search-field="service"] #apd5-service-summary,
  #apd5-search[data-active-panel="location"] > [data-search-field="dates"] #apd5-date-summary {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Compact content contract. */
  #apd5-search.apd380-context-experiences[data-active-panel="location"][data-apd-location-mode="compact"]
  .apd5-location-panel :is(#apd26-recent-destinations,.apd26-destination-section-title,[data-nearby],#apd5-destination-list,.apd226-smart-results) {
    display: none !important;
  }

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

  #apd5-search.apd380-context-stays[data-active-panel="location"][data-apd-location-mode="compact"]
  #apd5-destination-list {
    display: none !important;
  }
}
