/* Performance background: keep the scenic feel without fixed or extra decorative repaint layers. */
body.home {
  background: var(--cp-site-scenic-background) !important;
}

body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) {
  background: var(--cp-site-scenic-background) !important;
}

body.home::before,
body.home .home-market::before,
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag)::before,
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) .cp-shop-shell::before,
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) .cp-shop-shell::after {
  display: none !important;
  content: none !important;
}

/* Performance filter budget: avoid expensive live filter/text-shadow work on revised surfaces. */
body.home :is(.home-market, .home-market *, .catalog, .catalog *, .order-flow, .order-flow *),
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) :is(.cp-shop-shell, .cp-shop-shell *) {
  filter: none !important;
  text-shadow: none !important;
}

/* Performance shadow budget: replace broad soft shadows with small, Chrome-friendly depth. */
body.home :is(.home-market, .home-market *, .catalog, .catalog *, .order-flow, .order-flow *),
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) :is(.cp-shop-shell, .cp-shop-shell *) {
  box-shadow: none !important;
}

body.home :is(.order-flow),
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) :is(.cp-shop-toolbar, .cp-shop-category-panel, .cp-shop-trust-panel) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 10px 24px rgba(21, 53, 72, 0.07) !important;
}

body.home .catalog {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Scroll smoothness test 3: keep the large product-platform glass surface, but
   make its pseudo-element cheap to paint on first catalog entry. */
body.home .catalog::before {
  border-color: rgba(255, 255, 255, 0.56) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.48), rgba(232, 247, 250, 0.22)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(142, 205, 207, 0.14) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.home .category-panel {
  width: calc(100% - clamp(96px, 10vw, 180px));
  margin-right: auto;
  margin-left: auto;
  border-color: rgba(255, 255, 255, 0.58) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.16)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(142, 205, 207, 0.16),
    0 10px 24px rgba(21, 53, 72, 0.08) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.home .category-panel::before {
  display: none !important;
  content: none !important;
}

body.home .product-card,
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) .cp-shop-main .product-card {
  contain: paint;
  box-shadow: 0 10px 22px rgba(21, 53, 72, 0.075) !important;
}

body.home .product-card:hover,
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) .cp-shop-main .product-card:hover {
  box-shadow: 0 12px 24px rgba(21, 53, 72, 0.085) !important;
}

body.home :is(.product-art, .product-card-body, .flow-steps span),
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) .cp-shop-main :is(.product-art, .product-card-body) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64) !important;
}

body.home .add-button,
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) .cp-shop-main .add-button {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 16px rgba(5, 31, 40, 0.16) !important;
}

/* Performance glass budget: approximate glass with gradients/borders instead of broad live blur. */
body.home :is(.catalog, .category-panel, .order-flow, .product-card, .product-art, .product-card-body, .hero-banner-slider .hero-arrow, .hero-banner-slider .hero-slider-dots),
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) :is(.cp-shop-hero, .cp-shop-brand-signal, .cp-shop-category-panel, .cp-shop-trust-panel, .cp-shop-toolbar, .cp-shop-main .product-card, .cp-shop-main .product-art, .cp-shop-main .product-card-body) {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) .site-header {
  -webkit-backdrop-filter: blur(10px) saturate(1.08) !important;
  backdrop-filter: blur(10px) saturate(1.08) !important;
}

/* Performance hover budget: keep hover feel on cheap properties, not animated shadows. */
body.home :is(.product-card, .add-button, .category-panel button, .hero-banner-slider .hero-arrow, .hero-banner-slider .hero-slider-dots button),
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) :is(.cp-shop-main .product-card, .cp-shop-main .add-button, .cp-shop-category-panel nav a) {
  transition-property: transform, border-color, background, background-color, color, opacity !important;
}

/* Performance compositor budget: keep will-change only for truly animated hero media. */
body.home :is(.catalog, .category-panel, .order-flow, .product-card, .product-art, .product-card-body, .add-button, .hero-banner-slider .hero-arrow, .hero-banner-slider .hero-slider-dots),
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) :is(.cp-shop-shell, .cp-shop-shell *, .site-header, .site-header *) {
  will-change: auto !important;
}

/* Performance offscreen budget: let Chrome skip lower-page rendering until it nears the viewport. */
body.home :is(.order-flow, .site-footer),
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) :is(.cp-shop-main, .site-footer) {
  content-visibility: auto;
  contain-intrinsic-size: auto 640px;
}

body.home .catalog,
body:is(.post-type-archive-product, .woocommerce-shop, .tax-product_cat, .tax-product_tag) .cp-shop-main .product-card {
  contain: layout paint style;
}

/* Hero motion budget: keep the approved subtle zoom at rest, but stop the
   continuous large-image transform while the visitor is actively scrolling. */
@media (min-width: 981px) {
  body.home .hero-banner-slide.is-active .hero-banner-link img {
    animation: cp-hero-banner-zoom-budget 5600ms linear forwards !important;
    will-change: transform !important;
  }

  body.home.cp-home-scroll-active .hero-banner-slide.is-active .hero-banner-link img {
    animation: none !important;
    transform: scale(1) !important;
    will-change: auto !important;
  }
}

@keyframes cp-hero-banner-zoom-budget {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.024);
  }
}

@media (max-width: 980px), (prefers-reduced-motion: reduce) {
  body.home .hero-banner-slide.is-active .hero-banner-link img {
    animation: none !important;
    transform: scale(1) !important;
    will-change: auto !important;
  }
}
