/* ARABIDS 1.2.144 — fixes the actual app-preview scroll structure.
   Scope: homepage / app preview ONLY, Arabic and English.
   Desktop uses a measured, scroll-tracking translate rather than CSS sticky;
   it cannot slip behind the header due to a clipping ancestor.
   Mobile docks the EXISTING h2 into the sticky slide so its gap persists. */
@media (min-width: 992px) {
  html body:is(.home,[data-page="home"]) section.how_it_works_section {
    position:relative !important;
    box-sizing:border-box !important;
    height:350dvh !important;
    min-height:2100px !important;
    max-height:none !important;
    padding:0 !important;
    margin:0 !important;
    overflow:visible !important;
    isolation:isolate !important;
    --arabids-preview-stage:clamp(190px,calc(100dvh - var(--arabids-preview-header,105px) - 158px),610px);
  }
  html body:is(.home,[data-page="home"]) section.how_it_works_section > .container-flex {
    /* Unlike sticky, this is independent of an ancestor's scroll container. */
    position:absolute !important;
    top:0 !important;
    bottom:auto !important;
    left:50% !important;
    right:auto !important;
    z-index:7 !important;
    width:min(1140px,calc(100% - 48px)) !important;
    max-width:1140px !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:flex-start !important;
    margin:0 !important;
    padding:0 !important;
    overflow:visible !important;
    transition:none !important;
    transform:translate3d(-50%,var(--arabids-desktop-preview-shift,0px),0) !important;
    will-change:transform;
  }
  html body:is(.home,[data-page="home"]) section.how_it_works_section > .container-flex > h2.title {
    display:block !important;
    position:static !important;
    flex:0 0 auto !important;
    width:100% !important;
    max-width:100% !important;
    height:auto !important;
    min-height:0 !important;
    margin:0 auto clamp(17px,2.5vh,24px) !important;
    padding:0 !important;
    text-align:center !important;
    line-height:1.3 !important;
    transform:none !important;
  }
  html body:is(.home,[data-page="home"]) section.how_it_works_section > .container-flex > .flex.desktop {
    display:flex !important;
    position:relative !important;
    align-items:center !important;
    justify-content:center !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    width:min(1040px,100%) !important;
    height:var(--arabids-preview-stage) !important;
    min-height:0 !important;
    max-height:var(--arabids-preview-stage) !important;
    margin:0 auto !important;
    padding:0 !important;
    gap:clamp(20px,3.5vw,55px) !important;
    overflow:visible !important;
    transform:none !important;
  }
  html body:is(.home,[data-page="home"]) section.how_it_works_section .flex.desktop > .how-it-works-swiper {
    height:100% !important;
    max-height:100% !important;
    min-height:0 !important;
    flex:1 1 0 !important;
  }
  html body:is(.home,[data-page="home"]) section.how_it_works_section .flex.desktop > .how-it-works-swiper-2 {
    display:block !important;
    position:relative !important;
    flex:0 0 auto !important;
    align-self:center !important;
    box-sizing:border-box !important;
    width:calc(var(--arabids-preview-stage) * 295 / 604) !important;
    max-width:min(300px,30vw) !important;
    min-width:0 !important;
    height:var(--arabids-preview-stage) !important;
    min-height:0 !important;
    max-height:var(--arabids-preview-stage) !important;
    aspect-ratio:295 / 604 !important;
    margin:0 !important;
    padding:0 !important;
    opacity:1 !important;
    visibility:visible !important;
    transform:none !important;
    transition:none !important;
    overflow:hidden !important;
  }
  html body:is(.home,[data-page="home"]) section.how_it_works_section .flex.desktop > .how-it-works-swiper-2 :is(.swiper-wrapper,.swiper-slide,.how-it-works-mockup) {
    box-sizing:border-box !important;
    height:100% !important;
    max-height:100% !important;
    min-height:0 !important;
  }
  html body:is(.home,[data-page="home"]) section.how_it_works_section .flex.desktop > .how-it-works-swiper-2 .how-it-works-mockup > img.bg {
    width:100% !important;
    height:100% !important;
    object-fit:contain !important;
  }
}
/* Mobile only, portrait (phone / portrait tablet): same four screens.
   Title is moved (not copied) inside the same sticky stage in JS, keeping a
   real 24–30px gap while scrolling and reserving space for the full phone. */
