/* OctaStore mobile app shell v17 — mobile only */
.octa-mobile-tech-header,.octa-mobile-bottom-nav,.octa-mobile-catalog-sheet,.octa-mobile-catalog-backdrop{display:none}
@media (max-width:760px){
  :root{--octa-mobile-top:118px;--octa-mobile-bottom:70px}
  html{scroll-padding-top:calc(var(--octa-mobile-top) + 12px)}
  body{padding-top:calc(var(--octa-mobile-top) + env(safe-area-inset-top))!important;padding-bottom:calc(var(--octa-mobile-bottom) + env(safe-area-inset-bottom) + 10px)!important}
  .octa-shop-header[data-octa-shop-header]{display:none!important}
  .octa-mobile-tech-header{position:fixed;z-index:2147481000;left:0;right:0;top:0;height:calc(var(--octa-mobile-top) + env(safe-area-inset-top));padding:env(safe-area-inset-top) 14px 10px;display:flex;flex-direction:column;background:rgba(255,255,255,.98);border-bottom:1px solid #eceff3;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
  .octa-mobile-tech-header__logo{height:46px;display:flex;align-items:center;justify-content:center;text-decoration:none;flex:0 0 auto}
  .octa-mobile-tech-header__logo img{width:auto!important;height:31px!important;max-width:158px!important;object-fit:contain!important;display:block!important;background:transparent!important;border-radius:0!important;padding:0!important}
  .octa-mobile-tech-header__row{display:grid;grid-template-columns:52px minmax(0,1fr);gap:10px;align-items:center;height:52px}
  .octa-mobile-tech-header__catalog{width:52px;height:52px;border:0;border-radius:9px;background:#7a7d81;color:#fff;display:flex;align-items:center;justify-content:center;padding:0}
  .octa-mobile-tech-header__catalog svg{width:28px;height:28px}
  .octa-mobile-tech-header__catalog span{display:none}
  .octa-mobile-tech-header__searchbox{position:relative;min-width:0;height:52px}
  .octa-mobile-tech-header__search{width:100%;height:52px;border:1px solid #d6dae0;border-radius:9px;background:#fff;padding:0 50px 0 16px;font:500 16px/1.2 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#101828;outline:none}
  .octa-mobile-tech-header__search::placeholder{color:#a8adb5}.octa-mobile-tech-header__search:focus{border-color:#98a2b3;box-shadow:0 0 0 3px rgba(152,162,179,.12)}
  .octa-mobile-tech-header__searchicon{position:absolute;right:0;top:0;width:50px;height:52px;border:0;background:#101828;color:#fff;border-radius:0 9px 9px 0;display:flex;align-items:center;justify-content:center}.octa-mobile-tech-header__searchicon svg{width:24px;height:24px}
  .octa-mobile-search-results{position:absolute;left:66px;right:14px;top:calc(env(safe-area-inset-top) + 108px);max-height:min(62vh,520px);overflow:auto;background:#fff;border:1px solid #e4e7ec;border-radius:12px;box-shadow:0 18px 45px rgba(16,24,40,.16);z-index:2147481005;padding:6px}
  .octa-mobile-search-results[hidden]{display:none!important}.octa-mobile-search-results a{display:block;padding:12px 11px;border-radius:9px;text-decoration:none;color:#101828;font:650 13px/1.35 Inter,sans-serif}.octa-mobile-search-results a+a{border-top:1px solid #f1f3f5}
  .octa-mobile-bottom-nav{position:fixed;z-index:2147481001;left:0;right:0;bottom:0;height:calc(var(--octa-mobile-bottom) + env(safe-area-inset-bottom));padding:6px 8px env(safe-area-inset-bottom);display:grid;grid-template-columns:repeat(4,1fr);background:rgba(255,255,255,.98);border-top:1px solid #e7ebf0;box-shadow:0 -8px 30px rgba(16,24,40,.06);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
  .octa-mobile-bottom-nav__item{appearance:none;border:0;background:none;text-decoration:none;color:#30343a;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font:650 11px/1 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-width:0;padding:0;cursor:pointer}.octa-mobile-bottom-nav__item svg{width:25px;height:25px;display:block;stroke:currentColor}.octa-mobile-bottom-nav__item.is-active{color:#101828;font-weight:800}.octa-mobile-bottom-nav__item:active{transform:scale(.96)}
  .octa-mobile-catalog-backdrop{position:fixed;z-index:2147481010;inset:0;background:#fff}.octa-mobile-catalog-backdrop.is-open{display:block}
  .octa-mobile-catalog-sheet{position:fixed;z-index:2147481011;left:0;right:0;top:calc(var(--octa-mobile-top) + env(safe-area-inset-top));bottom:calc(var(--octa-mobile-bottom) + env(safe-area-inset-bottom));background:#fff;padding:14px 24px 28px;overflow:auto;border-top:1px solid #eef0f3}
  .octa-mobile-catalog-sheet.is-open{display:block}.octa-mobile-catalog-sheet__title{font:800 20px/1.2 Inter,sans-serif;color:#101828;padding:8px 0 12px}
  .octa-mobile-catalog-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:18px 0;border:0;border-bottom:1px solid #e9ebef;background:#fff;color:#5d6269;text-decoration:none;text-align:left;font:500 18px/1.2 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.octa-mobile-catalog-row strong{font-weight:600;color:#30343a}.octa-mobile-catalog-row svg{width:22px;height:22px;flex:0 0 auto}
  .octa-mobile-catalog-sub{display:none;padding:0 0 8px 18px}.octa-mobile-catalog-sub.is-open{display:block}.octa-mobile-catalog-sub a{display:flex;align-items:center;justify-content:space-between;padding:13px 0;border-bottom:1px solid #f0f2f4;text-decoration:none;color:#50555c;font:500 15px/1.2 Inter,sans-serif}
  .octa-support__launcher{bottom:calc(var(--octa-mobile-bottom) + env(safe-area-inset-bottom) + 14px)!important}.octa-support__panel{bottom:calc(var(--octa-mobile-bottom) + env(safe-area-inset-bottom) + 74px)!important;height:min(560px,calc(100vh - var(--octa-mobile-top) - var(--octa-mobile-bottom) - 90px))!important}.toast{bottom:calc(var(--octa-mobile-bottom) + env(safe-area-inset-bottom) + 16px)!important}.cart-drawer{padding-bottom:calc(var(--octa-mobile-bottom) + env(safe-area-inset-bottom))}img{max-width:100%}.prod-grid,.products-grid,.catalog-grid{min-width:0}
}

/* v19: live cart counter only — preserves v17 mobile layout */
@media (max-width:760px){
  .octa-mobile-cart-wrap{position:relative;display:flex;align-items:center;justify-content:center}
  .octa-mobile-cart-badge{position:absolute;top:-6px;right:-9px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#2563eb;color:#fff;border:2px solid #fff;display:none;align-items:center;justify-content:center;font:800 10px/14px Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 7px rgba(37,99,235,.28)}
  .octa-mobile-cart-badge.is-visible{display:flex}
}


/* v21 final mobile catalog stabilization: keep approved v17 shell, compact 2-column product tiles */
@media (max-width:760px){
  .prod-grid,.products-grid,.catalog-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    align-items:stretch!important;
  }
  .prod-grid>.prod-card,.products-grid>.prod-card,.catalog-grid>.prod-card{
    min-width:0!important;
    width:auto!important;
    margin:0!important;
  }
  .prod-card .prod-body{padding:10px!important;gap:4px!important}
  .prod-card .prod-specs{display:none!important}
  .prod-card .prod-brand{font-size:9px!important;line-height:1.25!important}
  .prod-card .prod-name{font-size:13px!important;line-height:1.28!important;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .prod-card .prod-price{font-size:16px!important;line-height:1.2!important}
  .prod-card .prod-footer{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important;margin-top:auto!important}
  .prod-card .add-btn{width:100%!important;min-height:38px!important;padding:8px 7px!important;font-size:12px!important}
  .prod-card .octa-stock{font-size:11px!important}
  .octa-mobile-catalog-sheet__utility{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:14px 0 4px}
  .octa-mobile-catalog-sheet__utility a{display:flex;min-height:50px;align-items:center;justify-content:center;text-align:center;padding:8px 6px;border:1px solid #e4e7ec;border-radius:10px;background:#fff;color:#30343a;text-decoration:none;font:650 12px/1.25 Inter,sans-serif}
}


/* v22 — mobile product tile/image + compact KUPO catalog + logged-in account */
@media (max-width:760px){
  .prod-card .prod-img{height:auto!important;min-height:0!important;aspect-ratio:1/1!important;padding:6px!important;overflow:hidden!important;background:#fff!important}
  .prod-card .prod-img img{width:100%!important;height:100%!important;max-height:none!important;object-fit:contain!important;object-position:center!important}
  .octa-mobile-catalog-sub{padding:10px 0 12px!important;display:none!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .octa-mobile-catalog-sub.is-open{display:grid!important}
  .octa-mobile-catalog-sub a{min-height:48px!important;padding:9px 10px!important;border:1px solid #e5e7eb!important;border-radius:10px!important;background:#f8fafc!important;font-size:12px!important;font-weight:650!important;line-height:1.2!important;justify-content:flex-start!important;color:#30343a!important}
  .octa-mobile-catalog-sub a svg{display:none!important}
  .octa-mobile-catalog-row{padding:13px 0!important;font-size:16px!important}
  .octa-mobile-catalog-row>svg{width:16px!important;height:16px!important}
  .octa-mobile-bottom-account-avatar{width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#101828;color:#fff;font:800 9px/1 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.02em}
  .octa-mobile-bottom-nav__item.is-logged-in .octa-mobile-bottom-account-icon{display:none!important}
  .octa-mobile-bottom-nav__item:not(.is-logged-in) .octa-mobile-bottom-account-avatar{display:none!important}
}

/* v24 — iOS product modal scroll + bottom cart bridge.
   Scroll the overlay itself on touch devices; keep the fixed app header/nav usable. */
@media(max-width:900px){
  .product-detail-overlay{
    align-items:flex-start!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-y:contain;
    touch-action:pan-y;
    padding:calc(var(--octa-mobile-top,118px) + env(safe-area-inset-top) + 8px) 10px calc(var(--octa-mobile-bottom,70px) + env(safe-area-inset-bottom) + 12px)!important;
  }
  .product-detail-modal{
    width:100%!important;
    max-height:none!important;
    overflow:visible!important;
  }
}


/* v29 — mobile cart viewport lock + iOS touch scroll.
   Keeps cart between the approved fixed mobile header and bottom navigation. */
@media (max-width:760px){
  .cart-drawer{
    top:calc(var(--octa-mobile-top) + env(safe-area-inset-top))!important;
    bottom:calc(var(--octa-mobile-bottom) + env(safe-area-inset-bottom))!important;
    height:auto!important;
    max-height:none!important;
    padding-bottom:0!important;
    overflow:hidden!important;
    display:flex!important;
    flex-direction:column!important;
    overscroll-behavior:contain!important;
  }
  .cart-head{
    position:relative!important;
    top:auto!important;
    flex:0 0 auto!important;
    z-index:4!important;
    background:#fff!important;
  }
  .cart-close{
    position:relative!important;
    top:auto!important;
    right:auto!important;
    flex:0 0 auto!important;
    touch-action:manipulation!important;
  }
  .cart-items{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:contain!important;
    touch-action:pan-y!important;
  }
  .cart-foot{
    position:relative!important;
    flex:0 0 auto!important;
    z-index:3!important;
    background:#fff!important;
  }
  body.cart-open{
    overflow:hidden!important;
    touch-action:auto!important;
  }
}
