:root {
  --bg-dark: #0b0b0d;
  --text: #f5f7fb;
  --panel: #151d28;
  --card-bg: #1a1a1e;
  --accent: #ffcc00;
  --accent-rgb: 255, 204, 0;
  --muted-2: #9aa4b2;
  --gold: #ffcc00;
  --radius-lg: 14px;
  --gap-lg: 2rem;
  --img-w: 300px;
  --img-h: 250px;
}

.catalog {
  padding: 4rem 0;
}

.catalog-title {
  margin: 0 0 2rem;
  color: var(--text);
  font-weight: 700;
  font-size: 2.5rem;
  text-align: center;
}

.catalog-grid {
  display: grid;
  gap: var(--gap-lg);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  align-items: stretch;
  justify-content: center;
}

/* Custom Styles for Product Cards in Catalog */
.catalog .card {
  padding: 1rem;
  background: var(--panel);
}

.product-img-container {
  background: #e9ecef;
  /* Light grey background for image frame */
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 250px;
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.product-img-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  /* Helps blend white-background images with light container */
  transition: transform 0.3s ease;
}

.card:hover .product-img-container img {
  transform: scale(1.08);
}

.product-info {
  padding: 0 0.5rem;
}

.product-info h4 {
  margin: 0;
  color: var(--accent) !important;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}

.product-info p {
  margin: 0.5rem 0 1rem;
  color: var(--muted-2);
  font-size: 1.2rem;
  font-weight: 600;
}

.category-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 15px 60px rgba(0, 0, 0, 0.6);
  transition: transform .4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow .3s ease, border-color .3s ease, background-color .3s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.category-card a {
  text-decoration: none;
  color: inherit;
  width: 100%;
}

.category-card .img-wrap {
  width: var(--img-w);
  height: var(--img-h);
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 15px 40px rgba(0, 0, 0, 0.3);
  transition: transform .3s ease;
  padding: 1rem;
}

.category-card .img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .4s ease, filter .3s ease;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.category-card .title {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 1.5rem 0 0.5rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  transition: transform .3s ease;
}

.category-card .meta {
  margin-top: 0.5rem;
  color: var(--muted-2);
  font-size: 1.1rem;
  font-weight: 500;
  transition: transform .3s ease;
}

.category-card .count {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--gold);
  color: #0b0b0b;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 1rem;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.category-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
  border-color: var(--accent);
}

.category-card:before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(var(--accent-rgb), 0.1) 0%, transparent 40%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 0;
}

.category-card:hover:before {
  opacity: 1;
}

.category-card:hover .title,
.category-card:hover .meta {
  transform: translateY(-4px);
}

.category-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

@media (max-width:1200px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width:900px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  :root {
    --img-w: 250px;
    --img-h: 200px;
  }
}

@media (max-width:560px) {
  .category-card {
    padding: 1.5rem;
  }

  :root {
    --img-w: 200px;
    --img-h: 150px;
  }
}