.card {
  background: var(--bg-blanco);
  border-radius: 12px;
  box-shadow: 0 4px 10px var(--sombra-suave);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 15px var(--sombra-hover);
}

.card__header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--borde-suave);
}

.card__body {
  padding: 1.5rem;
}

.card__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--borde-suave);
  background-color: rgba(228, 229, 212, 0.3);
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.product-card__image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background-color: var(--bg-tierra);
  border-bottom: 1px solid var(--borde-suave);
}

.product-card__body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card__title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--verde-musgo);
}

.product-card__description {
  font-size: 0.85rem;
  color: var(--texto-secundario);
  margin-bottom: 1rem;
  flex: 1;
}

.product-card__price {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cafe-raiz);
  margin-bottom: 0.5rem;
}

.product-card__price--sale {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.product-card__price--original {
  text-decoration: line-through;
  opacity: 0.6;
  font-size: 0.9rem;
}

.product-card__badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.sale-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 48px;
  height: auto;
  z-index: 2;
  pointer-events: none;
  transform-origin: center;
  animation: sale-breathe 2.4s ease-in-out infinite;
}

@keyframes sale-breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sale-badge {
    animation: none;
  }
}

.badge--sale { background: var(--acento-arcilla); color: white; }
.badge--stock--low { background: #FFD166; color: var(--cafe-raiz); }
.badge--stock--out { background: #EF476F; color: white; }
.badge--stock--soon { background: #06D6A0; color: var(--cafe-raiz); }

.product-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.product-card__category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--verde-musgo);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.product-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1.25rem 1.25rem;
}

.quantity-input {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--borde-suave);
  border-radius: 25px;
  overflow: hidden;
}

.quantity-input__btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-tierra);
  color: var(--cafe-raiz);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.quantity-input__btn:hover {
  background: var(--acento-arcilla);
  color: white;
}

.quantity-input__field {
  width: 42px;
  height: 32px;
  border: none;
  text-align: center;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--cafe-raiz);
  appearance: textfield;
  -moz-appearance: textfield;
}

.quantity-input__field::-webkit-outer-spin-button,
.quantity-input__field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stock-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.stock--available .dot { background: var(--verde-musgo); }
.stock--low .dot { background: #FFD166; }
.stock--out .dot { background: #EF476F; }
.stock--soon .dot { background: #06D6A0; }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  .card:hover {
    transform: none;
    box-shadow: 0 4px 10px var(--sombra-suave);
  }
}

/* Product grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
}