/*!
 * TGA Metal — Category Page Polish
 * Target: moderne.html, traditionelle.html (and other single-category pages)
 * Scope: body.category-page to avoid leaks
 */

/* ==========================================================================
   0. DESIGN TOKENS (shared with produkte-polish / kontakt-polish)
   ========================================================================== */

.category-page {
  --cp-brand: #1C3957;
  --cp-brand-600: #2461a3;
  --cp-brand-50: #F0F5FB;
  --cp-ink: #1C3957;
  --cp-muted: #5E6478;
  --cp-line: #E1E8F0;
  --cp-bg: #F8FAFC;
  --cp-accent: #3d82c7;
  --cp-shadow-sm: 0 2px 8px -3px rgba(28, 57, 87, .08);
  --cp-shadow-md: 0 14px 40px -22px rgba(28, 57, 87, .22);
  --cp-shadow-lg: 0 24px 60px -30px rgba(28, 57, 87, .3);
}

/* ==========================================================================
   1. BREADCRUMB
   ========================================================================== */

.category-page nav[aria-label="Breadcrumb"] {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 24px 4px !important;
  font-size: 13px;
  color: #8E97A5;
}

@media (min-width: 768px) {
  .category-page nav[aria-label="Breadcrumb"] {
    padding: 22px 32px 4px !important;
  }
}

@media (min-width: 1024px) {
  .category-page nav[aria-label="Breadcrumb"] {
    padding: 24px 64px 4px !important;
  }
}

.category-page nav[aria-label="Breadcrumb"] ol {
  gap: 6px;
}

.category-page nav[aria-label="Breadcrumb"] a {
  color: #8E97A5;
  transition: color .15s ease;
}

.category-page nav[aria-label="Breadcrumb"] a:hover {
  color: var(--cp-brand);
}

.category-page nav[aria-label="Breadcrumb"] li[aria-current="page"] {
  color: var(--cp-brand);
  font-weight: 600;
}

.category-page nav[aria-label="Breadcrumb"] li[aria-current="page"]::before {
  color: #C4CAD6;
  margin: 0 6px !important;
}

/* ==========================================================================
   2. HERO SECTION
   ========================================================================== */

.cat-hero {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 36px;
  text-align: center;
  overflow: hidden;
}

@media (min-width: 768px) {
  .cat-hero {
    padding: 32px 32px 48px;
  }
}

@media (min-width: 1024px) {
  .cat-hero {
    padding: 40px 64px 64px;
  }
}

/* Soft background glow */
.cat-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 720px;
  max-width: 100%;
  height: 320px;
  background: radial-gradient(ellipse at center top,
    rgba(61, 130, 199, .10) 0%,
    rgba(36, 97, 163, .04) 40%,
    transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.cat-hero > * {
  position: relative;
  z-index: 1;
}

/* Top row: back button + view toggle (desktop) */
.cat-hero-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.cat-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 10px;
  background: #ffffff;
  color: var(--cp-brand);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--cp-line);
  border-radius: 999px;
  box-shadow: var(--cp-shadow-sm);
  transition: all .18s ease;
}

.cat-hero-back:hover {
  border-color: var(--cp-brand-600);
  color: var(--cp-brand-600);
  transform: translateX(-2px);
  box-shadow: 0 6px 18px -10px rgba(36, 97, 163, .3);
}

.cat-hero-back svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* View toggle — a little chip style */
.cat-hero-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--cp-line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--cp-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: var(--cp-shadow-sm);
}

/* Eyebrow pill */
.cat-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 12px;
  background: linear-gradient(135deg, #F0F5FB 0%, #EAF1FA 100%);
  border: 1px solid rgba(36, 97, 163, .18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cp-brand);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 18px;
  box-shadow: var(--cp-shadow-sm);
}

.cat-hero-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cp-brand-600);
  animation: cpPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes cpPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: .55; }
}

/* Big H1 — override default small tracking heading */
.category-page .cat-hero h1 {
  font-size: clamp(32px, 5vw, 52px) !important;
  line-height: 1.08 !important;
  letter-spacing: -.015em !important;
  color: var(--cp-ink) !important;
  font-weight: 700 !important;
  margin: 0 auto 14px !important;
  max-width: 18ch !important;
  text-transform: none !important;
  text-align: center !important;
  display: block !important;
}

