/* === Apple / iOS specific fixes only (scoped under `.wb-ios`) === */

/* All rules are intentionally prefixed with `.wb-ios` so non-iOS browsers are unaffected.
   The class `wb-ios` is added to `<html>` by `script.js` when running on iOS. */

.wb-ios .iti {
  position: relative;
}

.wb-ios .modal .iti__country-list {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  z-index: 1056 !important; /* above modal-content */
}

.wb-ios .modal {
  overflow: visible !important;
}

@supports (-webkit-touch-callout: none) {
  .wb-ios .modal input,
  .wb-ios .modal select,
  .wb-ios .modal textarea,
  .wb-ios .modal .iti__search-input {
    font-size: 16px !important;
    line-height: 1.4;
  }
}

.wb-ios .modal .modal-dialog {
  transform: none !important;
}

/* Target only the row where the layout issue appears so we don't change sizes globally.
   This will affect images inside the `.row.justify-content-stretch` container on iOS. */
.wb-ios .row.justify-content-stretch img.fit-cover,
.wb-ios .row.justify-content-stretch .fit-cover img,
.wb-ios .row.justify-content-stretch img.img-fluid.fit-cover {
  display: block;
  width: 100%;
  height: auto !important;
  max-width: 100%;
  /* conservative cap tied to viewport height on iOS only */
  max-height: calc(var(--vh, 1vh) * 60);
  object-fit: cover !important;
  -webkit-object-fit: cover !important;
}

.wb-ios .min-h-177 {
  min-height: 177px;
  height: auto !important;
}

@media (max-width: 767px) {
  .wb-ios .row.justify-content-stretch img.fit-cover,
  .wb-ios .row.justify-content-stretch .fit-cover img,
  .wb-ios .row.justify-content-stretch img.img-fluid.fit-cover,
  .wb-ios .row.justify-content-stretch .fit-cover.h-100,
  .wb-ios .row.justify-content-stretch .img-fluid.h-100.fit-cover {
    height: auto !important;
    max-height: calc(var(--vh, 1vh) * 55) !important;
    object-fit: cover !important;
    -webkit-object-fit: cover !important;
  }
}

.wb-ios .modal-body,
.wb-ios .iti__country-list,
.wb-ios .lazy-background {
  -webkit-overflow-scrolling: touch;
}

.wb-ios html,
.wb-ios body {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
