/*
OptimaPOS iPad Safe Area Global v1
Loaded last on POS pages. Keeps application chrome below iPadOS status area
and above the Home indicator without changing business/layout markup.
*/
:root{
    --op-safe-top:env(safe-area-inset-top,0px);
    --op-safe-right:env(safe-area-inset-right,0px);
    --op-safe-bottom:env(safe-area-inset-bottom,0px);
    --op-safe-left:env(safe-area-inset-left,0px);
}

html{
    min-height:100%;
    background:#080a0d;
}

body{
    box-sizing:border-box;
    padding-top:var(--op-safe-top)!important;
    padding-left:var(--op-safe-left)!important;
    padding-right:var(--op-safe-right)!important;
}

/* Sticky POS headers stick below the iPadOS inset, never underneath it. */
.pos-topbar,
.floor-v08-header{
    top:var(--op-safe-top)!important;
}

/* Check workspace has explicit viewport heights in iPad CSS. Subtract safe top. */
@media (orientation:landscape) and (min-width:760px) and (max-width:1400px){
    .service-page .order-layout,
    .service-page .ticket-panel,
    .service-page .order-categories,
    .service-page .order-products,
    .service-page .service-shell{
        height:calc(100dvh - 56px - var(--op-safe-top))!important;
        max-height:calc(100dvh - 56px - var(--op-safe-top))!important;
    }
}

/* Keep bottom controls clear of the Home indicator in installed PWA mode. */
@media (display-mode:standalone){
    .floor-footer,
    .cc-shell{
        padding-bottom:max(5px,var(--op-safe-bottom))!important;
    }
}

@supports not (height:100dvh){
    @media (orientation:landscape) and (min-width:760px) and (max-width:1400px){
        .service-page .order-layout,
        .service-page .ticket-panel,
        .service-page .order-categories,
        .service-page .order-products,
        .service-page .service-shell{
            height:calc(100vh - 56px - var(--op-safe-top))!important;
            max-height:calc(100vh - 56px - var(--op-safe-top))!important;
        }
    }
}


/* iPad footer safe-area refinement v3 */
@media (min-width:700px){
  .floor-footer{
    bottom:max(8px,env(safe-area-inset-bottom,0px))!important;
    padding-bottom:max(8px,env(safe-area-inset-bottom,0px))!important;
  }
}


/* ==========================================================================
   iPad Footer Position v4
   Move the complete footer above the physical/home-indicator edge.
   ========================================================================== */
@media (min-width:700px) and (pointer:coarse){
  .floor-footer,
  .floor-v08-footer,
  .pos-footer,
  .pos-bottom-bar,
  .bottom-bar{
    transform:translateY(-12px) !important;
  }

  /* Preserve the space vacated by the translated footer where layouts use it. */
  body{
    padding-bottom:max(12px,env(safe-area-inset-bottom,0px)) !important;
  }
}
