/* =================================================================
   Product card — image, brand, name and rating.
   Used plain in the catalogue grid (with a category tag and a hover
   "view" overlay) and as .product-card--featured in the home page's
   best-sellers grid (tinted body, "best seller" badge, compact on phones).
   ================================================================= */

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 0.15rem solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: opacity 0.5s ease, transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1.2rem 3.2rem rgba(46, 40, 99, 0.14);
}

.product-card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 1.2rem;
  background: var(--color-white);
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}
.product-card:hover .product-card__image { transform: scale(1.07); }

.product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.3rem;
  overflow: hidden;
  padding: 1.5rem;
  background: var(--color-surface);
}

.product-card__category {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.2rem;
  padding: 0.3rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-bg-alt);
  font-size: 0.95rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-soft);
}

.product-card__brand {
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-brand);
}

.product-card__name {
  font-size: 1.5rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
  color: var(--color-navy-dark);
}

/* Catalogue cards: the product name is the card's button (keyboard and
   screen readers). Its ::after stretches over the whole card — the card is
   the nearest positioned ancestor — so a click anywhere opens the product. */
.product-card__button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  color: inherit;
  cursor: pointer;
}

.product-card__button::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Focus ring around the whole card (the card clips anything drawn outside it) */
@supports selector(:has(*)) {
  .product-card__button:focus-visible { outline: none; }

  .product-card:has(.product-card__button:focus-visible) {
    outline: 2.5px solid var(--color-brand);
    outline-offset: 3px;
  }
}

.product-card__rating {
  margin-top: 0.3rem;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  color: var(--color-star);
}

/* "View product" hint shown over the image on hover (catalogue) */
.product-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1.8rem;
  background: linear-gradient(to top, rgba(29, 25, 64, 0.88) 0%, rgba(29, 25, 64, 0.2) 55%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.product-card:hover .product-card__overlay { opacity: 1; }

.product-card__cta {
  padding: 0.55rem 1.8rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.94);
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
  white-space: nowrap;
  color: var(--color-navy);
  transform: translateY(6px);
  transition: transform 0.25s ease;
}
.product-card:hover .product-card__cta { transform: translateY(0); }

/* ─────────────────────────── Featured (home best sellers) ─────────────────────────── */

.product-card--featured:hover {
  transform: translateY(-0.4rem);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1);
}

.product-card--featured .product-card__media { padding: 0.8rem; }

.product-card--featured .product-card__body {
  position: relative;
  gap: 0.2rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(160deg, #EEF1FF 0%, #DDE4FA 50%, #E8E2F8 100%);
}

/* Text sits above the glow */
.product-card--featured .product-card__brand,
.product-card--featured .product-card__name,
.product-card--featured .product-card__rating { position: relative; }

/* Soft brand-coloured glow in two corners */
.product-card--featured .product-card__body::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top right, rgba(157, 40, 98, 0.08) 0%, transparent 65%),
    radial-gradient(ellipse at bottom left, rgba(46, 40, 99, 0.07) 0%, transparent 65%);
  pointer-events: none;
}

.product-card--featured .product-card__brand { font-size: 0.9rem; letter-spacing: 0.05em; }
.product-card--featured .product-card__name  { font-size: 1.2rem; line-height: 1.35; }
.product-card--featured .product-card__rating { margin-top: 0.15rem; font-size: 1.1rem; }

.product-card__badge {
  position: absolute;
  top: 0.7rem;
  inset-inline-start: 1rem;
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  background: var(--color-navy);
  font-size: 0.85rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-white);
}

@media (min-width: 769px) {
  .product-card--featured .product-card__media { padding: 1.2rem; }

  .product-card--featured .product-card__body { gap: 0.3rem; padding: 1.5rem; }

  .product-card--featured .product-card__brand { font-size: 1.1rem; letter-spacing: 0.1em; }
  .product-card--featured .product-card__name  { font-size: 1.5rem; line-height: 1.4; }
  .product-card--featured .product-card__rating { margin-top: 0.3rem; font-size: 1.3rem; }

  .product-card__badge {
    top: 1rem;
    padding: 0.3rem 1rem;
    font-size: 1.1rem;
  }
}
