/* BroKanteur — composant unifié ShowcaseFurnitureImage / .furniture-frame
 * contain + objet centré, sans déformation, jamais object-fit: cover sur le meuble.
 */

:root {
  --furniture-frame-bg: #f5f1e8;
  --furniture-catalog-bg: #f5f1e8;
  --furniture-catalog-line: #111;
}

/* Les meubles de l'accueil flottent sur le fond de la page. */
[data-home-newest] {
  --furniture-frame-bg: transparent;
  --furniture-catalog-bg: transparent;
}

.furniture-frame,
.furniture-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--furniture-frame-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}

.furniture-frame__img,
.furniture-frame > img,
.furniture-card-image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  transform: none;
}

.furniture-frame--hero {
  aspect-ratio: 4 / 5;
  width: 100%;
  max-height: min(72vh, 520px);
  background: var(--furniture-frame-bg);
  border-radius: 16px;
}

.furniture-frame--gallery {
  aspect-ratio: 4 / 5;
  height: min(48vh, 380px);
  width: auto;
  max-width: 80vw;
  flex: 0 0 auto;
  border-radius: 16px;
  border: 1px solid #e6dac8;
}

.furniture-frame--gallery > img {
  background: var(--furniture-frame-bg);
}

.furniture-frame--gallery-terra,
.furniture-frame--gallery-terra > img {
  background: #c4956a;
}

.furniture-frame--gallery-terra {
  aspect-ratio: 4 / 5;
  width: 100%;
  max-width: none;
  height: auto;
  flex: 1 1 auto;
  border-radius: 16px;
  border: 1px solid #b8845a;
}

.furniture-frame--thumb {
  aspect-ratio: 1;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 2px solid #e6dac8;
}

.furniture-frame--compact {
  aspect-ratio: 4 / 3;
  width: 100px;
  height: 75px;
  flex-shrink: 0;
  border-radius: 10px;
}

.furniture-frame--card {
  aspect-ratio: 4 / 5;
  border-radius: 0;
}

.furniture-frame--card-catalog {
  aspect-ratio: 4 / 5;
  width: 100%;
  height: 100%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.furniture-frame--inline {
  aspect-ratio: 4 / 3;
  width: 140px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 12px;
}

.furniture-frame--slide {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: auto;
  min-height: 0;
  background: transparent;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  line-height: 0;
}

.furniture-frame--slide .furniture-frame__img,
.furniture-frame--slide > img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  background: transparent;
}

.furniture-frame--slide.furniture-frame--cover-bg {
  background: transparent;
}

/* Cadre épousant le ratio natif de l'image — pas de fond ni letterboxing */
.furniture-frame--intrinsic,
.furniture-frame--showcase-studio {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  max-width: 100%;
  overflow: hidden;
  border-radius: 16px;
  background: transparent;
  display: block;
  line-height: 0;
}

.furniture-frame--intrinsic > img,
.furniture-frame--intrinsic > .furniture-frame__img,
.furniture-frame--showcase-studio > img,
.furniture-frame--showcase-studio > .furniture-frame__img {
  position: static;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: unset;
  object-position: center center;
  display: block;
  background: transparent;
  transform: none;
}

@media (max-width: 640px) {
  .furniture-frame--hero {
    max-height: min(65vh, 440px);
  }
}

/* Swap face site ↔ face terracotta au survol */
.showcase-swap {
  position: relative;
  width: 100%;
  cursor: default;
}

.showcase-swap__layer--primary {
  position: relative;
  display: block;
  width: 100%;
  transition: opacity 0.32s ease;
}

.showcase-swap__layer--alt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}

.showcase-swap--has-alt:hover .showcase-swap__layer--alt,
.showcase-swap--has-alt:focus-within .showcase-swap__layer--alt {
  opacity: 1;
}

.showcase-swap--has-alt:hover .showcase-swap__layer--primary,
.showcase-swap--has-alt:focus-within .showcase-swap__layer--primary {
  opacity: 0;
}

@media (hover: none), (pointer: coarse) {
  .showcase-swap--has-alt:active .showcase-swap__layer--alt {
    opacity: 1;
  }
  .showcase-swap--has-alt:active .showcase-swap__layer--primary {
    opacity: 0;
  }
}

