/**
 * widget.css — style Inteligentnego Modułu Rekomendacji
 * Neutralne, dopasowują się do większości motywów WooCommerce.
 */

.rec-engine-widget {
  margin: 3rem 0 2rem;
  clear: both;
}

.rec-engine-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.rec-engine-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* Tablet */
@media (max-width: 1024px) {
  .rec-engine-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Telefon */
@media (max-width: 640px) {
  .rec-engine-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .rec-engine-title {
    font-size: 1.25rem;
  }
}

.rec-engine-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.rec-engine-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
  border-color: #d1d5db;
}

.rec-engine-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rec-engine-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rec-engine-info {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;
}

.rec-engine-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rec-engine-price {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: auto;
  color: #111827;
}

.rec-engine-price del {
  color: #9ca3af;
  font-weight: 400;
  margin-right: 0.35rem;
}

/* Skeleton ładowania */
.rec-engine-skeleton {
  aspect-ratio: 3 / 4;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    #f3f4f6 25%,
    #e9ebee 50%,
    #f3f4f6 75%
  );
  background-size: 200% 100%;
  animation: rec-engine-shimmer 1.4s ease infinite;
}

@keyframes rec-engine-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
