/*
 * iDrugstore PWA Home v19.0
 * Final contrast, search geometry and full-depth footer correction.
 */
@media (max-width:1024px) {
  /* Keep the document surface dark behind the last footer pixels. */
  html:has(body.id-pwa-native.id-pwa-page-index),
  body.id-pwa-native.id-pwa-page-index {
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    background:#0b1220!important;
  }

  body.id-pwa-native.id-pwa-page-index #main-content {
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    background:#f4f6f8!important;
  }

  /*
   * Legacy rules still assign white to typography with higher specificity.
   * Declare the foreground for every light home surface deterministically.
   */
  body.id-pwa-native.id-pwa-page-index :where(
    .id-trust-bar,
    .id-pharma-cats,
    .section-how-it-works,
    .section-feature-resto,
    .section-cuisine,
    .id-testimonials,
    #mobile-app-sections,
    .id-plans,
    .id-faq
  ) :where(h1,h2,h3,h4,h5,h6,p,li,dt,dd,label,small,strong) {
    color:#17212b!important;
    -webkit-text-fill-color:#17212b!important;
  }

  body.id-pwa-native.id-pwa-page-index :where(
    .id-trust-bar,
    .id-pharma-cats,
    .section-how-it-works,
    .section-feature-resto,
    .section-cuisine,
    .id-testimonials,
    #mobile-app-sections,
    .id-plans,
    .id-faq
  ) :where(p,small,dd) {
    color:#536170!important;
    -webkit-text-fill-color:#536170!important;
  }

  /* Restore white only where the background is explicitly dark. */
  body.id-pwa-native.id-pwa-page-index :where(
    .parallax-home,
    .id-stats-section,
    .section-subcribe,
    .section-footer
  ) :where(h1,h2,h3,h4,h5,h6,p,li,dt,dd,label,small,strong,span,a) {
    color:#fff!important;
    -webkit-text-fill-color:#fff!important;
  }

  /*
   * Search is a two-column control, independent of Bootstrap's float/column
   * rules. The button is locked to the visual center of the 48px end cell.
   */
  body.id-pwa-native.id-pwa-page-index .advance-search > .forms-search {
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
  }

  body.id-pwa-native.id-pwa-page-index .advance-search .search-input-wraps {
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:58px!important;
    margin:0!important;
    padding:5px!important;
    overflow:hidden!important;
    border:1px solid #dce2e8!important;
    border-radius:15px!important;
    background:#fff!important;
    box-shadow:0 12px 30px rgba(15,23,42,.16)!important;
  }

  body.id-pwa-native.id-pwa-page-index .advance-search .search-input-wraps > .row {
    display:grid!important;
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    grid-template-columns:minmax(0,1fr) 48px!important;
    align-items:stretch!important;
    gap:0!important;
  }

  body.id-pwa-native.id-pwa-page-index .advance-search .search-input-wraps > .row > div {
    position:static!important;
    display:flex!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:100%!important;
    margin:0!important;
    padding:0!important;
    float:none!important;
    align-items:center!important;
  }

  body.id-pwa-native.id-pwa-page-index .advance-search .search-input-wraps input {
    display:block!important;
    width:100%!important;
    min-width:0!important;
    height:100%!important;
    margin:0!important;
    padding:0 11px!important;
    border:0!important;
    background:#fff!important;
    color:#17212b!important;
    -webkit-text-fill-color:#17212b!important;
    line-height:normal!important;
  }

  body.id-pwa-native.id-pwa-page-index .advance-search .search-input-wraps button {
    position:static!important;
    display:grid!important;
    width:48px!important;
    min-width:48px!important;
    max-width:48px!important;
    height:48px!important;
    min-height:48px!important;
    margin:0!important;
    padding:0!important;
    place-items:center!important;
    align-self:center!important;
    border:0!important;
    border-radius:11px!important;
    background:#d41421!important;
    color:#fff!important;
    -webkit-text-fill-color:#fff!important;
    line-height:1!important;
    transform:none!important;
  }

  body.id-pwa-native.id-pwa-page-index .advance-search .search-input-wraps button > i {
    display:grid!important;
    width:24px!important;
    height:24px!important;
    margin:0!important;
    padding:0!important;
    place-items:center!important;
    color:#fff!important;
    font-size:21px!important;
    line-height:24px!important;
  }

  /* Footer reaches the physical bottom and stays behind the fixed PWA bar. */
  body.id-pwa-native.id-pwa-page-index .section-footer {
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:240px!important;
    margin:0!important;
    padding:30px 0 calc(102px + env(safe-area-inset-bottom))!important;
    border:0!important;
    background:#0b1220!important;
  }

  body.id-pwa-native.id-pwa-page-index .section-footer > .container {
    box-sizing:border-box!important;
    width:min(100%,760px)!important;
    min-width:0!important;
    max-width:760px!important;
    margin:0 auto!important;
    padding:0 clamp(16px,4.5vw,28px)!important;
  }

  body.id-pwa-native.id-pwa-page-index .section-footer .row {
    display:grid!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
    grid-template-columns:1fr!important;
    gap:18px!important;
  }

  body.id-pwa-native.id-pwa-page-index .section-footer .row > [class*="col-"] {
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
  }

  body.id-pwa-native.id-pwa-page-index .section-footer .row > [class*="col-"]:not(:first-child):has(:not(h3):not(.social-wrap)) {
    display:block;
  }

  body.id-pwa-native.id-pwa-page-index .section-footer .id-footer-bottom {
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:24px 0 0!important;
    padding:20px 0 0!important;
    align-items:flex-start!important;
    color:#cbd5e1!important;
  }
}