/* ── Grille catalogue vitrine (public + brocanteur) ── */
.catalog-container,
.showcase-container {
  max-width: 1440px;
  margin: 0 auto;
}

.catalog-grid,
.furniture-grid,
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px 16px;
  align-items: stretch;
  border: none;
  background: transparent;
  width: 100%;
}

a.furniture-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.furniture-card {
  display: flex;
  flex-direction: column;
  background: var(--furniture-catalog-bg);
  border: none;
  min-width: 0;
  overflow: hidden;
  min-height: 100%;
}

.furniture-image-frame {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--furniture-catalog-bg);
  line-height: 0;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cartes catalogue : image normalisée 4:5 — contain, jamais cover. */
.furniture-image-frame .showcase-swap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.furniture-image-frame .showcase-swap__layer--primary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.furniture-image-frame .showcase-swap__layer--alt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
}

.furniture-image-frame .showcase-swap .furniture-frame,
.furniture-image-frame .showcase-swap .furniture-frame--card {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--furniture-catalog-bg);
  border-radius: 0;
  box-shadow: none;
}

.furniture-image-frame .showcase-swap__layer--primary .furniture-frame__img,
.furniture-image-frame .showcase-swap__layer--primary .furniture-frame > img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
}

.furniture-image-frame .showcase-swap__layer--alt .furniture-frame {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.furniture-image-frame .showcase-swap__layer--alt .furniture-frame__img,
.furniture-image-frame .showcase-swap__layer--alt .furniture-frame > img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
}

.furniture-image-frame .fc-overlay {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  border: none;
}

/* Hover carte entière → swap crème / terracotta (fiche, admin…) */
.furniture-card:hover .showcase-swap--has-alt .showcase-swap__layer--alt,
.furniture-card:focus-within .showcase-swap--has-alt .showcase-swap__layer--alt {
  opacity: 1;
}

.furniture-card:hover .showcase-swap--has-alt .showcase-swap__layer--primary,
.furniture-card:focus-within .showcase-swap--has-alt .showcase-swap__layer--primary {
  opacity: 0;
}

@media (hover: none), (pointer: coarse) {
  .furniture-card:active .showcase-swap--has-alt .showcase-swap__layer--alt {
    opacity: 1;
  }
  .furniture-card:active .showcase-swap--has-alt .showcase-swap__layer--primary {
    opacity: 0;
  }
  .furniture-card:active .furniture-card-body {
    min-height: 120px;
    max-height: 180px;
    opacity: 1;
    padding: 16px 18px 18px;
  }
  .furniture-card:active .furniture-image--secondary,
  .furniture-card:active .furniture-image.secondary {
    opacity: 1;
  }
}

.furniture-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  background: var(--furniture-catalog-bg);
}

.furniture-image--primary,
.furniture-image.primary {
  z-index: 1;
}

.furniture-image--secondary,
.furniture-image.secondary {
  z-index: 2;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.furniture-card:hover .furniture-image--secondary,
.furniture-card:focus-within .furniture-image--secondary,
.furniture-card:hover .furniture-image.secondary,
.furniture-card:focus-within .furniture-image.secondary {
  opacity: 1;
}

.furniture-card-body {
  min-height: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title price"
    "subtitle price";
  column-gap: 16px;
  row-gap: 8px;
  align-items: end;
  background: var(--furniture-catalog-bg);
  border-top: none;
  transition: opacity 0.24s ease, max-height 0.28s ease, padding 0.28s ease;
}

.furniture-card:hover .furniture-card-body,
.furniture-card:focus-within .furniture-card-body {
  min-height: 120px;
  max-height: 180px;
  opacity: 1;
  padding: 16px 18px 18px;
}

.furniture-title {
  grid-area: title;
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
  font-weight: 500;
  color: #000;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.furniture-subtitle {
  grid-area: subtitle;
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  color: #777;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.furniture-price {
  grid-area: price;
  margin: 0;
  font-family: var(--bk-public-serif, Georgia, serif);
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
  color: #000;
  align-self: end;
  justify-self: end;
}

@media (hover: none), (pointer: coarse) {
  .furniture-card:active .furniture-image--secondary,
  .furniture-card:active .furniture-image.secondary {
    opacity: 1;
  }
}

.furniture-image {
