:root {
  --souve-app-safe-top: env(safe-area-inset-top, 0px);
  --souve-app-safe-right: env(safe-area-inset-right, 0px);
  --souve-app-safe-bottom: env(safe-area-inset-bottom, 0px);
  --souve-app-safe-left: env(safe-area-inset-left, 0px);
}

/* =========================================================
   SOUVE PWA — GLOBAL SCROLL UNLOCK
   ========================================================= */

html.souve-app-standalone,
html.souve-app-standalone body {
  position: static !important;
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  touch-action: pan-y !important;
  overscroll-behavior-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

html.souve-app-standalone .website-wrapper,
html.souve-app-standalone .wd-page-wrapper,
html.souve-app-standalone .main-page-wrapper,
html.souve-app-standalone .wd-page-content,
html.souve-app-standalone .content-layout-wrapper,
html.souve-app-standalone .wd-content-area,
html.souve-app-standalone .site-content,
html.souve-app-standalone .entry-content,
html.souve-app-standalone .elementor,
html.souve-app-standalone .elementor-section,
html.souve-app-standalone .e-con,
html.souve-app-standalone .e-con-inner {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  touch-action: pan-y !important;
}

html.souve-app-standalone #souve-app-restored-shell,
#souve-app-restored-shell {
  display: none !important;
  pointer-events: none !important;
  touch-action: none !important;
}

html.souve-app-standalone #souve-skeleton-shell {
  pointer-events: none !important;
  touch-action: none !important;
}

/* =========================================================
   SOUVE PWA — SAFE AREA / APP POLISH
   ========================================================= */

.souve-app-safe-bottom {
  padding-bottom: max(16px, var(--souve-app-safe-bottom));
}

.souve-app-safe-top {
  padding-top: max(16px, var(--souve-app-safe-top));
}

html.souve-app-standalone [data-souve-app-install-trigger],
html.souve-app-standalone .souve-app-install-trigger,
html.souve-app-standalone a[href="#souve-install-pwa"] {
  display: none !important;
}

html:not(.souve-app-install-ready) .souve-app-install-only-ready {
  display: none !important;
}

.souve-app-dynamic-placeholder:empty {
  display: none !important;
}

.souve-app-cache-shell {
  contain: layout style;
}
