:root {
  --hub-gap: 16px;
}

.page-hub .card {
  border-radius: 4px;
  min-width: 0;
  max-width: 100%;
}

.hub-hero {
  padding: 20px;
  background: linear-gradient(180deg, rgba(8, 145, 178, 0.08), rgba(255, 255, 255, 0));
}

.hub-hero--catalog {
  padding: var(--space-md) 0 var(--space-xl);
  margin: 0 0 var(--space-lg);
  background: none;
  border-bottom: 1px solid var(--b, #e2e8f0);
}

.hub-hero--catalog .hub-hero__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  width: 100%;
}

@media (min-width: 700px) {
  .hub-hero--catalog.hub-hero--has-media .hub-hero__body {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-xl);
  }
}

.hub-hero--catalog .hub-hero__copy {
  flex: 1 1 auto;
  min-width: 0;
}

.hub-hero.hub-hero--catalog .hub-hero__title {
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hub-hero.hub-hero--catalog .hub-hero__lead {
  margin: 0;
  max-width: none;
  color: var(--m, #64748b);
  font-size: var(--text-md, 1.125rem);
  line-height: var(--leading-relaxed, 1.75);
}

.hub-hero--catalog .hub-hero__media {
  flex: 0 0 auto;
  width: min(13rem, 42vw);
  background: transparent;
}

.hub-hero--catalog .hub-hero__media picture {
  display: block;
  width: 100%;
  background: transparent;
}

.hub-hero--catalog .hub-hero__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 13rem;
  object-fit: contain;
  object-position: center;
  background: transparent;
  mix-blend-mode: multiply;
}

.hub-hero__inner {
  display: grid;
  gap: 18px;
}

.hub-hero__content,
.hub-hero__panel,
.hub-hero__ctas {
  min-width: 0;
}

.hub-hero__kicker {
  margin: 0 0 8px;
}

.hub-hero__title {
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.hub-hero__lead {
  margin: 0;
  max-width: 70ch;
}

.hub-hero__ctas {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.hub-hero__ctas .btn {
  width: 100%;
  flex: 0 0 auto;
  white-space: normal;
  text-align: center;
  justify-content: center;
}

@media (min-width: 920px) {
  .hub-hero__inner {
    grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.65fr);
    grid-template-areas:
      "content panel"
      "ctas ctas";
    align-items: start;
    gap: 16px 22px;
  }

  .hub-hero__content {
    grid-area: content;
  }

  .hub-hero__panel {
    grid-area: panel;
  }

  .hub-hero__ctas {
    grid-area: ctas;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: stretch;
  }

  .hub-hero__ctas .btn {
    width: auto;
    flex: 0 1 auto;
    white-space: nowrap;
  }
}

.hub-hero__panel {
  background: rgba(17, 24, 39, 0.03);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 4px;
  padding: 14px;
}

.hub-hero__panel-title {
  margin: 0 0 10px;
  font-size: 14px;
}

.hub-hero__panel-list {
  margin: 0 0 10px;
  padding-left: 18px;
  color: rgba(17, 24, 39, 0.75);
}

.hub-section {
  margin-top: 18px;
}

.hub-section__head {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
}

.hub-section__title {
  margin: 0;
}

.hub-section__sub {
  margin: 0;
}

/* Mobile : 2 colonnes. Dès 640 px, auto-fill reprend (min ~240 / 280 px). */
.hub-grid {
  display: grid;
  gap: var(--hub-gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .hub-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  }
}

@media (min-width: 900px) {
  .hub-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  }
}

.hub-card-wrap {
  min-width: 0;
}

.hub-card-wrap .hub-card {
  height: 100%;
}

.hub-grid--secondary .hub-card__media {
  aspect-ratio: 16 / 9;
}

.hub-card--secondary {
  background: rgba(255, 255, 255, 0.96);
}

/* Chaque carte devient son propre conteneur : le layout interne répond
   à la largeur réelle de la cellule de grille, pas au viewport. */
.hub-card {
  display: grid;
  grid-template-rows: auto 1fr;
  text-decoration: none;
  color: inherit;
  border-radius: var(--product-card-radius, var(--r, 4px));
  overflow: hidden;
  border: 1px solid var(--b, #E2E8F0);
  background: #fff;
  transition: border-color .12s ease;
  container-type: inline-size;
  container-name: hubcard;
}

.hub-card:hover {
  border-color: color-mix(in srgb, var(--p, #111827) 22%, var(--b, #E2E8F0));
}

.product-card.hub-card {
  display: grid;
}

.product-card.hub-card .hub-card__media {
  border-bottom: none;
}

.hub-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #fff;
  overflow: hidden;
  contain: paint;
  min-height: 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
}

.hub-card__media picture {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: clamp(0.7rem, 2.4vw, 1.15rem);
  box-sizing: border-box;
}

.hub-card__img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  display: block;
}

.hub-card__placeholder {
  width: 52%;
  height: 52%;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.25), rgba(226, 89, 60, 0.14));
}

.hub-card__body {
  padding: 14px 14px 16px;
  display: grid;
  gap: 8px;
}

