/* Univers Matériel : la même nuit qu'Expérience, mais une vitrine d'objets rangés par maison.
   Chaque maison : son nom en blanc, une grande pièce, deux petites, puis « Voir plus ».
   Sur chaque carte, seulement l'image et le prix. */

.mt-card { position: relative; display: block; color: var(--xp-text); animation: rise .9s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
.mt-card:hover .media img.main.is-loaded { transform: scale(1.04); }
.mt-card:hover .media.has-alt img.alt.is-loaded { opacity: 1; }
.mt-card:hover .media.has-alt img.main.is-loaded { opacity: 0; }

/* ---------- Recherche ---------- */
.mt-search {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 18px; width: clamp(200px, 26vw, 320px); min-width: 0;
  border-radius: 999px; background: var(--xp-glass); border: 1px solid var(--xp-glass-line); color: var(--xp-dim);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: border-color .3s, background-color .3s;
}
.mt-search:focus-within { border-color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .12); }
.mt-search svg { width: 15px; height: 15px; flex: none; }
.mt-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--xp-text); font-size: 13.5px; }
.mt-search input::placeholder { color: var(--xp-dim); }
.mt-search input::-webkit-search-cancel-button { filter: invert(1); opacity: .6; cursor: pointer; }
.mt-back { color: var(--xp-text); font-weight: 500; }
.mt-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.mt-none { margin: 0; padding: 72px 0; text-align: center; font-size: 15px; color: var(--xp-dim); }

/* ---------- Maisons ---------- */
.mt .xp-head { margin-bottom: clamp(48px, 7vw, 112px); }
.mt-houses { display: flex; flex-direction: column; gap: clamp(56px, 7vw, 104px); }
.mt-house { display: flex; flex-direction: column; gap: clamp(12px, 1.6vw, 20px); }
.mt-house-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.mt-house-name {
  margin: 0; min-width: 0; overflow-wrap: anywhere;
  font-family: var(--sans); font-weight: 800; text-transform: uppercase;
  font-size: clamp(30px, 4.6vw, 72px); line-height: .95; letter-spacing: -.03em;
  color: var(--xp-text);
}
.mt-house-count { font-size: 13px; color: var(--xp-dim); white-space: nowrap; }

/* ---------- Cartes ---------- */
.mt-big, .mt-tile {
  display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 12px;
  border-radius: var(--xp-radius); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: background-color .4s var(--ease), border-color .4s var(--ease), transform .6s var(--ease-out);
}
.mt-big:hover, .mt-tile:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); transform: translateY(-3px); }
.mt-big .media, .mt-tile .media { border-radius: 3px; }
.mt-big .media { aspect-ratio: 16 / 8; }
.mt-big .media img.is-product { padding: 4% 14%; }
.mt-house-row .media { aspect-ratio: 1 / 1; }
.mt-house-row.cells-2 .media { aspect-ratio: 16 / 10; }
.mt-big.is-done .media, .mt-tile.is-done .media { opacity: .5; }

.mt-foot { padding: 2px 6px; font-size: clamp(15px, 1.3vw, 18px); font-weight: 600; font-variant-numeric: tabular-nums; }
.mt-big .mt-foot { font-size: clamp(20px, 2.2vw, 30px); }
.is-done .mt-foot { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--xp-dim); }

.mt-house-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
.mt-house-row.cells-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Voir plus */
.mt-more {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px;
  padding: clamp(18px, 2.4vw, 34px); border-radius: var(--xp-radius);
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}
.mt-more:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .32); }
.mt-more-arrow {
  display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 6px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .5); font-size: 20px; line-height: 1;
  transition: transform .6s var(--ease-out), background-color .3s, color .3s;
}
.mt-more:hover .mt-more-arrow { transform: translateX(6px); background: var(--xp-text); color: var(--xp-night); }
.mt-more-title { font-size: clamp(24px, 2.6vw, 40px); font-weight: 800; letter-spacing: -.025em; line-height: 1; }
.mt-more-count { font-size: 13px; color: var(--xp-dim); }

