/* ═══════════════════════════════════════════════════════════
   PRODUCT CARD — mobile-first, otimizado para tela pequena
   ═══════════════════════════════════════════════════════════ */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  /* evita que o card quebre o layout em qualquer tela */
  min-width: 0;
  word-break: break-word;
}
.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--primary);
  z-index: 1;
}
/* Toque em mobile não precisa do hover, mas dá feedback */
@media (hover: none) {
  .product-card:active { opacity: 0.92; transform: scale(0.98); }
  .product-card:hover { transform: none; box-shadow: var(--shadow-card); }
}

/* ── Badges sobre a imagem ── */
.product-badges {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.badge-pct {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
  white-space: nowrap;
}
.badge-hot-deal {
  background: var(--gold);
  color: #333;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* ── Imagem ── */
.product-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}
.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  /* melhora renderização em mobile */
  will-change: transform;
  -webkit-backface-visibility: hidden;
}
.product-card:hover .product-img-wrap img { transform: scale(1.06); }

/* Overlay de "Ver Oferta" — só aparece em hover (desktop) */
.product-img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.product-card:hover .product-img-overlay { opacity: 1; }
@media (hover: none) {
  .product-img-overlay { display: none; }
}
.quick-view-btn {
  background: rgba(255,255,255,0.95);
  color: var(--primary);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

/* ── Info ── */
.product-info {
  padding: 8px 8px 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
  /* garante que nada extrapola o card */
  min-width: 0;
  overflow: hidden;
}

/* Nome: 2 linhas máx */
.product-name {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* impede quebra de layout */
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── Rating ── */
.product-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 4px;
  overflow: hidden;
}
.stars { color: var(--gold); font-size: 11px; letter-spacing: -1px; }
.rating-count {
  font-size: 10px;
  color: var(--text-light);
  white-space: nowrap;
}

/* ── Preço ── */
.product-pricing {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 5px;
  flex-wrap: wrap;
  overflow: hidden;
}
.price-current {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  white-space: nowrap;
}
.price-original {
  font-size: 11px;
  color: var(--text-light);
  text-decoration: line-through;
  line-height: 1;
  white-space: nowrap;
}

/* ── Meta (vendidos + frete) ── */
.product-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
  flex-wrap: wrap;
  overflow: hidden;
}
.sold-count {
  font-size: 10px;
  color: var(--text-light);
  white-space: nowrap;
}
.free-shipping-badge {
  font-size: 9px;
  color: var(--success);
  font-weight: 700;
  background: #E8F5E9;
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,177,79,0.25);
  white-space: nowrap;
}

/* ── Urgência — UMA linha com ellipsis ── */
.product-urgency {
  font-size: 10px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 3px;
  /* ← correção principal: nunca quebra linha */
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
}
.product-urgency i { font-size: 9px; flex-shrink: 0; }
.product-urgency span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* ── Botão CTA ── */
.btn-comprar {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  text-align: center;
  line-height: 1.25;
  /* área de toque mínima recomendada pelo Google: 44px */
  min-height: 40px;
  /* velocidade tátil */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-comprar:hover {
  background: var(--primary-dark);
  box-shadow: 0 3px 10px rgba(238,77,45,0.4);
}
.btn-comprar:active { opacity: 0.88; }

/* ── Urgência — permite 2 linhas no mobile ── */
@media (max-width: 480px) {
  .product-urgency {
    white-space: normal;
    align-items: flex-start;
  }
  .product-urgency span {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: clip;
    font-size: 9.5px;
  }
}

/* ── Skeletons ── */
.product-skeleton {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.skeleton-img {
  aspect-ratio: 1;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-line {
  height: 11px;
  border-radius: 4px;
  margin: 7px 8px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ════════════════════════ AJUSTES POR BREAKPOINT ════════════ */

/* Tablet: cards um pouco maiores */
@media (min-width: 769px) {
  .product-info { padding: 10px 10px 12px; }
  .product-name { font-size: 13px; margin-bottom: 6px; }
  .price-current { font-size: 16px; }
  .product-urgency { font-size: 11px; margin-bottom: 8px; }
  .btn-comprar { font-size: 13px; padding: 9px 8px; }
}

/* Mobile pequeno (≤ 360px): compacta ainda mais */
@media (max-width: 360px) {
  .product-info { padding: 6px 6px 8px; }
  .price-current { font-size: 13px; }
  .btn-comprar { font-size: 11px; padding: 8px 4px; min-height: 36px; }
  .product-name { font-size: 11px; }
}