.category-page .cat-hero h1 .cp-accent {
  background: linear-gradient(135deg, var(--cp-brand-600) 0%, var(--cp-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 800;
}

.category-page .cat-hero h1 .cp-upper {
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 400;
  color: var(--cp-muted);
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
  letter-spacing: .16em;
}

/* Subtitle */
.cat-hero-sub {
  max-width: 56ch;
  margin: 0 auto 24px;
  font-size: clamp(14.5px, 1.4vw, 16.5px);
  line-height: 1.65;
  color: var(--cp-muted);
}

/* Meta chips row */
.cat-hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 24px;
  padding: 0;
  list-style: none;
}

.cat-hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 13px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--cp-line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cp-brand);
  letter-spacing: .01em;
  box-shadow: var(--cp-shadow-sm);
  transition: all .18s ease;
}

.cat-hero-meta li:hover {
  transform: translateY(-2px);
  border-color: var(--cp-brand-600);
  box-shadow: 0 8px 20px -10px rgba(36, 97, 163, .3);
}

.cat-hero-meta li svg {
  width: 16px;
  height: 16px;
  color: var(--cp-brand-600);
  flex-shrink: 0;
}

.cat-hero-meta li strong {
  font-weight: 700;
  color: var(--cp-brand);
}

.cat-hero-meta li span {
  color: var(--cp-muted);
  font-weight: 500;
}

/* Hide the original bare H1 block once we have the rich hero */
.category-page .cat-hero-legacy {
  display: none !important;
}

/* ==========================================================================
   3. PRODUCT CARD GRID (single-category — both Splide and Grid views)
   ========================================================================== */

/* Splide slider cards */
.category-page .splide__slide > .bg-white {
  border: 1px solid var(--cp-line);
  border-radius: 8px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  box-shadow: var(--cp-shadow-sm);
}

.category-page .splide__slide > .bg-white:hover {
  transform: translateY(-4px);
  box-shadow: var(--cp-shadow-md);
  border-color: #CAD7E6;
}

.category-page .splide__slide > .bg-white > a {
  padding: 10px 0 6px;
}

.category-page .splide__slide .text-\[\#8A94A6\] {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--cp-brand-600) !important;
}

/* Grid view */
.category-page [id*="single-cat-"][id$="-grid"] {
  display: grid;
  gap: 18px;
  padding: 0;
}

