/* ===== V91 — final mobile stabilization ===== */

/* Category hero media: approved mobile 4:3 ratio instead of the later square override. */
@media (max-width: 767px){
  body.mp-category-pechi.mp-hero-standard-v69 main>.hero-v5>.hero-media,
  body.mp-category-kamery.mp-hero-standard-v69 main>.camera-hero.hero-v5>.hero-media,
  body.mp-category-avtomatika.mp-hero-standard-v69 .auto-hero>.auto-hero-grid>.auto-hero-media{
    width:100%!important;
    max-width:none!important;
    min-height:0!important;
    height:auto!important;
    aspect-ratio:4/3!important;
    justify-self:stretch!important;
  }

  /* Pechi selector must be a true one-column mobile flow. */
  body.mp-category-pechi #calc .calc{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:12px!important;
    align-items:start!important;
  }
  body.mp-category-pechi #calc .calc>div,
  body.mp-category-pechi #calc .g,
  body.mp-category-pechi #calc .res{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  body.mp-category-pechi #calc .grid3,
  body.mp-category-pechi #calc .grid2{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:9px!important;
  }
  body.mp-category-pechi #calc label,
  body.mp-category-pechi #calc input,
  body.mp-category-pechi #calc select{
    min-width:0!important;
    max-width:100%!important;
  }
  body.mp-category-pechi #calc .stats{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  /* Custom oven calculator: no squeezed two-column controls on phones. */
  body.mp-category-pechi #custom-calc .custom-calc-grid{
    grid-template-columns:minmax(0,1fr)!important;
  }
  body.mp-category-pechi #custom-calc .grid3,
  body.mp-category-pechi #custom-calc .grid2,
  body.mp-category-pechi #custom-calc .custom-standard-grid,
  body.mp-category-pechi #custom-calc .custom-result-stats{
    grid-template-columns:minmax(0,1fr)!important;
  }
  body.mp-category-pechi #custom-calc .custom-calc-form,
  body.mp-category-pechi #custom-calc .custom-calc-result,
  body.mp-category-pechi #custom-calc .custom-energy-strip{
    min-width:0!important;
    max-width:100%!important;
  }
}

@media (max-width: 480px){
  /* Mobile catalogue controls should never render as narrow side-by-side fields. */
  body.mp-category-pechi #catalog .catalog-tools{
    grid-template-columns:minmax(0,1fr)!important;
  }
  body.mp-category-pechi #catalog .catalog-meta,
  body.mp-category-pechi #catalog .catalog-meta-actions{
    min-width:0!important;
    max-width:100%!important;
  }
}

/* Product photos must not inherit the legacy 70px desktop thumbnail column. */
@media (max-width: 767px){
  body.mp-hero-standard-v69 .product-hero > .product-gallery{
    grid-template-columns:minmax(0,1fr)!important;
    min-width:0;
  }
  body.mp-hero-standard-v69 .product-gallery > .product-main-photo{
    grid-column:1/-1;
    order:0;
    min-width:0;
  }
  body.mp-hero-standard-v69 .product-gallery > .product-thumbs{
    display:flex!important;
    flex-direction:row;
    flex-wrap:wrap;
    justify-content:center;
    grid-column:1/-1;
    order:2!important;
  }
  body.mp-hero-standard-v69 .product-thumbs > .product-thumb{
    flex:0 0 54px;
    width:54px!important;
    height:54px!important;
  }
}
