/* Estructura limpia y sin tarjeta contenedora sólida */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  background-color: transparent;
  border: none;
  box-shadow: none;
  box-sizing: border-box;
  padding: 0;
}

/* Portada del producto */
.product-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.48;
  overflow: hidden;
  background-color: var(--bg-dark);
  box-sizing: border-box;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.product-card:hover .product-card__media {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.product-card__image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  outline: none;
}

.product-card__image-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.product-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Insignias sobre portada */
.product-card__media .etiqueta-producto {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 3;
}

/* Botón flotante de favoritos */
.product-card__wishlist-toggle {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  color: var(--text-inverse);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  backdrop-filter: blur(4px);
  transition: transform 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.product-card__wishlist-toggle:hover {
  transform: scale(1.1);
  color: var(--accent);
  background: rgba(0, 0, 0, 0.45);
}

.product-card__wishlist-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.product-card__wishlist-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.product-card__wishlist-icon--default {
  display: inline-flex;
}

.product-card__wishlist-icon--active {
  display: none;
}

.product-card__wishlist-toggle--active {
  color: var(--accent);
}

.product-card__wishlist-toggle--active .product-card__wishlist-icon--default {
  display: none;
}

.product-card__wishlist-toggle--active .product-card__wishlist-icon--active {
  display: inline-flex;
}

/* Contenido textual */
.product-card__content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 0.75rem 0 0;
  box-sizing: border-box;
}

.product-card__info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  margin-bottom: 0.5rem;
}

.product-card__title {
  display: -webkit-box;
  min-height: 2.5em;
  margin: 0;
  overflow: hidden;
  font-family: inherit;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-card__title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.product-card__title-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.product-card__title-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.product-card__author {
  margin: 0;
  overflow: hidden;
  font-family: inherit;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 400;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.product-card__author span {
  color: var(--text-muted);
}

/* Zona comercial y precios */
.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  margin-top: auto;
  padding-top: 0.5rem;
}

.product-card__pricing {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.product-card__price-ins {
  color: var(--price-sale);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.product-card__price-del {
  color: var(--price-old);
  font-family: inherit;
  font-size: var(--fs-2xs);
  font-weight: 400;
  line-height: 1.15;
  white-space: nowrap;
  text-decoration: line-through;
}

/* Botón de compra compacto */
.product-card__action-area {
  flex-shrink: 0;
}

.product-card__basket-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  height: 1.875rem;
  padding: 0 0.65rem;
  color: var(--text-inverse);
  background-color: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-sizing: border-box;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 0 var(--accent-hover);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.product-card__basket-btn:hover:not(:disabled) {
  background-color: var(--accent-hover);
}

.product-card__basket-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.product-card__basket-btn:disabled {
  color: var(--text-muted);
  background-color: var(--border-light);
  box-shadow: none;
  cursor: not-allowed;
}

.product-card__basket-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  line-height: 1;
}

.product-card__basket-icon--check {
  display: none;
}

.product-card__basket-spinner {
  display: none;
  width: 0.6875rem;
  height: 0.6875rem;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: product-card__basket-spin 0.6s linear infinite;
}

/* Estados de feedback */
.product-card__basket-btn--loading {
  pointer-events: none;
  cursor: wait;
}

.product-card__basket-btn--loading .product-card__basket-icon--basket,
.product-card__basket-btn--loading .product-card__basket-icon--check,
.product-card__basket-btn--loading .product-card__basket-btn-text {
  display: none;
}

.product-card__basket-btn--loading .product-card__basket-spinner {
  display: block;
}

.product-card__basket-btn--added {
  pointer-events: none;
  cursor: default;
  color: var(--text-inverse) !important;
  background-color: var(--success) !important;
  box-shadow: 0 2px 0 var(--secondary-hover) !important;
}

.product-card__basket-btn--added .product-card__basket-icon--basket {
  display: none;
}

.product-card__basket-btn--added .product-card__basket-icon--check {
  display: inline-flex;
}

@keyframes product-card__basket-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Adaptabilidad responsive */
@media (max-width: 768px) {
  .product-card__title {
    font-size: var(--fs-xs);
  }

  .product-card__author {
    font-size: var(--fs-2xs);
  }

  .product-card__price-ins {
    font-size: var(--fs-xs);
  }

  .product-card__basket-btn {
    height: 1.75rem;
    padding: 0 0.45rem;
  }

  .product-card__basket-btn-text {
    display: none;
  }

  .product-card__basket-icon {
    font-size: var(--fs-sm);
  }
}