/* Round 24 — robust fixed background system
   Uses a real fixed background layer instead of negative-z pseudo elements,
   which is more reliable in local/mobile preview environments.
   Primary source path for these pages is assets/backgrounds/...
*/
html, body{ min-height:100%; }

body[data-page="home"],
body[data-page="garden"],
body[data-page="appointment"],
body[data-page="auctions"],
body[data-page="auction-catalog"],
body[data-page="auction-item"],
body[data-page="admin"],
body.admin-page{
  background: transparent !important;
  background-image: none !important;
  position: relative;
  isolation: isolate;
}

/* Primary render path */
body[data-page="home"]{ --ow-page-fixed-bg-image:url("../assets/backgrounds/index-upload-bg.png"); }
body[data-page="garden"]{ --ow-page-fixed-bg-image:url("../assets/backgrounds/agriculture-upload-bg.png"); }
body[data-page="appointment"],
body[data-page="auctions"],
body[data-page="auction-catalog"],
body[data-page="auction-item"]{ --ow-page-fixed-bg-image:url("../assets/backgrounds/service-upload-bg.png"); }

body[data-page="home"]::before,
body[data-page="home"]::after,
body[data-page="garden"]::before,
body[data-page="garden"]::after,
body[data-page="appointment"]::before,
body[data-page="appointment"]::after,
body[data-page="auctions"]::before,
body[data-page="auctions"]::after,
body[data-page="auction-catalog"]::before,
body[data-page="auction-catalog"]::after,
body[data-page="auction-item"]::before,
body[data-page="auction-item"]::after,
body[data-page="admin"]::before,
body[data-page="admin"]::after,
body.admin-page::before,
body.admin-page::after{
  content:none !important;
  display:none !important;
}

.ow-page-fixed-bg{
  position:fixed !important;
  inset:0 !important;
  z-index:0 !important;
  pointer-events:none !important;
  overflow:hidden !important;
  opacity:1 !important;
  transform:translateZ(0) !important;
  backface-visibility:hidden !important;
}
.ow-page-fixed-bg--embed{
  background:none !important;
}
.ow-page-fixed-bg--image{
  background-image:var(--ow-page-fixed-bg-image) !important;
  background-position:center center !important;
  background-repeat:no-repeat !important;
  background-size:cover !important;
}
.ow-page-fixed-bg--embed iframe{
  display:block !important;
  width:100% !important;
  height:100% !important;
  border:0 !important;
}

body[data-page="home"] > :not(.ow-page-fixed-bg),
body[data-page="garden"] > :not(.ow-page-fixed-bg),
body[data-page="appointment"] > :not(.ow-page-fixed-bg),
body[data-page="auctions"] > :not(.ow-page-fixed-bg),
body[data-page="auction-catalog"] > :not(.ow-page-fixed-bg),
body[data-page="auction-item"] > :not(.ow-page-fixed-bg),
body[data-page="admin"] > :not(.ow-page-fixed-bg),
body.admin-page > :not(.ow-page-fixed-bg){
  position:relative;
  z-index:1;
}

body[data-page="home"] :is(header.hero, main, .page, section, .container, footer.simple),
body[data-page="garden"] :is(main, .page, section, .container, footer.simple),
body[data-page="appointment"] :is(main, .page, section, .container, footer.simple),
body[data-page="auctions"] :is(main, .page, section, .container, footer.simple),
body[data-page="auction-catalog"] :is(main, .page, section, .container, footer.simple),
body[data-page="auction-item"] :is(main, .page, section, .container, footer.simple),
body[data-page="admin"] :is(main, .page, section, .container, footer.simple, .admin-shell),
body.admin-page :is(main, .page, section, .container, footer.simple, .admin-shell){
  background:transparent !important;
}

/* Remove old background embeds / black helper layers on the rewritten pages */
body[data-page="home"] .bg-embed,
body[data-page="garden"] .bg-embed,
body[data-page="appointment"] .bg-embed,
body[data-page="auctions"] .bg-embed,
body[data-page="auction-catalog"] .bg-embed,
body[data-page="auction-item"] .bg-embed,
body[data-page="admin"] .bg-embed,
body.admin-page .bg-embed,
body[data-page="admin"] .admin-bg,
body.admin-page .admin-bg{
  display:none !important;
}

/* Pull the first content block upward to reduce the empty spacer band */
body[data-page="garden"] main.page,
body[data-page="appointment"] main.page.has-ticker,
body[data-page="auctions"] main.page.has-ticker,
body[data-page="auction-catalog"] main.page.has-ticker,
body[data-page="auction-item"] main.page,
body[data-page="admin"] main.admin-shell,
body.admin-page main.admin-shell{
  padding-top:max(calc(var(--header-h, 0px) - 160px), 8px) !important;
}
body[data-page="garden"] main.page > section.container:first-child,
body[data-page="appointment"] main.page > section.container:first-child,
body[data-page="auctions"] main.page > section.container:first-child,
body[data-page="auction-catalog"] main.page > section.container:first-child,
body[data-page="auction-item"] main.page > section.container:first-child,
body[data-page="admin"] main.admin-shell > section:first-child,
body.admin-page main.admin-shell > section:first-child{
  margin-top:0 !important;
  padding-top:0 !important;
}

body[data-page="home"] .home-hero{ position:relative; z-index:1; }
