/* Market — product card polish (price row + uniform media). Scoped to the main grid only. */
@media (min-width:768px){
  body.ph-market .mp-grid--main > article.mp-feature{grid-column:auto!important}
  body.ph-market .mp-grid--main > article.mp-feature .aspect-square{
    aspect-ratio:1/1!important;background:#f8fafc!important}
  body.ph-market .mp-grid--main > article.mp-feature .aspect-square img{
    object-fit:cover!important;padding:0!important;transform:none!important}
}
body.ph-market .mp-grid--main .aspect-square{aspect-ratio:1/1!important}
body.ph-market .mp-grid--main .aspect-square img{object-fit:cover!important;padding:0!important}

/* price row: «قیمت» on top, the live price and the old price on ONE line, buy button aligned */
body.ph-market .mp-grid--main article .mt-auto{padding-top:10px!important;align-items:flex-end!important;gap:8px!important}
body.ph-market .mp-grid--main article .mt-auto > div:first-child{
  display:flex!important;flex-direction:column;align-items:flex-start;gap:4px;min-width:0}
body.ph-market .mp-grid--main article .mt-auto > div:first-child > span:nth-child(1){
  font-size:10px!important;line-height:1.4;color:#94a3b8!important}
body.ph-market .mp-grid--main article .mt-auto > div:first-child > span:nth-child(2){
  font-size:14.5px!important;font-weight:800!important;line-height:1.25!important;
  color:#1d4ed8!important;white-space:nowrap}
body.ph-market .mp-grid--main article .mt-auto > div:first-child > span:nth-child(3){
  font-size:10px!important;line-height:1.2;color:#9ca3af!important;white-space:nowrap;
  text-decoration:line-through;text-decoration-thickness:1px}
body.ph-market .mp-grid--main article .mt-auto > div:last-child{gap:5px!important}
body.ph-market.mk-night .mp-grid--main article .mt-auto > div:first-child > span:nth-child(2){color:#93c5fd!important}
body.ph-market.mk-night .mp-grid--main article .mt-auto > div:first-child > span:nth-child(1),
body.ph-market.mk-night .mp-grid--main article .mt-auto > div:first-child > span:nth-child(3){color:#7f90a8!important}
@media (max-width:639.98px){
  body.ph-market .mp-grid--main article .mt-auto > div:first-child > span:nth-child(2){font-size:12.5px!important}
  body.ph-market .ph-parsi-mini{font-size:.58em!important;margin-inline-start:2px!important}
  body.ph-market .mp-grid--main article .mt-auto > div:first-child > span:nth-child(3){font-size:9.5px!important}
}

/* small unit label next to تومان prices */
.ph-parsi-mini{display:inline-block;font-size:.62em;font-weight:600;line-height:1;opacity:.62;
  margin-inline-start:3px;letter-spacing:0;vertical-align:.08em;white-space:nowrap}
.ph-price-unit{font-size:.74em;font-weight:600;opacity:.8;margin-inline-start:2px;white-space:nowrap}
body.ph-market.mk-night .ph-parsi-mini{opacity:.75}

/* very narrow phones: the price line owns the full card width — the buy button moves to
   its own row under it (this is what clipped «(پارسی)» in two-column cards). */
@media (max-width:479.98px){
  body.ph-market .mp-grid--main article .mt-auto{flex-direction:column!important;align-items:stretch!important;gap:6px!important}
  body.ph-market .mp-grid--main article .mt-auto > div:last-child{
    flex-direction:row!important;align-items:center!important;justify-content:space-between!important}
  body.ph-market .mp-grid--main article .mt-auto > div:last-child > span{order:0}
  body.ph-market .mp-grid--main article .mt-auto button{order:1}
  body.ph-market .mp-grid--main article .mt-auto > div:first-child > span:nth-child(3){font-size:9.5px!important}
}

/* market theme switch floating over the hero headline on phones — drop it to a
   normal FAB slot above the bottom bar so it never covers a headline or a price. */
@media (max-width:640px){
  body.ph-market:not(.ph-mkt-detail) .mk-fab{ top:auto!important; bottom:calc(84px + env(safe-area-inset-bottom,0px))!important;
    right:auto!important; left:11px!important; z-index:70!important }
  body.ph-market:not(.ph-mkt-detail) .mk-fab-b{ width:40px!important; height:40px!important;
    box-shadow:0 10px 26px -12px rgba(15,23,42,.55)!important }
  body.ph-market:not(.ph-mkt-detail) .mk-fab-b svg{ width:19px!important; height:19px!important }
}