.hub-card__title {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.hub-card__meta {
  margin: 0;
}

.hub-help {
  padding: 18px;
}

.hub-help__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.hub-seo {
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

.hub-seo__head {
  margin-bottom: var(--space-lg);
}

.hub-seo__lead {
  margin: 0;
  max-width: 65ch;
  line-height: 1.65;
}

.hub-seo__block + .hub-seo__block {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.hub-seo__block-title {
  margin: 0 0 var(--space-sm);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--p);
  line-height: 1.5;
}

.hub-seo__para {
  margin: 0 0 var(--space-md);
  max-width: 72ch;
  line-height: 1.7;
}

.hub-seo__para:last-child {
  margin-bottom: 0;
}

.hub-seo__para a {
  font-weight: 600;
  color: var(--a);
}

/* —— Tableaux comparatifs décisionnels (hubs PVC / RFID) —— */
.hub-compare {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.hub-compare__head {
  margin-bottom: var(--space-md);
}

.hub-compare__table-wrap {
  margin: 0;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius-md, 10px);
  overflow-x: auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.hub-compare__table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.hub-compare__table th,
.hub-compare__table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.hub-compare__table thead th {
  background: rgba(8, 145, 178, 0.08);
  color: var(--p);
  font-weight: 700;
  font-size: 0.875rem;
}

.hub-compare__table tbody tr:last-child td {
  border-bottom: none;
}

.hub-compare__table tbody td:first-child {
  font-weight: 600;
  color: var(--p);
  min-width: 7rem;
}

/* Adaptations internes de la carte selon SA propre largeur (pas le viewport).
   En cross-sell ou aside (~220px) : titre plus petit, padding réduit.
   En grille principale (≥ 320px) : titre confortable. */
@container hubcard (max-width: 260px) {
  .hub-card__body {
    padding: 10px 12px 12px;
    gap: 6px;
  }
  .hub-card__title {
    font-size: 14px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hub-card__meta {
    font-size: 0.8rem;
  }
}

@container hubcard (max-width: 200px) {
  .hub-card__media {
    padding: 0.55rem;
    aspect-ratio: 1;
  }
  .hub-card__meta {
    display: none;
  }
}

@container hubcard (min-width: 360px) {
  .hub-card__body {
    padding: 16px 18px 20px;
  }
  .hub-card__title {
    font-size: 17px;
  }
}

/* —— Hub accessoires : cartes sous-catégories —— */
.page-hub--accessoires .hub-section--subcategories {
  margin-top: 24px;
}

.page-hub--accessoires .hub-section__head--subcats {
  margin-bottom: 20px;
}

.accessory-universe {
  --universe-color: var(--a, #0891b2);
  padding-top: clamp(1.25rem, 3vw, 1.75rem);
  border-top: 1px solid color-mix(in srgb, var(--universe-color) 28%, transparent);
  scroll-margin-top: 8rem;
}

.accessory-universe + .accessory-universe {
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.accessory-universe--printing {
  --universe-color: var(--w, #d97706);
}

.accessory-universe--rfid-access {
  --universe-color: var(--a, #0891b2);
}

.accessory-universe--badge-accessories {
  --universe-color: var(--s, #059669);
}

.accessory-universe__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.accessory-universe__title {
  margin: 0;
  color: var(--p, #111827);
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.accessory-universe__description {
  max-width: 65ch;
  margin: 0.35rem 0 0;
  color: rgba(17, 24, 39, 0.7);
  line-height: 1.55;
  text-wrap: pretty;
}

.accessory-universe__count {
  flex: 0 0 auto;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--universe-color) 10%, white);
  color: color-mix(in srgb, var(--universe-color) 78%, #111827);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.accessory-subcat-grid {
  display: grid;
  gap: clamp(0.75rem, 2.5vw, 1.75rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 700px) {
  .accessory-subcat-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  }
}

.accessory-subcat-card {
  min-width: 0;
  height: 100%;
}

.accessory-subcat-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.accessory-subcat-card__media {
  border: none;
  border-radius: 0;
}

.accessory-subcat-card__title {
  font-size: 0.95rem;
}

.accessory-subcat-card__link:hover .accessory-subcat-card__title,
.accessory-subcat-card__link:focus-visible .accessory-subcat-card__title {
  color: var(--p, #111827);
}

.accessory-subcat-card__desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--m, #64748B);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.accessory-subcat-card__meta {
  margin-top: auto;
  padding-top: 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--m, #64748B);
  letter-spacing: 0.01em;
}

@media (max-width: 639px) {
  .accessory-subcat-card .product-card__media {
    aspect-ratio: 1;
  }

  .accessory-subcat-card .product-card__media picture {
    padding: 0.55rem;
  }

  .accessory-subcat-card__title {
    font-size: 0.85rem;
  }
}

.accessory-subcat-card__link:focus-visible {
  outline: 2px solid var(--a, #0891B2);
  outline-offset: 3px;
  border-radius: var(--r, 4px);
}

@media (max-width: 639px) {
  .accessory-universe__head {
    display: grid;
  }

  .accessory-universe__count {
    justify-self: start;
  }
}

