/* Card de produto compartilhado: /catalogo, busca e carrosséis de produtos
   (home e "Produtos relacionados"). Carregado em todas as páginas pelo head.ejs. */
.catalog-card {
  --ct-yellow: #fcce0b;
  --ct-dark: #262626;
  --ct-muted: #6b6b6b;
  --ct-border: #ececec;
  --ct-radius: 16px;
}

/* ---------- Card ---------- */
.catalog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius);
  background: #fff;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.catalog-card:hover {
  border-color: #e2e2e2;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.catalog-card-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.catalog-card-link:hover {
  color: inherit;
}

.catalog-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  margin: 10px 10px 0;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.catalog-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 18px;
  object-fit: contain;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.catalog-card-img--hover {
  opacity: 0;
}

@media (hover: hover) {
  .catalog-card:hover .catalog-card-img {
    transform: scale(1.04);
  }

  .catalog-card:hover .catalog-card-media:has(.catalog-card-img--hover) .catalog-card-img:not(.catalog-card-img--hover) {
    opacity: 0;
  }

  .catalog-card:hover .catalog-card-img--hover {
    opacity: 1;
  }
}

.catalog-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 3px 10px;
  border-radius: 999px;
  background: #12a150;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.catalog-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 6px;
}

.catalog-card-brand {
  color: var(--ct-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.catalog-card-title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ct-dark);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.catalog-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 16px;
}

.catalog-card-btn {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 10px;
  background: var(--ct-yellow);
  color: var(--ct-dark);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: filter 0.2s ease;
}

.catalog-card-btn:hover {
  color: var(--ct-dark);
  filter: brightness(0.96);
}

.catalog-card-whats {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(37, 211, 102, 0.4);
  border-radius: 10px;
  color: #25d366;
  transition: background-color 0.2s ease;
}

.catalog-card-whats:hover {
  background: rgba(37, 211, 102, 0.08);
  color: #25d366;
}

.catalog-card-price {
  margin-top: 4px;
  color: var(--ct-muted);
  font-size: 0.82rem;
}

.catalog-card-price strong {
  color: var(--ct-dark);
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  .catalog-card-media {
    margin: 6px 6px 0;
  }

  .catalog-card-img {
    padding: 10px;
  }

  .catalog-card-body {
    padding: 10px 10px 4px;
  }

  .catalog-card-title {
    font-size: 0.85rem;
  }

  .catalog-card-actions {
    padding: 8px 10px 10px;
    gap: 6px;
  }

  .catalog-card-btn,
  .catalog-card-whats {
    height: 38px;
  }

  .catalog-card-whats {
    width: 38px;
  }

  .catalog-card-btn {
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-card,
  .catalog-card-img {
    transition: none;
  }
}

/* ---------- Dentro dos carrosséis (.product-list) ----------
   O li continua com .product-item porque o carrocelProduct.js usa essa classe
   para clonar os itens e medir o passo; aqui só anulamos o visual antigo. */
.product-list {
  /* Espaço para a sombra e o "levantar" do card no hover não serem cortados */
  padding: 8px 2px 18px !important;
}

.product-list > .product-item.catalog-card {
  /* Todos os cards da fileira com a mesma altura (o CSS antigo limitava ao conteúdo) */
  align-self: stretch;
  max-height: none;
  min-height: 0;
  padding: 0 !important;
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius);
  background: #fff;
  text-align: left;
  cursor: default !important;
}

.product-list > .product-item.catalog-card:hover {
  border-color: #e2e2e2;
}

.product-list .catalog-card-link,
.product-list .catalog-card-btn,
.product-list .catalog-card-whats {
  font-weight: inherit;
  cursor: pointer;
}

.product-list .catalog-card-btn {
  font-weight: 700;
}

.product-list .catalog-card-img {
  -webkit-user-drag: none;
}
