/* STARTERLM MOBILE V9. Scoped to existing V3 markers + exact current DOM.
   No image replacements, JS cart edits, order, stock, price or text changes.
   Banner rule prefers preserving the complete original desktop photograph
   over cropping product and text. */
@media screen and (max-width:767.98px) {
  /* Only enable the row design AFTER the V9 observer has verified the
     preexisting quantity input, favourite and original add-to-cart button. */
  body .button-holder.holder-5.js-counter:has(#add-button-holder.slm-v9-qty-ready) {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
    text-align: left !important;
  }
  body .button-holder.holder-5.js-counter > div:has(> #add-button-holder.slm-v9-qty-ready) {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
    text-align: left !important;
  }
  html body #add-button-holder.product_variant.quantity.slm-qty-final-v3.slm-v9-qty-ready {
    display: flex !important;
    flex-flow: row wrap !important;
    align-content: flex-start !important;
    align-items: center !important;
    justify-content: flex-start !important;
    column-gap: 12px !important;
    row-gap: 12px !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 18px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    text-align: left !important;
  }
  /* Preserve the existing accessible label without letting it use a flex row. */
  html body #add-button-holder.slm-v9-qty-ready > label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  html body #add-button-holder.product_variant.quantity.slm-v9-qty-ready > input[type="number"][number_of_bought_items] {
    order: 0 !important;
    flex: 0 0 190px !important;
    width: 190px !important;
    max-width: min(190px, calc(100vw - 100px)) !important;
    margin: 0 !important;
    min-width: 0 !important;
    /* All original number, text, background, focus and click behaviour stay. */
  }
  html body #add-button-holder.product_variant.quantity.slm-v9-qty-ready > button[data-type="favourites"] {
    order: 1 !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    box-sizing: border-box !important;
  }
  html body #add-button-holder.product_variant.quantity.slm-v9-qty-ready > .slm-v9-row-break {
    order: 2 !important;
    flex: 0 0 100% !important;
    display: block !important;
    width: 100% !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
  }
  /* This selector changes only position. It deliberately does NOT override
     the existing button's font, text, font-case, colour, border or min-width. */
  html body #add-button-holder.product_variant.quantity.slm-v9-qty-ready > button[buy-product-button] {
    order: 3 !important;
    flex: 0 0 auto !important;
    align-self: flex-start !important;
    margin: 0 !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Banner: change ONLY the already V3-confirmed original home carousel.
     Do not touch Slick's transform or make one slide structurally different.
     Identical viewport height, original desktop sources, contain not cover. */
  html body .js-slider-slick.slm-full-original-banners-v3:has(.slick-slide a.template-503[href*="/products/starteri"]):has(.slick-slide a.template-503[href*="/products/alternatori"]) {
    --slm-v9-banner-height: clamp(250px, 73vw, 300px);
  }
  html body .js-slider-slick.slm-full-original-banners-v3 > .slick-list,
  html body .js-slider-slick.slm-full-original-banners-v3 > .slick-list > .slick-track {
    height: var(--slm-v9-banner-height, auto) !important;
    min-height: var(--slm-v9-banner-height, 0px) !important;
  }
  html body .js-slider-slick.slm-full-original-banners-v3 .slick-slide:has(> a.template-503[href*="/products/starteri"]),
  html body .js-slider-slick.slm-full-original-banners-v3 .slick-slide:has(> a.template-503[href*="/products/alternatori"]) {
    height: var(--slm-v9-banner-height, auto) !important;
    min-height: var(--slm-v9-banner-height, 0px) !important;
    position: relative !important;
    overflow: hidden !important;
  }
  html body .js-slider-slick.slm-full-original-banners-v3 .slick-slide > a.template-503:is([href*="/products/starteri"],[href*="/products/alternatori"]) {
    position: absolute !important;
    display: block !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
  }
  html body .js-slider-slick.slm-full-original-banners-v3 .slick-slide > a.template-503:is([href*="/products/starteri"],[href*="/products/alternatori"]) > img.h-100.d-lg-block.d-none {
    display: block !important;
    visibility: visible !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    object-fit: contain !important;
    object-position: right center !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    /* Source files/URLs/filters remain untouched. */
  }
  html body .js-slider-slick.slm-full-original-banners-v3 .slick-slide > a.template-503:is([href*="/products/starteri"],[href*="/products/alternatori"]) > img.h-100.d-lg-none {
    display: none !important;
  }
  html body .js-slider-slick.slm-full-original-banners-v3 .slick-slide:has(> a.template-503:is([href*="/products/starteri"],[href*="/products/alternatori"])) > .custom_banner-position {
    display: block !important;
    position: absolute !important;
    left: 4% !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    width: min(48%, 200px) !important;
    max-width: min(48%, 200px) !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: calc(var(--slm-v9-banner-height, 290px) - 28px) !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    z-index: 3 !important;
    text-align: left !important;
    box-sizing: border-box !important;
    background: transparent !important;
  }
  html body .js-slider-slick.slm-full-original-banners-v3 .slick-slide:has(> a.template-503:is([href*="/products/starteri"],[href*="/products/alternatori"])) .custom_banner-position :is(h1,h2,h3,h4,h5) {
    position: static !important;
    transform: none !important;
    text-align: left !important;
    font-size: clamp(18px, 5vw, 24px) !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere !important;
    margin: 0 0 7px !important;
  }
  html body .js-slider-slick.slm-full-original-banners-v3 .slick-slide:has(> a.template-503:is([href*="/products/starteri"],[href*="/products/alternatori"])) .custom_banner-position :is(p,small,.description) {
    position: static !important;
    transform: none !important;
    text-align: left !important;
    font-size: clamp(10px, 2.7vw, 13px) !important;
    line-height: 1.22 !important;
    margin: 0 0 7px !important;
    overflow-wrap: break-word !important;
  }
  html body .js-slider-slick.slm-full-original-banners-v3 .slick-slide:has(> a.template-503:is([href*="/products/starteri"],[href*="/products/alternatori"])) .custom_banner-position :is(a,button) {
    font-size: clamp(10px, 2.7vw, 13px) !important;
    line-height: 1.15 !important;
    padding: 5px 8px !important;
    max-width: 100% !important;
  }
  html body .js-slider-slick.slm-full-original-banners-v3 > .slick-dots {
    bottom: 6px !important;
    z-index: 5 !important;
  }
}
