/*
 * D'Raso - NDK Advanced Custom Fields
 * iOS Safari workaround for the NDK recommendations Fancybox modal.
 *
 * Apply this file AFTER the NDK stylesheets (preferably from the child theme
 * custom CSS). It does not change desktop or Android styling.
 *
 * IMPORTANT: Test on an iPhone before deploying to all stores.
 */

/* iOS / WebKit touch browsers only */
@supports (-webkit-touch-callout: none) {

  /* Keep the dimming layer below the actual Fancybox window. */
  body.ndkcfLoaded .fancybox-overlay {
    z-index: 999990 !important;
  }

  /* Keep the modal and its content above the dimming layer. */
  body.ndkcfLoaded .fancybox-wrap,
  body.ndkcfLoaded .fancybox-opened {
    z-index: 1000001 !important;
  }

  body.ndkcfLoaded .fancybox-wrap .fancybox-skin,
  body.ndkcfLoaded .fancybox-wrap .fancybox-outer,
  body.ndkcfLoaded .fancybox-wrap .fancybox-inner {
    position: relative;
    z-index: 1000002 !important;
  }
}

/* Improve the recommendation buttons on narrow screens without changing
   their click handlers or the add-to-cart flow. */
@media screen and (max-width: 768px) {
  #confirm_recommends .recommend_container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  #confirm_recommends .confirm_recommends {
    float: none !important;
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 10px 0 !important;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  #confirm_recommends .clearfix {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
}
