/**
 * Glowflare commerce layout authority, 2026-11-13.
 * Desktop only: align shop/product/basket/checkout/sponsor with the 940px menu.
 * Mobile Glowflare layouts and mobile basket remain deliberately untouched.
 * WooCommerce owns all transactional behaviour.
 */
@media (min-width: 992px) {
  body.na-commerce-live {
    --gf-commerce-width: 940px;
    --gf-commerce-space: 10px;
    /* The page around transparent shop panels uses Glowflare's night backdrop. */
    background-color: #0B1017 !important;
  }
  body.na-commerce-live #shop-content.na-commerce-page,
  body.na-commerce-live .woocommerce,
  body.na-commerce-live .na-basket-live,
  body.na-commerce-live .na-checkout-live {
    width: min(var(--gf-commerce-width), 100%) !important;
    max-width: var(--gf-commerce-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }
  body.na-commerce-live #shop-content.na-commerce-page {
    margin-top: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }
  body.na-commerce-live #shop-content.na-commerce-page,
  body.na-commerce-live #shop-content.na-commerce-page *,
  body.na-commerce-live .woocommerce,
  body.na-commerce-live .woocommerce * {
    box-sizing: border-box !important;
  }
  /* The Glowflare base sheet has a 1040px width on many inner .wraps. */
  body.na-commerce-live #shop-content.na-commerce-page > :is(section,div,article),
  body.na-commerce-live #shop-content.na-commerce-page .wrap,
  body.na-commerce-live #shop-content.na-commerce-page .na-related-products-section,
  body.na-commerce-live #shop-content.na-commerce-page .na-shop-sowing-bundle > .wrap,
  body.na-commerce-live #shop-content.na-commerce-page .na-product-tabs,
  body.na-commerce-live #shop-content.na-commerce-page .na-product-layout,
  body.na-commerce-live #shop-content.na-commerce-page .na-shop-products,
  body.na-commerce-live #shop-content.na-commerce-page .na-shop-products > ul.products,
  body.na-commerce-live #shop-content.na-commerce-page .na-product-grid,
  body.na-commerce-live #shop-content.na-commerce-page .shop-catalogue > .wrap {
    width: 100% !important;
    max-width: 940px !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  body.na-commerce-live #shop-content.na-commerce-page .na-product-layout {
    grid-template-columns: minmax(0,400px) minmax(0,530px) !important;
    gap: 10px !important;
  }
  /* Main shop has three catalogue columns; cards stay inside the same shell. */
  body.na-commerce-live #shop-content.na-shop-page .na-shop-products > ul.products,
  body.na-commerce-live #shop-content.na-commerce-page .shop-catalogue ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin: 0 !important;
  }
  /* Related products: exactly 4 x 220px + 3 x 20px = 940px. */
  body.single-product.na-commerce-live #shop-content.na-single-product-page .na-related-products-section {
    width: 940px !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
  }
  body.single-product.na-commerce-live #shop-content.na-single-product-page .na-related-products-section .na-product-grid--recommendations {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 220px)) !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  body.single-product.na-commerce-live #shop-content.na-single-product-page .na-related-products-section .na-product-grid--recommendations > li {
    float: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 220px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  body.single-product.na-commerce-live #shop-content.na-single-product-page .na-related-products-section .related-section-divider,
  body.single-product.na-commerce-live #shop-content.na-single-product-page .na-related-products-section .related-section-divider__line {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  /* Neutral outer shop surface. Card backgrounds and sale ribbons remain. */
  body.na-commerce-live #shop-content.na-commerce-page,
  body.na-commerce-live #shop-content.na-commerce-page .shop-catalogue,
  body.na-commerce-live #shop-content.na-commerce-page .na-merch-archive-body {
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  /* Remove shell edges; preserve actual controls' contrast boundaries. */
  body.na-commerce-live #shop-content.na-commerce-page > .wrap,
  body.na-commerce-live #shop-content.na-commerce-page > section,
  body.na-commerce-live .woocommerce > .na-commerce-shell {
    border: 0 !important;
    box-shadow: none !important;
  }
  /* Cart and checkout match the menu without altering their small-screen grid. */
  body.woocommerce-cart.na-commerce-live .woocommerce,
  body.woocommerce-checkout.na-commerce-live .woocommerce,
  body.woocommerce-cart.na-commerce-live .na-basket-live,
  body.woocommerce-checkout.na-commerce-live .na-checkout-live {
    width: 940px !important;
    max-width: 100% !important;
    margin-top: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
    padding: 0 !important;
  }
  body.woocommerce-cart.na-commerce-live .na-cart-reference-grid,
  body.woocommerce-checkout.na-commerce-live .na-checkout-native-layout {
    gap: 10px !important;
    min-width: 0 !important;
  }
  body.woocommerce-cart.na-commerce-live .na-cart-reference-grid > *,
  body.woocommerce-checkout.na-commerce-live .na-checkout-native-layout > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  /* The footer Partner advert is rendered before <footer> by Films Manager.
     Limit just the outer banner, never the Partner's internal layout. */
  body.na-commerce-live .fm-sponsor-render--footer_partner,
  body.na-commerce-live .fm-sponsor-render--footer_banner {
    width: 940px !important;
    max-width: calc(100% - 0px) !important;
    box-sizing: border-box !important;
    margin: 10px auto !important;
    padding: 0 !important;
  }
  body.na-commerce-live .fm-sponsor-render--footer_partner > :not(style),
  body.na-commerce-live .fm-sponsor-render--footer_banner > :not(style) {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}
/* The original theme already has a mobile footer Partner design; do not override it. */
/* Native WooCommerce Blocks, if a store uses block-based Basket / Checkout. */
@media (min-width: 992px) {
  body.woocommerce-cart.na-commerce-live .wc-block-cart,
  body.woocommerce-checkout.na-commerce-live .wc-block-checkout {
    width: 100% !important;
    max-width: 940px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }
}

/* Keep the breadcrumb aligned whenever the 940px checkout grid activates,
   including narrow desktop widths from 960px to 991px. */
@media (min-width: 960px) {
  body.na-commerce-live {
    --gf-commerce-width: 940px;
  }
  /* A narrow desktop should not have a 980px shop but a 940px breadcrumb. */
  body.na-commerce-live #shop-content.na-commerce-page {
    box-sizing: border-box !important;
    width: min(940px, 100%) !important;
    max-width: 940px !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  /* Breadcrumbs are siblings of the page article in WordPress page.php,
     rather than children of #shop-content. Both the outer nav and its bar
     must use the same 940px edge as the shop, basket and checkout. */
  body.na-commerce-live :is(nav.breadcrumbs, #breadcrumbs, .woocommerce-breadcrumb) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: var(--gf-commerce-width) !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  body.na-commerce-live nav.breadcrumbs #breadcrumbs {
    width: 100% !important;
    max-width: 100% !important;
  }

}
