/* =========================================================
   BURNIGAN MOBILE LAYOUT HOTFIX — 1.1.7
   Loaded after the legacy master stylesheet under a unique
   filename so LiteSpeed/browser caches cannot reuse old CSS.
   ========================================================= */

@media (max-width: 999px) {
  /* Blocksy outputs separate desktop and mobile header trees.
     The desktop tree must not reserve space on small screens. */
  html body #header [data-device="desktop"],
  html body .ct-header [data-device="desktop"],
  html body .site-header [data-device="desktop"] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html body #header [data-device="mobile"],
  html body .ct-header [data-device="mobile"],
  html body .site-header [data-device="mobile"] {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Burnigan uses only the middle mobile row. Empty Blocksy top
     and bottom rows must not retain their Customizer row height. */
  html body #header [data-device="mobile"] [data-row="top"],
  html body #header [data-device="mobile"] [data-row="bottom"],
  html body .ct-header [data-device="mobile"] [data-row="top"],
  html body .ct-header [data-device="mobile"] [data-row="bottom"],
  html body .site-header [data-device="mobile"] [data-row="top"],
  html body .site-header [data-device="mobile"] [data-row="bottom"] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
  }

  /* Blocksy's row height is commonly driven by a --height custom
     property, not by min-height alone. Reset every relevant value. */
  html body #header [data-device="mobile"] [data-row="middle"],
  html body .ct-header [data-device="mobile"] [data-row="middle"],
  html body .site-header [data-device="mobile"] [data-row="middle"] {
    --height: 66px !important;
    --row-height: 66px !important;
    height: 66px !important;
    min-height: 66px !important;
    max-height: 66px !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top: 0 !important;
    box-sizing: border-box !important;
  }

  html body #header [data-device="mobile"] [data-row="middle"] > :is(.ct-container, .ct-container-fluid, .ct-container-full, div),
  html body .ct-header [data-device="mobile"] [data-row="middle"] > :is(.ct-container, .ct-container-fluid, .ct-container-full, div),
  html body .site-header [data-device="mobile"] [data-row="middle"] > :is(.ct-container, .ct-container-fluid, .ct-container-full, div) {
    --height: 66px !important;
    --row-height: 66px !important;
    height: 66px !important;
    min-height: 66px !important;
    max-height: 66px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
  }

  html body #header,
  html body .ct-header,
  html body .site-header,
  html body #header .ct-sticky-container,
  html body .ct-header .ct-sticky-container,
  html body .site-header .ct-sticky-container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  html body main#main,
  html body .site-main {
    margin-top: 0 !important;
  }
}

@media (max-width: 700px) {
  /* Homepage and standard page heroes start directly below the
     corrected 66px header row. */
  html body.home main#main,
  html body.home .site-main,
  html body.page:not(.woocommerce-page) main#main,
  html body.page:not(.woocommerce-page) .site-main {
    --theme-content-vertical-spacing: 0px !important;
    padding-top: 0 !important;
  }

  html body.home main#main > :is(.ct-container, .ct-container-full, .ct-container-fluid),
  html body.home .site-main > :is(.ct-container, .ct-container-full, .ct-container-fluid),
  html body.page:not(.woocommerce-page) main#main > :is(.ct-container, .ct-container-full, .ct-container-fluid),
  html body.page:not(.woocommerce-page) .site-main > :is(.ct-container, .ct-container-full, .ct-container-fluid) {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* Shop archive: remove the old editorial pseudo rows and restore
     a normal document flow. The prior flex/pseudo combination was
     able to reserve empty rows even when the labels were hidden. */
  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  .ct-shop-tabs,
  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  .ct-shop-tabs > :is(.ct-container, .ct-container-full, .ct-container-fluid) {
    min-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  main#main > :is(.ct-container, .ct-container-full, .ct-container-fluid) {
    margin-top: 0 !important;
    padding-top: 12px !important;
  }

  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  main#main .woocommerce {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  .ct-shop-tabs > :is(.ct-container, .ct-container-full, .ct-container-fluid)::before,
  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  .ct-shop-tabs > :is(.ct-container, .ct-container-full, .ct-container-fluid)::after,
  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  main#main > :is(.ct-container, .ct-container-full, .ct-container-fluid)::before,
  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  main#main .woocommerce::before,
  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  main#main .woocommerce::after,
  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  ul.products::before,
  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  ul.products::after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    clear: none !important;
  }

  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  .woocommerce-result-count {
    display: none !important;
  }

  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  .woocommerce-ordering {
    position: relative !important;
    display: grid !important;
    float: none !important;
    order: initial !important;
    width: 100% !important;
    min-height: 54px !important;
    margin: 0 0 12px !important;
  }

  html body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  ul.products {
    order: initial !important;
    clear: none !important;
    width: 100% !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
}
