/* GAINVO Storefront v0.10.77 — Desktop checkout dialog correction
 * Desktop/laptop checkout is a true centred dialog with one internal scroll owner.
 * Mobile checkout remains the established bottom sheet.
 */

@media (min-width: 760px){
  #checkoutSheet.checkout-sheet{
    position:fixed!important;
    z-index:62!important;
    left:50%!important;
    top:50%!important;
    right:auto!important;
    bottom:auto!important;
    width:min(920px,calc(100vw - 72px))!important;
    height:min(82dvh,760px)!important;
    max-height:min(82dvh,760px)!important;
    min-height:min(600px,calc(100dvh - 72px))!important;
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    overflow:hidden!important;
    padding:0!important;
    border-radius:24px!important;
    box-shadow:0 28px 90px rgba(0,0,0,.32)!important;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translate(-50%,calc(-50% + 24px)) scale(.985)!important;
    transition:opacity .18s ease,transform .22s ease,visibility 0s linear .22s!important;
  }
  #checkoutSheet.checkout-sheet.open{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:translate(-50%,-50%) scale(1)!important;
    transition:opacity .18s ease,transform .22s ease,visibility 0s linear 0s!important;
  }
  #checkoutSheet>.sheet-handle{display:none!important}
  #checkoutSheet>.sheet-head{
    grid-row:1!important;
    position:relative!important;
    top:auto!important;
    z-index:5!important;
    min-height:86px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    padding:18px 22px!important;
    margin:0!important;
    border-bottom:1px solid #dfe7ee!important;
    background:rgba(255,255,255,.985)!important;
    backdrop-filter:blur(16px);
  }
  #checkoutSheet>.sheet-head>div{min-width:0}
  #checkoutSheet>.sheet-head .micro{
    display:block!important;
    margin:0 0 4px!important;
    font-size:11px!important;
    line-height:1.2!important;
    letter-spacing:.13em!important;
    font-weight:850!important;
  }
  #checkoutSheet>.sheet-head h2{
    margin:0!important;
    font-size:clamp(22px,1.8vw,28px)!important;
    line-height:1.12!important;
    letter-spacing:-.035em!important;
  }
  #checkoutSheet>.sheet-head .close-button{
    flex:0 0 auto!important;
    width:46px!important;
    height:46px!important;
    border-radius:14px!important;
  }
  #checkoutBody{
    grid-row:2!important;
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior-y:contain!important;
    -webkit-overflow-scrolling:touch;
    scrollbar-gutter:stable;
    padding:20px 24px 30px!important;
    scroll-padding:20px 0 32px!important;
    background:#f7f9fb!important;
  }
  #checkoutBody::-webkit-scrollbar{width:9px}
  #checkoutBody::-webkit-scrollbar-track{background:transparent}
  #checkoutBody::-webkit-scrollbar-thumb{background:#bac7d2;border:2px solid transparent;border-radius:999px;background-clip:padding-box}
  #checkoutBody>*{
    width:min(100%,820px)!important;
    max-width:820px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  #checkoutBody .checkout-progress{margin-top:0!important}
  #checkoutBody .checkout-live-summary{padding:16px 18px!important;border-radius:18px!important}
  #checkoutBody .checkout-preview-card,
  #checkoutBody .checkout-payment-card,
  #checkoutBody .checkout-breakdown{
    border-radius:18px!important;
  }
  #checkoutBody .checkout-fields{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:14px!important;
  }
  #checkoutBody .checkout-fields>label{min-width:0!important}
  #checkoutBody .checkout-fields .checkout-note{grid-column:1/-1!important}
  #checkoutBody .checkout-fields input,
  #checkoutBody .checkout-fields textarea{width:100%!important;box-sizing:border-box!important}
  #checkoutBody .checkout-fields textarea{min-height:92px!important}
  #checkoutBody #placeOrderBtn{
    min-height:52px!important;
    margin-top:14px!important;
    border-radius:14px!important;
    font-size:15px!important;
  }
  #checkoutBody .checkout-final-note{margin-bottom:0!important}

  html[data-theme="dark"] #checkoutSheet.checkout-sheet{
    background:#0c1720!important;
    border:1px solid #2b3d49!important;
  }
  html[data-theme="dark"] #checkoutSheet>.sheet-head{
    background:rgba(15,27,36,.985)!important;
    border-color:#2a3c48!important;
  }
  html[data-theme="dark"] #checkoutBody{background:#09131b!important}
  html[data-theme="dark"] #checkoutBody::-webkit-scrollbar-thumb{background:#405561;border:2px solid transparent;background-clip:padding-box}
}

@media (min-width:760px) and (max-height:760px){
  #checkoutSheet.checkout-sheet{
    height:calc(100dvh - 48px)!important;
    min-height:0!important;
    max-height:calc(100dvh - 48px)!important;
  }
  #checkoutSheet>.sheet-head{min-height:72px!important;padding:14px 20px!important}
  #checkoutBody{padding-top:16px!important;padding-bottom:22px!important}
}

@media (min-width:760px) and (max-width:980px){
  #checkoutSheet.checkout-sheet{width:min(860px,calc(100vw - 40px))!important}
  #checkoutBody{padding-left:20px!important;padding-right:20px!important}
}

@media (max-width:759px){
  /* Preserve native mobile bottom-sheet behaviour. */
  #checkoutSheet.checkout-sheet{opacity:1;visibility:visible;pointer-events:auto}
}

@media (prefers-reduced-motion:reduce){
  #checkoutSheet.checkout-sheet{transition:none!important}
}