@media (max-width:991px) and (orientation:portrait) {
  html body:is(.home,[data-page="home"]) section.how_it_works_section.arabids-preview-title-docked > .container-flex {
    display:none !important;
    height:0 !important;
    margin:0 !important;
    padding:0 !important;
  }
  html body:is(.home,[data-page="home"]) section.how_it_works_section.arabids-preview-title-docked > .mobile {
    position:sticky !important;
    top:var(--arabids-mobile-header-bottom,80px) !important;
    box-sizing:border-box !important;
    display:flex !important;
    flex-flow:column nowrap !important;
    align-items:center !important;
    justify-content:flex-start !important;
    width:100% !important;
    max-width:560px !important;
    height:calc(100svh - var(--arabids-mobile-header-bottom,80px)) !important;
    min-height:0 !important;
    margin:0 auto !important;
    padding:clamp(10px,1.8svh,16px) 14px 12px !important;
    gap:0 !important;
    overflow:visible !important;
  }
  html body:is(.home,[data-page="home"]) section.how_it_works_section.arabids-preview-title-docked > .mobile > h2.title {
    position:relative !important;
    display:block !important;
    order:0 !important;
    flex:0 0 auto !important;
    width:100% !important;
    max-width:100% !important;
    height:auto !important;
    min-height:0 !important;
    margin:0 auto clamp(24px,3.8svh,32px) !important;
    padding:0 !important;
    text-align:center !important;
    font-size:clamp(25px,6.8vw,35px) !important;
    font-weight:800 !important;
    line-height:1.32 !important;
    color:#E5BF88 !important;
    -webkit-text-fill-color:#E5BF88 !important;
    white-space:normal !important;
    text-wrap:balance !important;
    transform:none !important;
    z-index:4 !important;
  }
  html body:is(.home,[data-page="home"]) section.how_it_works_section.arabids-preview-title-docked > .mobile > .how-it-works-swiper-2-mobile {
    position:relative !important;
    display:block !important;
    order:1 !important;
    flex:0 0 auto !important;
    align-self:center !important;
    box-sizing:border-box !important;
    width:min(72vw,282px,calc((100svh - var(--arabids-mobile-header-bottom,80px) - 175px) * 295 / 604)) !important;
    min-width:0 !important;
    max-width:calc(100vw - 28px) !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    aspect-ratio:295 / 604 !important;
    margin:0 auto !important;
    padding:0 !important;
    overflow:hidden !important;
    transform:none !important;
  }
  html body:is(.home,[data-page="home"]) section.how_it_works_section.arabids-preview-title-docked > .mobile > .how-it-works-swiper-mobile {
    position:relative !important;
    order:2 !important;
    flex:0 0 auto !important;
    align-self:center !important;
    width:100% !important;
    max-width:520px !important;
    height:auto !important;
    min-height:0 !important;
    margin:clamp(11px,1.7svh,16px) auto 0 !important;
    padding:0 !important;
    overflow:visible !important;
  }
}
/* Super-short portrait screens: maintain the heading-to-phone gap while the
   device scales down instead of spilling under the visible browser viewport. */
@media (max-width:991px) and (orientation:portrait) and (max-height:560px) {
  html body:is(.home,[data-page="home"]) section.how_it_works_section.arabids-preview-title-docked > .mobile > h2.title {
    font-size:clamp(22px,6vw,28px) !important;
    margin-bottom:18px !important;
  }
  html body:is(.home,[data-page="home"]) section.how_it_works_section.arabids-preview-title-docked > .mobile > .how-it-works-swiper-2-mobile {
    width:min(58vw,calc((100svh - var(--arabids-mobile-header-bottom,80px) - 142px) * 295 / 604)) !important;
  }
}
