/* ============================================================================
   catalog-axis.css — styling for /catalog/<dimension>/<slug>/ axis pages.

   These pages are emitted by src/lib/d1-catalog-axis-handler.ts (and
   pre-rendered to dist/catalog/…/index.html by prerender-catalog-axes.mjs,
   which reuses the same handler template). That markup is built OUTSIDE the
   Astro component tree, so it never receives CatalogGrid.astro's Astro-scoped
   <style> (Astro rewrites those selectors to `.product-card[data-astro-cid-…]`,
   which cannot match hand-emitted HTML). Before this file the axis pages linked
   only modern-fpdb.css, so the cards rendered as bare, single-column <article>
   elements.

   The card/grid rules below are copied from CatalogGrid.astro's scoped block and
   the SKU panel from polish.css, then re-scoped under `.catalog-axis-page` (the
   axis <body> class) so nothing leaks to the rest of the site. This file is
   loaded ONLY by the axis handler.
   ========================================================================== */

/* ── Page shell ─────────────────────────────────────────────────────────── */
.catalog-axis-page .site-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Hero header ────────────────────────────────────────────────────────── */
.catalog-axis-page .catalog-axis-header {
  margin: 20px 0 24px;
  padding: 26px 30px;
  border-radius: 14px;
  background: linear-gradient(135deg, #162a42 0%, #1e3a5f 100%);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 36, 64, 0.06);
}

.catalog-axis-page .breadcrumb-nav { margin-bottom: 14px; }

.catalog-axis-page .breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
}

.catalog-axis-page .breadcrumb-list li:not(:last-child)::after {
  content: "›";
  margin-left: 6px;
  color: rgba(255, 255, 255, 0.45);
}

.catalog-axis-page .breadcrumb-list a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-axis-page .breadcrumb-list a:hover { color: #ffffff; text-decoration: underline; }
}

.catalog-axis-page .axis-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 8px;
  color: #ffffff;
}

.catalog-axis-page .axis-lead {
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 70ch;
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.82);
}

.catalog-axis-page .axis-meta-badge { display: flex; flex-wrap: wrap; gap: 8px; }

.catalog-axis-page .badge-count,
.catalog-axis-page .badge-source {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 5px 12px;
  border-radius: 999px;
}

