/* ============================================
   HHPF Bridge — Categories Grid Shortcode
   ============================================ */
.hhpfb-cats-grid {
  display: grid;
  grid-template-columns: repeat(var(--hhpfb-cat-cols, 4), 1fr);
  gap: 6px;
}

.hhpfb-cat-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  text-decoration: none;
  color: #fff;
  display: block;
  cursor: pointer;
}

/* Background image layer */
.hhpfb-cat-card__bg {
  position: absolute;
  inset: 0;
  background: #2D2D2D center/cover no-repeat;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hhpfb-cat-card:hover .hhpfb-cat-card__bg {
  transform: scale(1.08);
}

/* Gradient overlay */
.hhpfb-cat-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.82) 0%,
    rgba(0,0,0,0.3) 50%,
    rgba(0,0,0,0.1) 100%
  );
  transition: background 0.3s ease;
}

.hhpfb-cat-card:hover .hhpfb-cat-card__overlay {
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.88) 0%,
    rgba(0,0,0,0.4) 50%,
    rgba(0,0,0,0.15) 100%
  );
}

/* Content layer — always pinned to bottom */
.hhpfb-cat-card__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25rem;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* Title */
.hhpfb-cat-card__title {
  font-family: 'Oswald', 'Impact', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.25rem;
  line-height: 1.2;
  color: #fff;
}

/* Brands line (reveal on hover) */
.hhpfb-cat-card__brands {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  margin: 0 0 0.6rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

.hhpfb-cat-card:hover .hhpfb-cat-card__brands {
  max-height: 3em;
  opacity: 1;
}

/* Footer: CTA + count */
.hhpfb-cat-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* CTA link */
.hhpfb-cat-card__cta {
  font-family: 'Oswald', 'Impact', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #FEDD00;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.3s ease;
}

.hhpfb-cat-card:hover .hhpfb-cat-card__cta {
  opacity: 1;
  transform: translateY(0);
}

.hhpfb-cat-card__cta svg {
  transition: transform 0.2s ease;
}

.hhpfb-cat-card:hover .hhpfb-cat-card__cta svg {
  transform: translateX(3px);
}

/* Product count */
.hhpfb-cat-card__count {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hhpfb-cat-card:hover .hhpfb-cat-card__count {
  opacity: 1;
}

/* Yellow accent bar */
.hhpfb-cat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #FEDD00;
  z-index: 2;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hhpfb-cat-card:hover::after {
  transform: scaleX(1);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .hhpfb-cats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .hhpfb-cats-grid { grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .hhpfb-cat-card { aspect-ratio: 4/3; }
  .hhpfb-cat-card__content { padding: 1rem; }
  .hhpfb-cat-card__title { font-size: 1rem; }
  /* Always show details on touch devices */
  .hhpfb-cat-card__brands { max-height: 3em; opacity: 1; }
  .hhpfb-cat-card__cta { opacity: 1; transform: none; }
  .hhpfb-cat-card__count { opacity: 1; }
}

@media (max-width: 480px) {
  .hhpfb-cats-grid { grid-template-columns: 1fr; gap: 3px; }
  .hhpfb-cat-card { aspect-ratio: 16/9; }
  .hhpfb-cat-card__title { font-size: 1.1rem; }
  .hhpfb-cat-card__brands { font-size: 0.78rem; }
}
