/* iMobi.uz V107 — targeted responsive product layout correction.
   Header and mobile bottom navigation are intentionally not selected here. */

/* Product cards: consistent media frame and content sizing on every viewport. */
.shop-home .home-product-card,
.store-v95 .store-product-card,
.store-v95 .store-card {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.shop-home .home-product-image,
.store-v95 .store-product-image,
.store-v95 .store-card .product-image {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
  background: #f5f5f7;
}
.shop-home .home-product-image img,
.store-v95 .store-product-image img,
.store-v95 .store-card .product-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.shop-home .home-product-info,
.store-v95 .store-product-info,
.store-v95 .store-card .store-product-info {
  min-width: 0;
  overflow-wrap: anywhere;
}
.shop-home .home-product-info h3,
.store-v95 .store-product-info h3,
.store-v95 .store-card h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.3;
}

/* If the API returns only one featured product, center it instead of leaving
   an awkward empty half-row on the left side of the mobile screen. */
.shop-home .home-product-grid > .home-product-card:only-child {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 340px);
}
.shop-home .home-product-grid > .home-empty-products,
.shop-home .home-product-grid > .catalog-note {
  grid-column: 1 / -1;
  width: 100%;
}

/* Mobile product grid: two balanced columns when multiple products exist. */
@media (max-width: 680px) {
  .shop-home .home-product-grid,
  .store-v95 .store-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
    width: 100%;
  }
  .shop-home .home-product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 17px;
  }
  .shop-home .home-product-image {
    height: clamp(145px, 39vw, 205px) !important;
    min-height: 0;
    margin: 6px 6px 0;
    border-radius: 13px;
  }
  .shop-home .home-product-info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    padding: 11px 11px 13px;
  }
  .shop-home .home-price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px 7px;
  }
  .shop-home .home-price-row .product-price {
    font-size: clamp(14px, 3.8vw, 18px);
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .shop-home .home-product-info h3 {
    margin: 2px 0;
    font-size: clamp(13px, 3.6vw, 16px);
  }
  .shop-home .home-stock-line {
    margin-top: auto;
    font-size: 12px;
  }
  .shop-home .home-product-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
    margin-top: 5px;
  }
  .shop-home .home-product-actions > * {
    min-width: 0;
    min-height: 42px;
    padding: 9px 7px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
  }
  .shop-home .home-favorite {
    width: 34px;
    height: 34px;
  }
  .shop-home .home-product-grid > .home-product-card:only-child {
    width: min(100%, 340px);
  }
  .store-v95 .store-product-grid {
    gap: 11px;
  }
  .store-v95 .store-product-grid > * {
    min-width: 0;
  }
  .store-v95 .store-product-image {
    height: clamp(145px, 39vw, 205px) !important;
  }
}
@media (max-width: 380px) {
  .shop-home .home-product-grid,
  .store-v95 .store-product-grid {
    gap: 9px;
  }
  .shop-home .home-product-info {
    padding: 9px 9px 11px;
  }
  .shop-home .home-product-actions {
    grid-template-columns: 1fr;
  }
}
/* Respect device motion preferences without changing functionality. */
@media (prefers-reduced-motion: reduce) {
  .shop-home .home-product-card,
  .shop-home .home-product-image img {
    animation: none !important;
    transition: none !important;
  }
}