/* Vitrine vide */
.mt-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: clamp(360px, 46vw, 560px); padding: 24px; text-align: center; cursor: pointer;
  border-radius: var(--xp-radius); border: 1px dashed rgba(255, 255, 255, .34); background: rgba(255, 255, 255, .05);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}
.mt-add:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .6); }
.mt-add:hover .xp-add-plus { transform: rotate(90deg); background: var(--xp-text); color: var(--xp-night); }
.mt-add .xp-add-title { font-size: clamp(26px, 3.4vw, 48px); font-weight: 800; letter-spacing: -.02em; }

/* Toutes les pièces d'une maison, et « Autres sacs » sur la fiche */
.mt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.8vw, 22px); }

/* ---------- Fiche d'un objet ---------- */
/* Même nuit verte que la vitrine : la photo d'abord, puis le nom et le prix, l'achat, « À propos »,
   les autres photos sans titre, et pour finir les objets de la même famille. */
.mdx { padding-top: 22px; }
.mdx-crumbs { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--xp-dim); margin-bottom: 20px; }
.mdx-crumbs a { color: var(--xp-text); font-weight: 500; }
.mdx-crumbs a:hover { text-decoration: underline; text-underline-offset: 4px; }

.mdx-frame {
  display: block; width: 100%; padding: 12px; cursor: zoom-in;
  border-radius: var(--xp-radius); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}
.mdx-frame:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .26); }
.mdx-frame .media { border-radius: 3px; aspect-ratio: 1 / 1; }
.mdx-frame:hover .media img.is-loaded { transform: scale(1.03); }
.mdx-frame.is-empty { cursor: pointer; display: grid; place-items: center; min-height: 320px; border-style: dashed; color: var(--xp-dim); font-size: 14px; }
.mdx-hero { margin: 0; }
.mdx-hero .media { aspect-ratio: 16 / 9; }

.mdx-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap;
  margin-top: clamp(28px, 4vw, 52px);
}
.mdx-names { display: flex; flex-direction: column; gap: 12px; min-width: 0; max-width: 64ch; }
.mdx-brand { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--xp-dim); }
.mdx-title {
  margin: 0; font-family: var(--sans); font-weight: 800; color: var(--xp-text);
  font-size: clamp(30px, 4.2vw, 64px); line-height: 1; letter-spacing: -.03em; text-wrap: balance; overflow-wrap: anywhere;
}
.mdx-price { margin: 0; font-size: clamp(24px, 2.8vw, 40px); font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Achat + actions */
.mdx-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 28px; padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .12);
}
.mdx-buy {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 32px; border-radius: 999px;
  background: var(--xp-text); color: var(--xp-night); font-size: 14.5px; font-weight: 600; white-space: nowrap;
  transition: transform .4s var(--ease), background-color .3s;
}
.mdx-buy:hover { background: #fff; }
.mdx-buy:active { transform: scale(.985); }
.mdx-buy .arrow { transition: transform .45s var(--ease); }
.mdx-buy:hover .arrow { transform: translate(3px, -3px); }
.mdx-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.mdx-tool {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--xp-glass); border: 1px solid var(--xp-glass-line); color: var(--xp-text);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background-color .3s, border-color .3s, color .3s;
}
.mdx-tool svg { width: 16px; height: 16px; flex: none; }
.mdx-tool:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .45); }
.mdx-tool.is-on { background: var(--xp-text); color: var(--xp-night); border-color: var(--xp-text); }
.mdx-tool.is-danger { width: 44px; padding: 0; justify-content: center; }
.mdx-tool.is-danger:hover { background: #8E3A2E; border-color: #8E3A2E; color: #fff; }

/* À propos */
.mdx-about { margin-top: clamp(56px, 7vw, 96px); max-width: 72ch; }
.mdx-h2 { margin: 0 0 18px; font-family: var(--sans); font-weight: 800; font-size: clamp(26px, 2.8vw, 40px); letter-spacing: -.025em; line-height: 1; color: var(--xp-text); }
.mdx-desc { margin: 0; color: rgba(243, 241, 235, .78); font-size: 15.5px; line-height: 1.8; }
.mdx-desc.desc-body { color: rgba(243, 241, 235, .78); }
.mdx-desc.is-clamped { max-height: 11em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.mdx-more { margin-top: 12px; color: var(--xp-text); font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
p.mdx-desc .mdx-more { margin-top: 0; }
.mdx-note { margin: 26px 0 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--xp-text); font-size: 17px; font-weight: 500; line-height: 1.5; white-space: pre-line; }

/* Les autres photos, sans titre */
.mdx-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); margin-top: clamp(40px, 5vw, 72px); }
.mdx-photos.is-odd > :last-child { grid-column: 1 / -1; }
.mdx-photos.is-odd > :last-child .media { aspect-ratio: 16 / 9; }

