/**
 * Hahne – category landing pages (hero, intro, product grid)
 * Used by: pages/category-page.html, Custom HTML blocks, or enqueue in theme.
 * WordPress: wp_enqueue_style( ..., get_stylesheet_directory_uri() . '/css/product-category.css' );
 */

/* Standalone preview: body > .hn-category-page only (not typical WP wrapper) */
body:has(> .hn-category-page) {
  margin: 0;
  padding: 0;
}

:root {
  --hahne-red:   #E60012;
  --hahne-black: #000000;
  --hahne-white: #ffffff;
  --hn-border:   #e8e8e8;
  --hn-light:    #f5f5f5;
  --hn-grey-bg:  #f1f1f1;
  --hn-text:     #333333;
  --hn-max:      1920px;
}

.hn-category-page,
.hn-category-page * {
  box-sizing: border-box;
}

.hn-category-page {
  width: 100%;
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--hn-text);
  background: var(--hahne-white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ----- Hero ----- */
.hn-cat-hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  padding: 48px 100px 56px;
}

.hn-cat-hero__bg {
  position: absolute;
  inset: 0;
  background-color: #444;
  background-image: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.35),
      rgba(0, 0, 0, 0.5)
    ),
    url("https://hahne.in/wp-content/uploads/2026/02/Pro-Banner.webp");
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hn-cat-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--hn-max);
  margin: 0 auto;
}

.hn-cat-hero__title {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  color: var(--hahne-white);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 18ch;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

/* ----- Category description ----- */
.hn-cat-intro {
  background: var(--hahne-white);
  padding: 48px 100px 32px;
}

.hn-cat-intro__inner {
  max-width: var(--hn-max);
  margin: 0 auto;
}

.hn-cat-intro__text {
  margin: 0;
  font-size: 18px;
  line-height: 1.8;
  color: var(--hahne-black);
}

.hn-cat-intro__text strong {
  font-weight: 700;
}

/* ----- Section title + grid ----- */
.hn-cat-products {
  background: var(--hahne-white);
  padding: 8px 100px 72px;
}

.hn-cat-products__inner {
  max-width: var(--hn-max);
  margin: 0 auto;
}

.hn-cat-section-title {
  margin: 0 0 32px;
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 700;
  color: var(--hahne-black);
  line-height: 1.15;
}

/* Product grid: 2–6 items — fluid columns, max ~3 on wide screens */
.hn-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 40px;
}

.hn-cat-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--hahne-white);
  border: 1px solid var(--hn-border);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hn-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.hn-cat-card__media {
  aspect-ratio: 4 / 3;
  background: var(--hn-grey-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hn-cat-card__media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.hn-cat-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 16px;
  background: var(--hahne-red);
  color: var(--hahne-white);
  min-height: 56px;
}

.hn-cat-card__name {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1;
  color: var(--hahne-white);
}

.hn-cat-card__arrow {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hahne-red);
  opacity: 0.98;
}

.hn-cat-card__arrow svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Hidden SVG defs for <use href="#…"> (category-page.html) */
.hn-cat-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.hn-cat-card__sub {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.9;
  margin-top: 4px;
}

/* ============================================
   TABLET
   ============================================ */
@media (max-width: 1024px) {
  .hn-cat-hero {
    min-height: 320px;
    padding: 40px 5% 44px;
  }

  .hn-cat-intro {
    padding: 40px 5% 28px;
  }

  .hn-cat-intro__text {
    font-size: 17px;
  }

  .hn-cat-products {
    padding: 4px 5% 56px;
  }

  .hn-cat-grid {
    gap: 40px;
  }
}

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 768px) {
  .hn-cat-hero {
    min-height: 260px;
    padding: 32px 5% 36px;
    align-items: center;
  }

  .hn-cat-hero__title {
    max-width: 100%;
  }

  .hn-cat-intro {
    padding: 32px 5% 24px;
  }

  .hn-cat-intro__text {
    font-size: 16px;
    line-height: 1.75;
  }

  .hn-cat-products {
    padding: 0 5% 48px;
  }

  .hn-cat-section-title {
    margin-bottom: 24px;
  }

  .hn-cat-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hn-cat-card__footer {
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .hn-cat-hero {
    min-height: 220px;
    padding: 24px 5% 28px;
  }

  .hn-cat-card__arrow {
    width: 24px;
    height: 24px;
  }
}

/* WordPress: full bleed inside content column */
.site-content .hn-category-page,
.entry-content .hn-category-page,
.wp-block-html .hn-category-page {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
}
