/* IEMS5718 Phase 1 - Index page */

.product-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: .9rem;
}
.product-grid .empty-state{ grid-column: 1 / -1; }

.product-card{
  grid-column: span 3;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21,24,36,.55) 0%, rgba(21,24,36,.32) 100%);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  transition: transform .18s ease, border-color .18s ease, box-shadow .2s ease;
  transform-style: preserve-3d;
}
.product-card::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 220px at 10% 0%, rgba(124,92,255,.18), transparent 55%),
    radial-gradient(500px 200px at 90% 10%, rgba(45,212,191,.12), transparent 55%);
  opacity: .65;
  pointer-events: none;
}
.product-card > *{ position: relative; z-index: 1; }
.product-card:hover{
  transform: translate3d(0,-2px,0) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  border-color: rgba(124,92,255,.35);
  box-shadow: 0 22px 45px rgba(0,0,0,.32);
}
.product-card:focus-within{
  border-color: rgba(124,92,255,.45);
  box-shadow: var(--ring), 0 22px 45px rgba(0,0,0,.32);
}
.product-media{
  aspect-ratio: 4/3;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.product-media img{ width: 100%; height: 100%; object-fit: cover; }
.product-body{
  padding: .9rem .95rem .95rem .95rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.product-actions{
  margin-top: .75rem;
  display: flex;
  gap: .5rem;
}
.product-actions .btn{
  flex: 1;
}
.product-name{
  margin: 0 0 .25rem 0;
  font-size: 1rem;
  letter-spacing: .15px;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.product-name a{ color: inherit; text-decoration: none; }
.product-name a:hover{ text-decoration: underline; }
.product-meta{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: .4rem .5rem;
  margin-top: .6rem;
}
.price{
  font-weight: 800;
  letter-spacing: .2px;
  flex: 0 0 100%;
}
.tag{
  font-size: .8rem;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.12);
  padding: .15rem .5rem;
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-btn{
  width: 100%;
  margin-top: auto;
  padding: .7rem .85rem;
  border-radius: 14px;
  border: 1px solid rgba(124,92,255,.55);
  background: linear-gradient(135deg, rgba(124,92,255,.22) 0%, rgba(45,212,191,.10) 100%);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.add-btn:hover{ background: rgba(124,92,255,.22); }
.add-btn:active{ transform: translateY(1px); }

@media (max-width: 1100px){
  .product-card{ grid-column: span 4; }
}
@media (max-width: 760px){
  .product-card{ grid-column: span 6; }
}
@media (max-width: 520px){
  .product-card{ grid-column: span 12; }
}
