.grid-gallery{
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  padding: var(--gap);
  box-sizing: border-box;
}

/* breakpoints */
@media (max-width: 1000px){
  .grid-gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px){
  .grid-gallery { grid-template-columns: 1fr; }
}

/* product-card container keeps aspect ratio and hides overflow */
.product-card{
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #f2f2f2;
  /* use aspect-ratio so every product-card has consistent height regardless of image */
  aspect-ratio: 4 / 3; /* change to 1/1 for square, or remove to let content define height */
  display: block;
  transform: translateZ(0);
}

/* Image fills the box and preserves cover (cropping if needed) */
.product-card img{
  width: 100%;
  height: 100%;
  object-fit: cover;   /* ensures any-size image fills box without distortion */
  object-position: center;
  display: block;
  transition: transform 480ms cubic-bezier(.2,.8,.2,1), filter 360ms ease;
  will-change: transform;
  backface-visibility: hidden;
  border: solid 8px #d6d6d6;
}

/* Zoom effect on hover */
.product-card:hover img,
.product-card:focus-within img{
  transform: scale(var(--zoom-scale));
  filter: saturate(1.03) contrast(1.02);
}

/* Shimmer (glitter) overlay */
.product-card::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* angled white shimmer bar */
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.65) 30%,
    rgba(255,255,255,0.18) 40%,
    rgba(255,255,255,0) 60%
  );
  transform: translateX(-140%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 300ms ease;
  filter: blur(6px);
}

/* small sparkle dots layer */
.product-card::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,0.95) 0px, rgba(255,255,255,0) 8px),
    radial-gradient(circle at 70% 10%, rgba(255,255,255,0.85) 0px, rgba(255,255,255,0) 6px),
    radial-gradient(circle at 40% 70%, rgba(255,255,255,0.9) 0px, rgba(255,255,255,0) 7px),
    radial-gradient(circle at 85% 60%, rgba(255,255,255,0.9) 0px, rgba(255,255,255,0) 5px);
  background-repeat: no-repeat;
  opacity: 0;
  filter: blur(2px);
  transform: translateY(6px) scale(0.98);
  transition: opacity 220ms ease, transform 400ms cubic-bezier(.2,.8,.2,1);
  mix-blend-mode: screen;
}

/* hover state - reveal and move the shimmer/glitter */
.product-card:hover::after,
.product-card:focus-within::after{
  transform: translateX(140%);
  opacity: var(--glow-opacity);
  animation: shimmer var(--shimmer-duration) linear infinite;
}

.product-card:hover::before,
.product-card:focus-within::before{
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: sparkle 1.4s linear infinite;
}


/* Glitter shine overlay */
.product-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  transition: all 0.7s ease;
}

/* Hover effect */
.product-card:hover img {
  transform: scale(1.05);
}

.product-card:hover::after {
  left: 130%;
  transition: left 0.7s ease-in-out;
}

/* Optional: Add subtle sparkles */
.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.8) 2px, transparent 3px),
    radial-gradient(circle, rgba(255,255,255,0.8) 2px, transparent 3px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.product-card:hover::before {
  opacity: 0.6;
  animation: sparkle 1.2s linear infinite;
}

/* Sparkle animation */
@keyframes sparkle {
  0%, 100% { background-position: 0 0, 10px 10px; }
  50% { background-position: 10px 10px, 0 0; }
}