/* Autres sacs, autres montres… */
.mdx-similar { margin-top: clamp(72px, 9vw, 128px); }
.mdx-similar .mt-house-head { margin-bottom: clamp(14px, 2vw, 22px); }
.mt-foot.has-brand { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mt-foot.has-brand .mt-foot-brand {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--xp-dim);
}

@media (max-width: 760px) {
  .mdx-hero .media { aspect-ratio: 1 / 1; }
  .mdx-head { flex-direction: column; align-items: flex-start; }
  .mdx-actions { flex-direction: column; align-items: stretch; }
  .mdx-buy { width: 100%; }
  .mdx-tools { justify-content: space-between; }
  .mdx-tool span { display: none; }
  .mdx-tool { width: 52px; height: 52px; padding: 0; justify-content: center; }
  .mdx-tool svg { width: 18px; height: 18px; }
  .mdx-photos { grid-template-columns: minmax(0, 1fr); }
  .mdx-photos.is-odd > :last-child .media { aspect-ratio: 1 / 1; }
  /* Jamais un objet seul sur sa ligne : le dernier prend toute la largeur. */
  .mdx-similar .mt-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .mdx-similar .mt-grid > :last-child:nth-child(odd) .media { aspect-ratio: 16 / 10; }
}

/* ---------- Adaptation ---------- */
@media (max-width: 1100px) { .mt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .xp-bar:has(.mt-search) .xp-count:empty { display: none; }
  .xp-bar-tools:has(.mt-search) { width: 100%; }
  .xp-bar-tools:has(.mt-search) .xp-pill { display: none; }
  .mt-search { flex: 1 1 auto; width: auto; }
  .mt-big .media { aspect-ratio: 4 / 3; }
  .mt-house-row.cells-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mt-house-row.cells-3 .mt-more { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; }
  .mt-house-row.cells-3 .mt-more-arrow { margin: 0; order: 2; margin-left: auto; }
  .mt-tile { padding: 8px; gap: 10px; }
  .mt-foot { padding: 2px; }
  .mt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* ---------- Code d'accès (vitrine en ligne) ---------- */
body[data-page="lock"] .site-header, body[data-page="lock"] .site-footer { visibility: hidden; }
.lock { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; gap: clamp(28px, 5vw, 56px); padding-block: 40px; }
.lock .xp-giant { font-size: clamp(72px, 18vw, 300px); }
.lock-form { display: flex; flex-direction: column; gap: 14px; width: min(520px, 100%); margin: 0 auto; }
.lock-label { font-size: 12px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--xp-dim); }
.lock-row { display: flex; gap: 10px; }
.lock-row input {
  flex: 1; min-width: 0; height: 56px; padding: 0 22px; border-radius: 999px; outline: none;
  background: var(--xp-glass); border: 1px solid var(--xp-glass-line); color: var(--xp-text);
  font-size: 16px; letter-spacing: .08em; transition: border-color .3s, background-color .3s;
}
.lock-row input:focus { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .12); }
.lock-row input::placeholder { color: var(--xp-dim); }
.lock-hint, .lock-error { margin: 0; font-size: 13px; color: var(--xp-dim); }
.lock-error { color: #F1B8AE; }
@media (max-width: 760px) {
  .lock-row { flex-direction: column; }
  .lock-row input { flex: none; }
}
