/* 06-cards.css — Product cards and every image shimmer placeholder.
   Part of the old css/styles.css (lines 1255–1475); unused rules since removed.
   The number is the load order: later files override earlier ones, exactly
   as later lines in the single file used to. Keep them linked in order. */

/* ── Product Cards ── */
.trending-container { margin-bottom: 1.5rem; }
.product-scroll {
  display: flex; gap: 0.4rem; overflow-x: auto;
  padding: 0 1rem 0.5rem;
  scroll-padding: 0 1rem;
  scroll-behavior: smooth;
}
.product-scroll::-webkit-scrollbar { height: 3px; }
.product-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 2px; }

.product-grid-static { display: grid; grid-template-columns: repeat(2,1fr); gap: 0.4rem; margin-bottom: 1.5rem; padding: 0 1rem; align-items: start; }

.product-card {
  background: #fff; border-radius: 0; padding: 0.3rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
}
.product-scroll .product-card { flex: 0 0 160px; }
.product-card.show { opacity: 1; transform: translateY(0); }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); }
.product-card img { width: 100%; height: 160px; object-fit: cover; border-radius: 0; margin-bottom: 0.2rem; }

/* ── Image shimmer placeholder — holds space while image loads ── */
/* product-card-img-wrap: explicit height locks the space before image arrives */
.product-card-img-wrap {
  position: relative;
  overflow: hidden;
  background: #ebebeb;
  width: 100%;
  height: 160px;         /* ~75% of total card height */
  border-radius: 0;
  margin-bottom: 0.2rem;
  flex-shrink: 0;
}
.product-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
  position: relative;
  z-index: 1;
  /* hide broken-image icon while shimmer shows */
  color: transparent;
}
.product-card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ebebeb 25%, #d6d6d6 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease-in-out infinite;
  border-radius: 0;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.product-card-img-wrap.loaded::after {
  opacity: 0;
  pointer-events: none;
}
@keyframes imgShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* card-img-wrap: brand cards */
.card-img-wrap {
  position: relative;
  overflow: hidden;
  background: #ebebeb;
  height: 160px;
  margin-bottom: 0.2rem;
  flex-shrink: 0;
}
.card-img-wrap img {
  width: 100%; height: 160px;
  object-fit: cover; display: block;
  transition: transform .3s;
  position: relative; z-index: 1;
  color: transparent;
}
.card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ebebeb 25%, #d6d6d6 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.card-img-wrap.loaded::after { opacity: 0; }

/* ── Product profile — shimmer skeleton background/overlay only.
   (Sizing/object-fit for the actual <img> now lives solely in the
   .product-gallery-main img rule below — no separate clamp here.) ── */
.product-img-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #ebebeb;
}
.product-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ebebeb 25%, #d6d6d6 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.product-img-wrap.loaded::after { opacity: 0; }

/* ── Gallery slide shimmer ── */
.gallery-slide {
  position: relative;
}
.gallery-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ebebeb 25%, #d6d6d6 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.gallery-slide.loaded::after { opacity: 0; }
.gallery-slide img {
  position: relative;
  z-index: 1;
  color: transparent;
}

/* ── Brand profile logo ring shimmer ── */
.bp-logo-ring {
  position: relative;
}
.bp-logo-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 30px;
  background: linear-gradient(90deg, #ebebeb 25%, #d6d6d6 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.bp-logo-ring.loaded::after { opacity: 0; }
.bp-logo-ring img, .bp-logo-ring span {
  position: relative;
  z-index: 3;
}

/* chat-item-avatar shimmer */
.chat-item-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #ebebeb;
}
.chat-item-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ebebeb 25%, #d6d6d6 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
  border-radius: 10px;
}
.chat-item-avatar.loaded::after { opacity: 0; }
.chat-item-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
  color: transparent;
}
.product-name     { font-size: 0.8rem; font-weight: 500; margin: 0 0 2px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-price    { font-size: 1rem; font-weight: 900; color: #19378C; letter-spacing: -0.3px; }
.product-discount { background: #ff4d4f; color: #fff; font-size: 0.65rem; padding: 0.1rem 0.25rem; border-radius: 4px; margin-left: 0.25rem; }
.product-price-row { margin-top: auto; padding-top: 2px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
