/* ==================== Hero Banner ==================== */
.category-hero-banner {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.category-hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.category-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.category-hero-content h1 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.category-hero-desc {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  max-width: 700px;
  margin: 0 auto 32px;
}

@media (max-width: 768px) {
  .category-hero-banner {
    height: 100svh;
    height: 100dvh;
    min-height: 480px;
  }
  .category-hero-img {
    object-position: top center;
  }
}

/* ==================== Page Body ==================== */
.category-page-wrap {
  padding: 60px 0 80px;
  background-color: var(--light-cream);
  min-height: 60vh;
}

/* Search bar (sits inside the hero, over the image) */
.subcat-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  padding: 14px 20px;
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.subcat-search input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  width: 100%;
  color: var(--dark);
}

/* ==================== Toolbar (below hero, just shows count) ==================== */
.subcat-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.subcat-count {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ==================== Subcategory Grid ==================== */
.subcat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}

@media (max-width: 1100px) {
  .subcat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .subcat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .subcat-grid { grid-template-columns: 1fr; }
}

.subcat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 26px 22px;
  box-shadow:
    -6px 8px 24px rgba(23, 19, 15, 0.04),
    -2px 3px 8px rgba(23, 19, 15, 0.02);
  border-top: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.subcat-card:hover {
  transform: translateY(-5px);
  box-shadow:
    -10px 14px 28px rgba(23, 19, 15, 0.08),
    -3px 4px 10px rgba(23, 19, 15, 0.04);
}

.subcat-card-img {
  width: 100%;
  height: 140px;
  background: #fff;
  margin-bottom: 16px;
}

.subcat-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.subcat-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--dark);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.3;
  text-align: center;
}


.subcat-card .subcat-product-count {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 18px;
  text-align: center;
}

.subcat-card .subcat-view-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  background-color: var(--brown);
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.subcat-card:hover .subcat-view-link {
  background-color: var(--dark);
}

.no-results {
  text-align: center;
  color: var(--muted);
  font-family: var(--font-body);
  padding: 40px 0;
  font-size: 1rem;
}

/* Inline product list used by the construction shuttering category page */
.subcat-card.selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.category-product-section {
  margin-top: 42px;
  padding: 28px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(23, 19, 15, 0.07);
  scroll-margin-top: 100px;
}

.category-product-section[hidden] { display: none; }

.category-product-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.category-product-heading h2 {
  margin: 0;
  color: var(--dark);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
}

.category-product-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--light-cream);
  color: var(--dark);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.category-product-table-wrap { overflow-x: auto; }

.category-product-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--dark);
  font-family: var(--font-body);
}

.category-product-table th,
.category-product-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(40, 32, 24, 0.1);
  text-align: left;
  vertical-align: top;
}

.category-product-table th:first-child,
.category-product-table td:first-child { width: 240px; }

.category-product-glimpse,
.category-product-glimpse-placeholder {
  display: block;
  width: 220px;
  height: 140px;
  border: none;
  border-radius: 10px;
  background: transparent;
}

/* Image shrinks to its own size, so the radius sits on the image itself */
.category-product-glimpse {
  width: auto;
  height: auto;
  max-width: 220px;
  max-height: 140px;
  object-fit: contain;
}

/* Placeholder keeps a light fill since it has no image */
.category-product-glimpse-placeholder { background: var(--light-cream); }
.category-product-table th {
  background: var(--light-cream);
  color: var(--brown);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.category-product-empty {
  margin: 0;
  padding: 28px 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 600px) {
  .category-product-section { padding: 20px 14px; }
  .category-product-table th,
  .category-product-table td { padding: 11px 10px; font-size: 0.88rem; }
  .category-product-table th:first-child,
  .category-product-table td:first-child { width: 170px; }
    .category-product-glimpse-placeholder { width: 160px; height: 104px; }
  .category-product-glimpse { max-width: 160px; max-height: 104px; }
}
