/*
 * Ucuzabulan B172 - mobile compare/market/PDP and live marketplace logo polish
 * Loaded after legacy bundles to neutralize older desktop-first rules on phones.
 */

.ub-compare-pair-grid,
#ubHomeComparedGrid,
.grid-prod--market,
.ub-market-grid,
.ub-prod-grid{min-width:0!important;}

.ub-compare-pair-card,
.ub-compare-side,
.ub-compare-side__body,
.ub-mkt-card,
.ub-mkt-card *{box-sizing:border-box;min-width:0;}

.ub-compare-pair-card{overflow:hidden!important;}
.ub-compare-pair-card__products{align-items:stretch!important;}
.ub-compare-side{overflow:hidden!important;}
.ub-compare-side__img{object-fit:contain!important;background:#fff!important;mix-blend-mode:normal!important;}
.ub-compare-side__title{overflow-wrap:anywhere!important;word-break:break-word!important;line-height:1.22!important;}
.ub-compare-side .badge,
.ub-compare-side__badges .badge{white-space:normal!important;overflow-wrap:anywhere!important;word-break:break-word!important;line-height:1.12!important;min-height:0!important;padding:6px 8px!important;font-size:11px!important;border-radius:999px!important;}

@media (max-width:720px){
  .ub-home2-main .ub-compare-pair-grid,
  #ubHomeComparedGrid.ub-compare-pair-grid,
  #ubHomeComparedGrid{grid-template-columns:1fr!important;gap:10px!important;}
  .ub-compare-pair-card{padding:10px!important;border-radius:18px!important;}
  .ub-compare-pair-card__products{display:grid!important;grid-template-columns:minmax(0,1fr) 40px minmax(0,1fr)!important;gap:8px!important;}
  .ub-compare-side{padding:8px!important;border-radius:15px!important;}
  .ub-compare-side__img{height:94px!important;max-height:94px!important;margin-bottom:7px!important;}
  .ub-compare-vs{width:38px!important;height:38px!important;font-size:12px!important;align-self:center!important;position:relative!important;top:auto!important;left:auto!important;right:auto!important;transform:none!important;margin:0!important;}
}

@media (max-width:380px){
  .ub-compare-pair-card__products{grid-template-columns:minmax(0,1fr) 34px minmax(0,1fr)!important;gap:6px!important;}
  .ub-compare-side{padding:7px!important;}
  .ub-compare-side__img{height:82px!important;max-height:82px!important;}
  .ub-compare-side .badge{font-size:10px!important;padding:5px 6px!important;}
}

.grid-prod--market .ub-mkt-card,
.ub-market-grid .ub-mkt-card{overflow:hidden!important;}
.ub-mkt-card__img,
.ub-mkt-card__img img{background:#fff!important;object-fit:contain!important;mix-blend-mode:normal!important;}
.ub-mkt-title{overflow-wrap:anywhere!important;word-break:break-word!important;}
.ub-mkt-store,
.ub-mkt-store span{min-width:0!important;max-width:100%!important;}
.ub-mkt-store span{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;display:block!important;}
.ub-mkt-store img,
.ub-offer-v2__seller img,
.ub-store-ico,
.ub-marketplace-logo{object-fit:contain!important;background:#fff!important;}

@media (max-width:720px){
  .grid-prod--market,
  .ub-market-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;}
  .ub-mkt-card{padding:10px!important;border-radius:18px!important;}
  .ub-mkt-card__main{display:block!important;gap:0!important;}
  .ub-mkt-card__img{width:100%!important;height:124px!important;margin:0 0 9px!important;border-radius:15px!important;}
  .ub-mkt-card__img img{width:100%!important;height:100%!important;}
  .ub-mkt-card__meta{display:block!important;width:100%!important;}
  .ub-mkt-card__price{font-size:17px!important;line-height:1.12!important;}
  .ub-mkt-card__footer{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;align-items:stretch!important;}
  .ub-mkt-card__footer .btn,
  .ub-mkt-card__footer a{width:100%!important;justify-content:center!important;}
}

@media (max-width:360px){
  .grid-prod--market,
  .ub-market-grid{grid-template-columns:1fr!important;}
  .ub-mkt-card__img{height:150px!important;}
}

/* Product detail: older sticky rules could overlap gallery on mobile. Keep desktop sticky, make mobile normal flow. */
.ub-pdp .ub-pdp-topdock,
.ub-pdp-topdock.card{contain:none!important;transform:none!important;}

@media (min-width:861px){
  .ub-pdp .ub-pdp-topdock,
  .ub-pdp-topdock.card{position:sticky!important;top:calc(var(--ub-header-h,76px) + 10px)!important;z-index:36!important;max-height:calc(100vh - var(--ub-header-h,76px) - 18px)!important;overflow:auto!important;margin-bottom:16px!important;}
  .ub-pdp__gallery,
  .ub-pdp__main{position:relative!important;z-index:1!important;}
}

@media (max-width:860px){
  .ub-pdp .ub-pdp-topdock,
  .ub-pdp-topdock,
  .ub-pdp-topdock.card{position:relative!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;z-index:4!important;max-height:none!important;overflow:visible!important;margin:10px 0 14px!important;box-shadow:0 12px 28px rgba(15,23,42,.08)!important;}
  .ub-pdp-topdock__summary{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;align-items:stretch!important;}
  .ub-pdp-topdock__left,
  .ub-pdp-topdock__right{width:100%!important;max-width:100%!important;}
  .ub-pdp-topdock__right{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;justify-items:stretch!important;}
  .ub-pdp-topdock__right .btn,
  .ub-pdp-topdock__right a{width:100%!important;justify-content:center!important;}
  .ub-pdp-topdock__nav{overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;white-space:nowrap!important;padding-bottom:4px!important;}
  .ub-pdp__main,
  .ub-pdp__gallery,
  .ub-pdp-gallery,
  .ub-pdp-hero{position:relative!important;z-index:1!important;overflow:visible!important;}
  .ub-pdp__image,
  .ub-pdp-gallery img,
  .ub-product-media img{max-width:100%!important;height:auto!important;object-fit:contain!important;}
}
