/*
  Card 01 — Immersive Product Card — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --card-accent: #39ff14;
  --card-fg: oklch(0.145 0 0);
  --card-muted: oklch(0.5 0 0);
  --card-error: oklch(0.58 0.19 20);
}

.product-card {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

.product-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  width: 100%;
  overflow: hidden;
  border-radius: 1.75rem;
  background-color: oklch(0.96 0 0);
  --px: 0px;
  --py: 0px;
}

.product-card__media img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 250ms ease-out;
}

.product-card:hover .product-card__media img {
  transform: scale(1.045);
}

/* The cursor-follow accent is precision-pointer only — on touch it's
   inert anyway (no sustained hover state to trigger it), but the media
   query keeps the transform calculation from ever running on a coarse
   pointer. */
@media (hover: hover) and (pointer: fine) {
  .product-card__media img {
    transform: translate(var(--px), var(--py));
  }

  .product-card:hover .product-card__media img {
    transform: translate(var(--px), var(--py)) scale(1.045);
  }
}

.product-card__scrim {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 33%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.22), transparent);
  pointer-events: none;
}

.product-card__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--card-fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.product-card__save {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  color: var(--card-muted);
  cursor: pointer;
  outline: none;
  transition: color 150ms ease-out;
}

.product-card__save:hover {
  color: var(--card-fg);
}

.product-card__save:focus-visible {
  outline: 2px solid var(--card-fg);
  outline-offset: 2px;
}

.product-card__save[aria-pressed="true"] {
  color: var(--card-error);
}

.product-card__save svg {
  height: 1rem;
  width: 1rem;
}

.product-card__save[aria-pressed="true"] svg {
  fill: currentColor;
}

.product-card__panel {
  position: relative;
  z-index: 1;
  margin: -2.25rem 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  border-radius: 1.25rem;
  background-color: #ffffff;
  padding: 1rem;
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.28);
  transition: box-shadow 200ms ease-out;
}

.product-card:hover .product-card__panel {
  box-shadow: 0 24px 52px -18px rgba(0, 0, 0, 0.34);
}

.product-card__category {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--card-muted);
}

.product-card__name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--card-fg);
}

.product-card__rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--card-muted);
}

.product-card__rating svg {
  height: 0.875rem;
  width: 0.875rem;
  color: #fbbf24;
}

.product-card__rating strong {
  font-weight: 600;
  color: var(--card-fg);
}

.product-card__price {
  margin-top: 0.125rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.product-card__price-current {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--card-fg);
}

.product-card__price-previous {
  font-size: 0.875rem;
  color: var(--card-muted);
  text-decoration: line-through;
}

.product-card__cta {
  margin-top: 0.625rem;
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: none;
  border-radius: 9999px;
  background-color: var(--card-fg);
  padding: 0.625rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  transition: background-color 150ms ease-out;
}

.product-card__cta:hover {
  background-color: oklch(0.22 0 0);
}

.product-card__cta:focus-visible {
  outline: 2px solid var(--card-fg);
  outline-offset: 2px;
}

.product-card__cta svg {
  height: 1rem;
  width: 1rem;
  transition: transform 150ms ease-out;
}

.product-card:hover .product-card__cta svg {
  transform: translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
  .product-card__media img,
  .product-card__panel,
  .product-card__cta svg {
    transition: none;
  }

  .product-card:hover .product-card__media img,
  .product-card:hover .product-card__cta svg {
    transform: none;
  }
}

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #f5f5f5, #e5e5e5b3);
}
.card01-layout {
  display: flex;
  min-height: 24rem;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
}
.card01-layout__panel {
  width: 100%;
  max-width: 280px;
}
