/* MOBILE-FIX 17 Nov 2026 (Haroon's iPhone test 17 Nov 00:04-00:13). Linked LAST. Display only: no prices, no data.
   M10 listing cards line up (title block keeps room for 2 name lines + size line; stock line sits on the card floor)
   M4/M6 phone sticky bar: basket line + busy state      M2 photo viewer      M6/M7 extras: undo, in-place options, details link
   M1 phone gallery: square photo box; photos with white side bands fill the box (lp-mf-gallery.js sets the sizes)
   Undo: remove the lp-mfix line in head.tpl (UNDO-MF-*.sh). */

/* ---------- M10 listing cards ---------- */
html body:not(#_):not(#__):not(#___) .lp-card .lp-card__title{min-height:calc(2.72em + 20px)}
html body:not(#_):not(#__):not(#___) .lp-card .lp-card__body{align-content:stretch;grid-template-rows:min-content min-content min-content 1fr}
html body:not(#_):not(#__):not(#___) .lp-card .lp-card__stock{grid-row:4;align-self:end}

/* ---------- M4/M6 phone sticky bar ---------- */
html body#product .lp-pp-buybar .lp-mf-bk{display:block;font:600 12px/1.25 inherit;color:#1b5e20;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body#product .lp-pp-buybar .lp-mf-bk[hidden]{display:none}
html body#product .lp-pp-buybar .lp-mf-bk b{font-weight:800;margin-left:4px}
html.lp-mf-hasbk body#product .lp-pp-buybar .lp-bar-sum{display:none!important}
html body#product .lp-pp-buybar__link{touch-action:manipulation;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,.1)}
html body#product .lp-pp-buybar__link.lp-mf-busy{opacity:.6;pointer-events:none}
html body#product .lp-mf-barmsg{position:fixed;left:12px;right:12px;bottom:84px;z-index:10060;background:#1f1f1f;color:#fff;border-radius:10px;padding:10px 14px;font:500 14px/1.35 inherit;box-shadow:0 6px 18px rgba(0,0,0,.25)}
html body#product .lp-mf-barmsg[hidden]{display:none}

/* ---------- M2 photo viewer ---------- */
.lp-mfv{position:fixed;inset:0;z-index:2147483000;background:rgba(12,12,12,.96);display:flex;flex-direction:column;touch-action:none;overscroll-behavior:contain;-webkit-user-select:none;user-select:none}
.lp-mfv[hidden]{display:none}
.lp-mfv__track{position:relative;flex:1 1 auto;overflow:hidden}
.lp-mfv__strip{position:absolute;inset:0;display:flex;will-change:transform}
.lp-mfv__slide{flex:0 0 100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}
.lp-mfv__slide img{max-width:100%;max-height:100%;object-fit:contain;transform-origin:0 0;will-change:transform;pointer-events:none}
.lp-mfv__close{position:absolute;top:calc(10px + env(safe-area-inset-top));right:10px;z-index:3;width:52px;height:52px;border-radius:50%;border:0;background:#fff;color:#111;font:400 34px/52px Arial,sans-serif;text-align:center;padding:0;box-shadow:0 2px 10px rgba(0,0,0,.35)}
.lp-mfv__count{position:absolute;top:calc(22px + env(safe-area-inset-top));left:16px;z-index:3;color:#fff;font:600 15px/1 inherit;background:rgba(0,0,0,.45);padding:7px 11px;border-radius:14px}
.lp-mfv__hint{position:absolute;left:0;right:0;bottom:calc(14px + env(safe-area-inset-bottom));z-index:3;text-align:center;color:rgba(255,255,255,.8);font:500 13px/1.3 inherit;pointer-events:none}
.lp-mfv__dots{display:inline-flex;gap:6px;margin-bottom:6px}
.lp-mfv__dots i{width:7px;height:7px;border-radius:50%;background:rgba(255,255,255,.35)}
.lp-mfv__dots i.on{background:#fff}
.lp-mfv__nav{position:absolute;top:50%;z-index:3;width:44px;height:64px;margin-top:-32px;border:0;background:rgba(0,0,0,.35);color:#fff;font:400 34px/64px Arial,sans-serif;padding:0}
.lp-mfv__nav--p{left:0;border-radius:0 8px 8px 0}.lp-mfv__nav--n{right:0;border-radius:8px 0 0 8px}
html.lp-mfv-open,html.lp-mfv-open body{overflow:hidden!important;overscroll-behavior:none}

/* ---------- M1 phone gallery ---------- */
@media (max-width:767.98px){
  html body#product ul.product-mobile-images.lp-mf-g > li{position:relative!important;overflow:hidden!important;background:#fff}
  html body#product ul.product-mobile-images.lp-mf-g > li > img.lp-mf-fit{position:absolute!important;max-width:none!important;max-height:none!important;object-fit:fill!important;margin:0!important}
}

/* ---------- M6/M7 extras ---------- */
html body#product .lp-mf-undo{margin-left:6px;border:0;background:none;color:#b3401b;font:600 13px/1.2 inherit;text-decoration:underline;padding:8px 4px;cursor:pointer}
html body#product .lp-mf-det{display:inline-block;margin-top:2px;font:500 12px/1.3 inherit;color:#555;text-decoration:underline}
html body#product .lp-mf-pick{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0 2px;width:100%}
html body#product .lp-mf-pick select{flex:1 1 180px;min-width:0;height:44px;border:1px solid #bbb;border-radius:8px;padding:0 10px;font:500 15px inherit;background:#fff}
html body#product .lp-mf-pick button{height:44px;padding:0 16px;border:0;border-radius:8px;background:#1f1f1f;color:#fff;font:700 14px inherit}
html body#product .lp-mf-pick .lp-mf-pmsg{flex:1 0 100%;font:500 13px/1.3 inherit;color:#444}
html body#product .lp-mf-sug{display:inline-block;margin:0 0 3px;padding:2px 7px;border-radius:10px;background:#eef6ee;color:#1b5e20;font:700 11px/1.4 inherit;letter-spacing:.02em}
html body#product .lp-f-ess__item.lp-mf-hasopt{flex-wrap:wrap}

/* ---------- M8 phones: second photo on swipe (lp-mf-list.js) ---------- */
@media (hover:none){
  html body:not(#_):not(#__):not(#___) .lp-card .product-thumbnail.lp-mf-alt-on img.ds-card__alt.is-ready{opacity:1}
  html body:not(#_):not(#__) #js-product-list .lp-card .product-thumbnail:has(img.ds-card__alt)::after{content:"";position:absolute;left:50%;bottom:8px;width:22px;height:7px;margin-left:-11px;z-index:3;pointer-events:none;
    background:radial-gradient(circle at 3.5px 3.5px,#fff 3px,transparent 3.6px),radial-gradient(circle at 18.5px 3.5px,rgba(255,255,255,.55) 3px,transparent 3.6px);filter:drop-shadow(0 0 1px rgba(0,0,0,.6))}
  html body:not(#_):not(#__) #js-product-list .lp-card .product-thumbnail.lp-mf-alt-on:has(img.ds-card__alt)::after{background:radial-gradient(circle at 3.5px 3.5px,rgba(255,255,255,.55) 3px,transparent 3.6px),radial-gradient(circle at 18.5px 3.5px,#fff 3px,transparent 3.6px)}
}

/* ---------- M9 phones: the sort list always opens DOWNWARD under the Sort button (it flipped up and slid under the sticky header);
   the list scrolls inside itself if the screen is short ---------- */
@media (max-width:767.98px){
  html body:not(#_):not(#__) .products-sort-order .dropdown-menu.show{position:absolute!important;inset:calc(100% + 4px) 0 auto auto!important;top:calc(100% + 4px)!important;bottom:auto!important;left:auto!important;right:0!important;transform:none!important;max-height:min(60vh,420px);overflow-y:auto;z-index:70!important}
  html body:not(#_):not(#__) .products-sort-order .dropdown-menu.show a{min-height:44px;display:flex!important;align-items:center;justify-content:center}
}