.catalog-axis-page .badge-count { background: #f59e0b; color: #1a2b3c; }

.catalog-axis-page .badge-source {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e2e8f0;
}

/* ── Grid ───────────────────────────────────────────────────────────────── */
.catalog-axis-page .catalog-grid-main { margin-bottom: 40px; }

/* ── Two-column layout: left dimension-navigation sidebar + product grid ─── */
.catalog-axis-page .axis-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.catalog-axis-page .axis-sidebar {
  position: sticky;
  top: 84px; /* clears the 70px sticky header */
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}

.catalog-axis-page .axis-sidebar-back {
  display: inline-block;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  color: #0284c7;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-axis-page .axis-sidebar-back:hover { text-decoration: underline; }
}

.catalog-axis-page .axis-sidebar-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.catalog-axis-page .axis-sidebar-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.catalog-axis-page .axis-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.catalog-axis-page .axis-sidebar-list li { margin: 0; }

.catalog-axis-page .axis-sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-axis-page .axis-sidebar-link:hover { background: #f1f5f9; color: #0284c7; }
}

.catalog-axis-page .axis-sidebar-link.is-active {
  background: #e0f2fe;
  color: #0369a1;
}

.catalog-axis-page .axis-sidebar-tag {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-axis-page .axis-sidebar-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 7px;
  border-radius: 999px;
}

@media (max-width: 900px) {
  .catalog-axis-page .axis-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .catalog-axis-page .axis-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

.catalog-axis-page .product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

/* ── Product card ───────────────────────────────────────────────────────── */
.catalog-axis-page .product-card {
  display: flex;
  flex-direction: column;
  align-self: start;
  container-type: inline-size;
  content-visibility: auto;
  contain-intrinsic-size: auto 340px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(15, 36, 64, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-axis-page .product-card:hover {
    border-color: #c3ced9;
    box-shadow: 0 8px 20px rgba(15, 36, 64, 0.09);
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-axis-page .product-card { transition: none; }
  @media (hover: hover) and (pointer: fine) {
    .catalog-axis-page .product-card:hover { transform: none; }
  }
}

/* ── Header: badges + favourite ─────────────────────────────────────────── */
.catalog-axis-page .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.catalog-axis-page .card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.catalog-axis-page .badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.catalog-axis-page .badge.brand { background: #1a3a5c; color: #ffffff; }

.catalog-axis-page .badge.emission {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.catalog-axis-page .badge.emission.euro-4 {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.catalog-axis-page .badge.emission.euro-5 {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

.catalog-axis-page .card-favorite {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: #cbd5e1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-axis-page .card-favorite:hover { color: #e11d48; background: #fef2f2; }
}

/* ── SKU panel (navy card + amber top bar) ──────────────────────────────── */
.catalog-axis-page .card-sku-section {
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #162a42 0%, #1e3a5f 100%);
  border-radius: 10px;
}

.catalog-axis-page .card-sku-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.catalog-axis-page .sku-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 3px;
}

.catalog-axis-page .sku-link {
  display: inline-block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-axis-page .sku-link:hover { color: #fbbf24; }
}

/* ── Title ──────────────────────────────────────────────────────────────── */
.catalog-axis-page .card-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  height: calc(1.45em * 2);
  margin: 0 0 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-axis-page .card-title a {
  color: #334155;
  text-decoration: none;
  transition: color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-axis-page .card-title a:hover { color: #1a3a5c; }
}

/* ── Specs ──────────────────────────────────────────────────────────────── */
.catalog-axis-page .specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  padding: 11px 12px;
  margin-bottom: 10px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
}

.catalog-axis-page .spec-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.catalog-axis-page .spec-key {
  font-size: 9px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.catalog-axis-page .spec-val {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  overflow-wrap: anywhere;
}

.catalog-axis-page .spec-val.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
}

.catalog-axis-page a.spec-val.spec-link,
.catalog-axis-page .spec-val.spec-link {
  color: #1e293b;
  text-decoration: none;
  transition: color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-axis-page a.spec-val.spec-link:hover,
  .catalog-axis-page .spec-val.spec-link:hover { color: #2563eb; text-decoration: underline; }
}

.catalog-axis-page .badge-link {
  text-decoration: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-axis-page .badge-link:hover { transform: translateY(-1px); opacity: 0.9; }
}

@container (max-width: 300px) {
  .catalog-axis-page .specs-grid { grid-template-columns: 1fr; gap: 6px; padding: 10px 11px; }
  .catalog-axis-page .spec-key { font-size: 8.5px; }
  .catalog-axis-page .spec-val { font-size: 11.5px; }
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.catalog-axis-page .card-footer {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.catalog-axis-page .card-footer .btn-block {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ── Pagination ─────────────────────────────────────────────────────────── */
.catalog-axis-page .fpdb-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 28px 0 8px;
}

.catalog-axis-page .fpdb-page-numbers { display: flex; gap: 6px; }

.catalog-axis-page .fpdb-page-btn,
.catalog-axis-page .fpdb-page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-axis-page .fpdb-page-btn:hover,
  .catalog-axis-page .fpdb-page-num:hover { border-color: #c3ced9; }
}

.catalog-axis-page .fpdb-page-num.is-current {
  background: #1a3a5c;
  border-color: #1a3a5c;
  color: #ffffff;
}

.catalog-axis-page .fpdb-page-btn.is-disabled {
  color: #cbd5e1;
  background: #f8fafc;
  cursor: default;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .catalog-axis-page .product-grid { grid-template-columns: 1fr; }
  .catalog-axis-page .catalog-axis-header { padding: 22px 20px; }
  .catalog-axis-page .axis-title { font-size: 25px; }
}
