/* Shop product tiles — square (1:1) item cards. */

.shop-thumb,
.shop-thumb-placeholder {
  aspect-ratio: 1 / 1;
  width: 100%;
}

.shop-thumb {
  object-fit: cover;
  /* The width/height attributes on the <img> (there to reserve space and avoid
     layout shift) map to presentational height, which would otherwise win over
     aspect-ratio and render the tile as a rectangle. */
  height: auto;
}

.shop-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
}

.shop-thumb-placeholder img {
  width: 55%;
  max-width: 120px;
  height: auto;
  opacity: 0.35;
}

/* "Game" / "Category" labels above each filter row. */
.shop-filter-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  opacity: 0.55;
  margin-bottom: 0.4rem;
}

/* Section heading shown per category when no category filter is active. */
.shop-section-head {
  font-size: 1.25rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.shop-tile {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shop-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.35);
}

.shop-tile-sold .shop-thumb,
.shop-tile-sold .shop-thumb-placeholder {
  opacity: 0.45;
  filter: grayscale(1);
}

/* ---- cart ---- */

/* Floating cart button; hidden until the checkout service says it's available. */
.cart-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1035;
  border-radius: 999px;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.45);
  padding: 0.7rem 1.15rem;
}

.cart-fab .cart-count {
  display: inline-block;
  min-width: 1.4em;
  margin-left: 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font-variant-numeric: tabular-nums;
}

.cart-line {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.cart-line img,
.cart-line .cart-thumb-ph {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cart-qty button {
  width: 1.9rem;
  height: 1.9rem;
  line-height: 1;
  padding: 0;
  border-radius: 6px;
}

.cart-qty output {
  min-width: 1.6rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cart-totals {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 0.85rem;
  margin-top: 0.5rem;
}

.cart-totals .row-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.cart-totals .row-line.total {
  font-size: 1.15rem;
  font-weight: 700;
}

/* Keep long card names from blowing out tile height. */
.shop-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .shop-tile {
    transition: none;
  }

  .shop-tile:hover {
    transform: none;
  }
}