@media (min-width: 640px) {
  .category-page [id*="single-cat-"][id$="-grid"] {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (min-width: 900px) {
  .category-page [id*="single-cat-"][id$="-grid"] {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1280px) {
  .category-page [id*="single-cat-"][id$="-grid"] {
    grid-template-columns: repeat(4, 1fr);
  }
}

.category-page [id*="single-cat-"][id$="-grid"] > * {
  background: #ffffff;
  border: 1px solid var(--cp-line);
  border-radius: 8px;
  padding: 14px 10px 10px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  box-shadow: var(--cp-shadow-sm);
}

.category-page [id*="single-cat-"][id$="-grid"] > *:hover {
  transform: translateY(-4px);
  box-shadow: var(--cp-shadow-md);
  border-color: #CAD7E6;
}

.category-page [id*="single-cat-"][id$="-grid"] > * .text-\[\#8A94A6\] {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--cp-brand-600) !important;
  font-size: 12px !important;
  text-transform: uppercase;
}

/* Image zoom on hover */
.category-page .splide__slide img,
.category-page [id*="single-cat-"][id$="-grid"] img {
  transition: transform .6s ease !important;
}

.category-page .splide__slide > .bg-white:hover img,
.category-page [id*="single-cat-"][id$="-grid"] > *:hover img {
  transform: scale(1.03);
}

/* Favorite button polish */
.category-page .tgametal-like-btn {
  padding: 8px 16px !important;
  border-radius: 999px !important;
  background: #F6FAFF !important;
  border: 1px solid var(--cp-line) !important;
  font-size: 12.5px !important;
  transition: all .18s ease !important;
  margin: 6px auto 0 !important;
}

/* Center the button — override grid card's "justify-between" container
   and splide's .cta wrapper */
.category-page [id*="single-cat-"] .flex.justify-between {
  justify-content: center !important;
}

.category-page [id*="single-cat-"] .cta {
  text-align: center !important;
  display: flex !important;
  justify-content: center !important;
}

/* Ensure button fills only its content width (not 100%) so auto margins work */
.category-page .tgametal-like-btn {
  width: auto !important;
  flex: 0 0 auto !important;
}

.category-page .tgametal-like-btn:hover {
  border-color: var(--cp-brand-600) !important;
  background: #EAF1FA !important;
  color: var(--cp-brand) !important;
}

.category-page .tgametal-like-btn[aria-pressed="true"] {
  background: var(--cp-brand) !important;
  border-color: var(--cp-brand) !important;
  color: #ffffff !important;
}

.category-page .tgametal-like-btn[aria-pressed="true"] svg {
  color: #ffffff !important;
}

.category-page .tgametal-like-btn[aria-pressed="true"] .icon-unliked {
  display: none;
}

/* View toggle buttons inside page (actual buttons) */
.category-page .js-view-btn {
  padding: 6px 10px !important;
  border-radius: 6px !important;
  border: 1px solid var(--cp-line);
  background: #ffffff;
  transition: all .15s ease;
}

.category-page .js-view-btn:hover {
  background: #F6FAFF;
  border-color: var(--cp-brand-600);
}

/* ==========================================================================
   4. "WEITERE ZÄUNE" SECTION
   ========================================================================== */

.category-page section h2 b {
  color: var(--cp-brand);
  font-weight: 700;
}

/* ==========================================================================
   5. "HABEN SIE IHRE EIGENE IDEE?" banner
   ========================================================================== */

.category-page .content-grid h2.uppercase,
.category-page section.content-grid h2 {
  letter-spacing: -.005em;
}

/* ==========================================================================
   6. SEO TEXT BLOCK (bottom card)
   ========================================================================== */

.category-page section.bg-\[\#F8FAFC\] {
  padding: 56px 24px !important;
  background: linear-gradient(180deg, #F8FAFC 0%, #EFF4FA 100%) !important;
  border-top: 1px solid var(--cp-line);
}

@media (min-width: 1024px) {
  .category-page section.bg-\[\#F8FAFC\] {
    padding: 80px 64px !important;
  }
}

.category-page section.bg-\[\#F8FAFC\] > .mx-auto {
  position: relative;
  max-width: 820px !important;
  padding: 40px 28px !important;
  background: #ffffff;
  border: 1px solid var(--cp-line);
  border-radius: 8px;
  box-shadow: var(--cp-shadow-md);
}

@media (min-width: 768px) {
  .category-page section.bg-\[\#F8FAFC\] > .mx-auto {
    padding: 48px 52px !important;
  }
}

.category-page section.bg-\[\#F8FAFC\] > .mx-auto::before {
  content: "";
  position: absolute;
  top: 0;
  left: 32px;
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--cp-brand-600), var(--cp-accent));
  border-radius: 0 0 3px 3px;
}

.category-page section.bg-\[\#F8FAFC\] > .mx-auto h2 {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--cp-brand) !important;
  margin-bottom: 18px !important;
  padding-left: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (min-width: 768px) {
  .category-page section.bg-\[\#F8FAFC\] > .mx-auto h2 {
    font-size: 26px !important;
  }
}

.category-page section.bg-\[\#F8FAFC\] > .mx-auto h2::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background: var(--cp-brand-50);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232461a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.category-page section.bg-\[\#F8FAFC\] > .mx-auto p {
  font-size: 15px;
  line-height: 1.75;
  color: #545A6D;
  margin: 0 0 14px;
}

.category-page section.bg-\[\#F8FAFC\] > .mx-auto strong,
.category-page section.bg-\[\#F8FAFC\] > .mx-auto b {
  color: var(--cp-brand);
  font-weight: 600;
}

/* ==========================================================================
   7. MOBILE REFINEMENTS
   ========================================================================== */

@media (max-width: 639px) {
  .cat-hero {
    padding: 20px 16px 28px;
  }

  .cat-hero-topbar {
    margin-bottom: 12px;
  }

  .cat-hero-toggle {
    padding: 5px 10px;
    font-size: 10px;
  }

  .cat-hero-eyebrow {
    font-size: 11px;
    padding: 6px 12px 6px 10px;
    letter-spacing: .06em;
  }

  .cat-hero-sub {
    font-size: 14.5px;
    margin-bottom: 18px;
  }

  .cat-hero-meta {
    gap: 8px;
    margin-top: 18px;
  }

  .cat-hero-meta li {
    padding: 7px 12px 7px 10px;
    font-size: 11.5px;
  }

  .category-page section.bg-\[\#F8FAFC\] > .mx-auto {
    padding: 28px 22px !important;
  }

  .category-page section.bg-\[\#F8FAFC\] > .mx-auto h2 {
    font-size: 18px !important;
    margin-bottom: 14px !important;
  }
}
