/* Catalogue public /references + fiche produit */
#refApp {
  width: 100%;
  background: #fff;
}

.ref-page,
.ref-pdp {
  width: 100%;
  box-sizing: border-box;
  padding: calc(var(--nav-h, 76px) + 48px) 0 100px;
  background: #fff;
  min-height: calc(100vh - 180px);
}

.ref-wrap {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 2.2vw;
  box-sizing: border-box;
}

.ref-hero { margin-bottom: 28px; }
.ref-hero h1 {
  font-family: var(--font-head, Georgia, serif);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: var(--navy, #1e2d4a);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.ref-hero p {
  margin: 0;
  max-width: 70ch;
  color: #5c6578;
  line-height: 1.6;
  font-size: 15.5px;
}

/* Filtres au-dessus */
.ref-filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(6, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e8ef;
}
@media (max-width: 1100px) {
  .ref-filters { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 720px) {
  .ref-filters { grid-template-columns: 1fr 1fr; }
}
.ref-filters .ref-filter-item { min-width: 0; }
.ref-filters label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6b7280;
  margin: 0 0 5px;
}
.ref-filters select,
.ref-filters input[type="search"] {
  width: 100%;
  height: 42px;
  border: 1px solid #d8dde6;
  border-radius: 10px;
  padding: 0 10px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.ref-filters .ref-reset {
  height: 42px;
  border: 1px solid #d8dde6;
  background: #fff;
  border-radius: 10px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 650;
  color: var(--navy, #1e2d4a);
  white-space: nowrap;
}

.ref-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.ref-toolbar .muted { color: #6b7280; font-size: 13.5px; }
.ref-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.ref-toolbar select {
  height: 38px;
  border: 1px solid #d8dde6;
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
  font: inherit;
}

.ref-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px 16px;
  width: 100%;
}
@media (max-width: 1100px) { .ref-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .ref-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; } }

.ref-card {
  background: transparent;
  border: 0;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ref-card:hover .ref-card-title { color: var(--accent, #d0401a); }
.ref-card-media {
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  overflow: hidden;
  border-radius: 2px;
}
.ref-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.ref-card-body {
  padding: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ref-card-ref {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #8a93a5;
}
.ref-card-title {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.35;
  font-weight: 650;
  color: var(--navy, #1e2d4a);
}
.ref-card-meta { font-size: 12.5px; color: #6b7280; }
.ref-price-mask {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent, #d0401a);
}

.ref-pager {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.ref-pager a, .ref-pager span {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #d8dde6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--navy, #1e2d4a);
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
}
.ref-pager a:hover { border-color: var(--accent, #d0401a); color: var(--accent, #d0401a); }
.ref-pager .is-active {
  background: var(--navy, #1e2d4a);
  border-color: var(--navy, #1e2d4a);
  color: #fff;
}
.ref-pager .is-disabled { opacity: .45; pointer-events: none; }

.ref-empty, .ref-loading {
  padding: 56px 16px;
  text-align: center;
  color: #6b7280;
}

/* ===== PDP ===== */
.ref-breadcrumb {
  margin-bottom: 20px;
  font-size: 13px;
  color: #6b7280;
}
.ref-breadcrumb a { color: inherit; text-decoration: none; }
.ref-breadcrumb a:hover { color: var(--accent, #d0401a); }
.ref-breadcrumb span { margin: 0 6px; opacity: .5; }

.ref-pdp-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 36px;
  align-items: start;
}
.ref-pdp-media {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ref-pdp-main {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  overflow: hidden;
}
.ref-pdp-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.ref-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--navy, #1e2d4a);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .14);
  z-index: 2;
}
.ref-nav-btn:hover { background: #fff; }
.ref-nav-prev { left: 12px; }
.ref-nav-next { right: 12px; }
.ref-zoom-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--navy, #1e2d4a);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .14);
  z-index: 2;
}
.ref-zoom-btn:hover { background: #fff; }
.ref-zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 28, .88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ref-zoom-overlay[hidden] { display: none !important; }
.ref-zoom-overlay img {
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}
.ref-zoom-overlay .ref-nav-btn {
  position: fixed;
  top: 50%;
}
.ref-zoom-overlay .ref-nav-prev { left: 18px; }
.ref-zoom-overlay .ref-nav-next { right: 18px; }
.ref-zoom-close {
  position: fixed;
  top: 16px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .95);
  color: var(--navy, #1e2d4a);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 10000;
}
.ref-pdp-thumbs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.ref-pdp-thumbs button {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid #e5e8ef;
  padding: 0;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  opacity: .7;
}
.ref-pdp-thumbs button.is-active {
  opacity: 1;
  outline: 2px solid var(--accent, #d0401a);
  outline-offset: 2px;
}
.ref-pdp-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ref-pdp-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
}
.ref-pdp-info h1 {
  margin: 0 0 8px;
  font-family: var(--font-head, Georgia, serif);
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  color: var(--navy, #1e2d4a);
  line-height: 1.25;
}
.ref-pdp-sub { margin: 0 0 10px; color: #6b7280; font-size: 14px; }
.ref-pdp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: #6b7280;
}
.ref-pdp-badges span + span::before {
  content: '·';
  margin-right: 10px;
  color: #b0b6c2;
}
.ref-pdp-desc {
  margin: 0 0 12px;
}
.ref-pdp-copy {
  font-size: 14.5px;
  line-height: 1.65;
  color: #334155;
  margin: 0 0 12px;
}
.ref-pdp-copy-soft { color: #5c6578; font-size: 13.5px; }
.ref-pdp-block { margin: 0 0 18px; }
.ref-pdp-block h2,
.ref-pdp-block h3 {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy, #1e2d4a);
  font-weight: 700;
}
.ref-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-swatch {
  border: 1px solid #d8dde6;
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12.5px;
  cursor: pointer;
}
.ref-swatch.is-active {
  border-color: var(--accent, #d0401a);
  color: var(--accent, #d0401a);
  font-weight: 700;
}

.ref-cta-box {
  margin: 4px 0 18px;
  padding-top: 4px;
}
.ref-cta-box p {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #5c6578;
}
.ref-cta-box .row { display: flex; flex-wrap: wrap; gap: 10px; }
.ref-cta-box .ref-cta-primary,
.ref-cta-box .ref-cta-primary:link,
.ref-cta-box .ref-cta-primary:visited {
  background: var(--accent, #f05924);
  color: #fff !important;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
  box-shadow: none;
}
.ref-cta-box .ref-cta-primary:hover,
.ref-cta-box .ref-cta-primary:focus-visible {
  background: var(--accent-dark, #d44716);
  color: #fff !important;
}
.ref-cta-box .ref-cta-primary:active {
  background: #1e2d4a;
  color: #fff !important;
}
.ref-cta-box .ref-cta-secondary,
.ref-cta-box .ref-cta-secondary:link,
.ref-cta-box .ref-cta-secondary:visited {
  background: #fff;
  color: var(--navy, #1e2d4a) !important;
  border: 1.5px solid #1e2d4a;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
}
.ref-cta-box .ref-cta-secondary:hover,
.ref-cta-box .ref-cta-secondary:focus-visible {
  background: #1e2d4a;
  color: #fff !important;
  border-color: #1e2d4a;
}
.ref-cta-box .ref-cta-secondary:active {
  background: #152238;
  color: #fff !important;
  border-color: #152238;
}

.ref-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin: 0 0 8px;
}
.ref-benefit {
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.ref-benefit h3,
.ref-benefit h4 {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy, #1e2d4a);
  line-height: 1.3;
}
.ref-benefit p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #5c6578;
}
.ref-benefit-wide {
  grid-column: 1 / -1;
}

.ref-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 0; }
.ref-size {
  min-width: 42px;
  text-align: center;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12.5px;
  font-weight: 650;
  background: #fff;
}
.ref-guide-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.ref-guide-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.ref-guide-table-wrap th,
.ref-guide-table-wrap td {
  padding: 7px 8px;
  border-bottom: 1px solid #e8edf5;
  text-align: center;
  white-space: nowrap;
}
.ref-guide-table-wrap th:first-child,
.ref-guide-table-wrap td:first-child {
  text-align: left;
  font-weight: 650;
}

/* Accordéons (guide / stock / related / filtres) */
.ref-acc {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #e5e8ef;
}
.ref-acc > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy, #1e2d4a);
  padding: 4px 0 12px;
  user-select: none;
}
.ref-acc > summary > h2 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  line-height: inherit;
}
.ref-acc > summary::-webkit-details-marker { display: none; }
.ref-acc > summary::after {
  content: '+';
  width: 1.1em;
  height: 1.1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  flex: 0 0 auto;
  opacity: .7;
  transition: transform .15s ease;
}
.ref-acc[open] > summary::after {
  content: '-';
}
.ref-acc-body { padding-bottom: 4px; }

.ref-related {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 16px;
}

/* Filtres : résumé burger sur mobile/tablette */
.ref-filters-acc {
  margin-bottom: 18px;
  border-bottom: 1px solid #e5e8ef;
  padding-bottom: 8px;
}
.ref-filters-summary {
  list-style: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: var(--navy, #1e2d4a);
  padding: 10px 0;
  user-select: none;
}
.ref-filters-summary::-webkit-details-marker { display: none; }
.ref-filters-summary::after {
  content: '+';
  width: 1.1em;
  height: 1.1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  opacity: .7;
}
.ref-filters-acc[open] > .ref-filters-summary::after {
  content: '-';
}
.ref-filters-acc .ref-filters {
  border-bottom: 0;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

@media (max-width: 1100px) {
  .ref-related { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .ref-pdp {
    padding: calc(var(--nav-h, 76px) + 28px) 0 72px;
  }
  .ref-pdp-top { grid-template-columns: 1fr; gap: 18px; }
  .ref-pdp-info { min-height: 0; }
  .ref-cta-box {
    margin: 10px 0 16px;
    position: sticky;
    bottom: 12px;
    background: #fff;
    padding: 10px 0 4px;
    z-index: 2;
  }
  .ref-cta-box .row { flex-direction: column; }
  .ref-cta-box .row a { width: 100%; justify-content: center; box-sizing: border-box; }
  .ref-benefits { grid-template-columns: 1fr; gap: 12px; }
  .ref-benefit-wide { grid-column: auto; }
  .ref-nav-btn { width: 36px; height: 36px; font-size: 24px; }
  .ref-nav-prev { left: 8px; }
  .ref-nav-next { right: 8px; }
  .ref-zoom-btn { width: 36px; height: 36px; top: 8px; right: 8px; }
  .ref-pdp-thumbs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    grid-template-columns: none;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .ref-pdp-thumbs button {
    flex: 0 0 72px;
    width: 72px;
  }
  .ref-related { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 10px; }
  .ref-filters-summary { display: flex; }
  .ref-filters-acc:not([open]) .ref-filters { display: none; }
  .ref-acc > summary {
    font-size: 1rem;
    padding: 12px 0;
    border-bottom: 1px solid #e8edf5;
  }
  .ref-acc[open] > summary { border-bottom: 0; }
}
@media (max-width: 720px) {
  .ref-wrap { padding: 0 4.5vw; }
  .ref-pdp-main { aspect-ratio: 1 / 1.05; }
  .ref-pdp-info h1 { font-size: 1.35rem; }
  .ref-page { padding: calc(var(--nav-h, 76px) + 28px) 0 72px; }
}

/* Skeleton PDP : perception de vitesse au hard refresh */
.ref-skeleton {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 36px;
  align-items: start;
}
@media (max-width: 900px) {
  .ref-skeleton { grid-template-columns: 1fr; gap: 18px; }
}
.ref-skeleton-media {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(90deg, #f3f5f8 25%, #e9eef5 37%, #f3f5f8 63%);
  background-size: 400% 100%;
  animation: refShimmer 1.1s ease-in-out infinite;
}
.ref-skeleton-info { padding-top: 6px; }
.ref-skeleton-line {
  height: 14px;
  border-radius: 6px;
  margin: 0 0 12px;
  background: linear-gradient(90deg, #f3f5f8 25%, #e9eef5 37%, #f3f5f8 63%);
  background-size: 400% 100%;
  animation: refShimmer 1.1s ease-in-out infinite;
}
.ref-skeleton-line.w40 { width: 40%; }
.ref-skeleton-line.w50 { width: 50%; }
.ref-skeleton-line.w60 { width: 60%; }
.ref-skeleton-line.w80 { width: 80%; }
.ref-skeleton .ref-loading { margin: 18px 0 0; text-align: left; }
@keyframes refShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.ref-price {
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy, #1e2d4a);
}
.ref-price-line {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--navy, #1e2d4a);
}
.ref-price-line strong { font-size: 1.15em; }
