/* Config Tenu MX — look builder (dark GXS). Isolé au produit shell. */

.ctmx-page {
  --ctmx-teal: #00d2be;
  --ctmx-violet: #8b5cf6;
  --ctmx-panel: #14141c;
  --ctmx-tile: #1a1a22;
  --ctmx-line: rgba(0, 210, 190, 0.28);
  --ctmx-meta-min: 3.25rem;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* Builder : hero court, cartes lisibles (pas d’écrasement overflow:hidden). */
.ctmx-page--fit {
  padding-bottom: 2rem !important;
}

.ctmx-page--fit .ctmx-body {
  max-width: 1180px;
  width: 100%;
  padding-top: 0.5rem;
  padding-bottom: 1rem;
}

.ctmx-page--fit .ctmx-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ctmx-page--fit .ctmx-bento {
  overflow: visible;
}

.ctmx-page--fit .ctmx-footer {
  margin-top: 0.25rem;
}

.ctmx-hero {
  position: relative;
  isolation: isolate;
  min-height: min(72vh, 560px);
  display: flex;
  align-items: flex-end;
  margin: 0 0 1.5rem;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 12% 18%, rgba(0, 210, 190, 0.22), transparent 55%),
    radial-gradient(90% 70% at 88% 30%, rgba(139, 92, 246, 0.28), transparent 50%),
    linear-gradient(165deg, #0a0a10 0%, #12121a 55%, #0e0e14 100%);
}

/* Hero compact : place pour le builder sans scroll. */
.ctmx-hero--compact {
  flex: 0 0 auto;
  min-height: 0;
  margin: 0 0 0.35rem;
  align-items: center;
}

.ctmx-hero--compact .ctmx-hero-inner {
  padding: 4.35rem 1rem 0.55rem;
  max-width: 1200px;
}

.ctmx-hero-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.ctmx-hero-copy {
  min-width: 0;
}

.ctmx-hero--compact .ctmx-hero-brand {
  margin: 0;
  font-size: clamp(1.15rem, 2.8vw, 1.65rem);
  line-height: 1;
}

.ctmx-hero--compact .ctmx-hero-title {
  margin: 0.2rem 0 0;
  font-size: clamp(0.72rem, 1.4vw, 0.88rem);
  letter-spacing: 0.06em;
}

.ctmx-back-link {
  font-size: 0.78rem;
  color: #ffffff88;
  text-decoration: none;
  white-space: nowrap;
}

.ctmx-back-link:hover {
  color: var(--ctmx-teal);
}

.ctmx-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.ctmx-hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.38;
  transform: scale(1.04);
  animation: ctmx-hero-drift 18s ease-in-out infinite alternate;
}

.ctmx-hero-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 8, 12, 0.92) 0%, rgba(8, 8, 12, 0.55) 48%, rgba(8, 8, 12, 0.78) 100%),
    linear-gradient(180deg, rgba(8, 8, 12, 0.25) 0%, rgba(8, 8, 12, 0.92) 100%);
}

.ctmx-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 5.5rem 1.25rem 2.4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.ctmx-hero-brand {
  margin: 0 0 0.55rem;
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 40px rgba(0, 210, 190, 0.35);
  animation: ctmx-hero-in 0.7s ease both;
}

.ctmx-hero-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ctmx-teal);
  animation: ctmx-hero-in 0.7s ease 0.08s both;
}

.ctmx-hero-lead {
  margin: 0 0 1.35rem;
  max-width: 34rem;
  color: #ffffffb8;
  font-size: 1.02rem;
  line-height: 1.55;
  animation: ctmx-hero-in 0.7s ease 0.16s both;
}

.ctmx-hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.8rem 1.35rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: ctmx-hero-in 0.7s ease 0.24s both;
  box-shadow: 0 0 0 1px rgba(0, 210, 190, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
}

@keyframes ctmx-hero-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ctmx-hero-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .ctmx-hero-photo,
  .ctmx-hero-brand,
  .ctmx-hero-title,
  .ctmx-hero-lead,
  .ctmx-hero-cta {
    animation: none;
  }
}

.ctmx-body {
  max-width: 1100px;
}

.ctmx-back {
  margin: 0 0 1rem;
}

.ctmx-lead {
  margin: 0;
  color: #ffffff88;
  font-size: 0.95rem;
  max-width: 36rem;
}

.ctmx-alert {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 120, 80, 0.45);
  background: rgba(255, 80, 40, 0.12);
  color: #ffc9b8;
}

.ctmx-bento {
  display: grid;
  /* Gauche = pièces principales ; droite = accessoires un peu plus étroits. */
  grid-template-columns: 1.25fr 0.85fr;
  align-items: start;
  gap: 14px;
  scroll-margin-top: 5.5rem;
}

.ctmx-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.ctmx-col--right {
  gap: 10px;
}

.ctmx-col:empty {
  display: none;
}

.ctmx-bento:has(.ctmx-col--left:empty),
.ctmx-bento:has(.ctmx-col--right:empty) {
  grid-template-columns: 1fr;
}

.ctmx-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 14px;
  border: 1px solid var(--ctmx-line);
  background: var(--ctmx-tile);
  overflow: visible;
}

/* Colonne droite : un peu plus compacte, mais toujours lisible. */
.ctmx-col--right .ctmx-cell {
  border-radius: 12px;
}

.ctmx-col--right .ctmx-cell-head {
  padding: 8px 10px 4px;
}

.ctmx-col--right .ctmx-cell-label {
  font-size: 0.64rem;
}

.ctmx-col--right .ctmx-slide {
  gap: 8px;
  padding: 0 10px;
}

.ctmx-col--right .ctmx-slide-media {
  min-height: 200px;
  height: clamp(200px, 24vw, 280px);
  max-height: 280px;
  border-radius: 8px;
}

.ctmx-col--right .ctmx-slide-meta {
  padding: 6px 4px;
}

.ctmx-col--right .ctmx-nav {
  width: 30px;
  height: 30px;
  font-size: 1.15rem;
}

.ctmx-col--right .ctmx-slide-name {
  font-size: 0.8rem;
  -webkit-line-clamp: 2;
}

.ctmx-col--right .ctmx-slide-price-value {
  font-size: 0.9rem;
}

.ctmx-col--right .ctmx-swatch {
  width: 18px;
  height: 18px;
}

.ctmx-col--right .ctmx-chip {
  min-width: 26px;
  min-height: 22px;
  padding: 0 6px;
  font-size: 0.68rem;
}


.ctmx-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 6px;
  flex-shrink: 0;
  z-index: 2;
}

.ctmx-cell-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ctmx-cell-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ctmx-teal);
  font-weight: 700;
}

.ctmx-cell-count {
  font-size: 0.68rem;
  color: #ffffff66;
}

.ctmx-skip {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 10, 14, 0.75);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
}

.ctmx-skip:hover,
.ctmx-skip[aria-pressed="true"] {
  border-color: #ff7a6a;
  color: #ff7a6a;
  background: rgba(255, 80, 60, 0.12);
}

.ctmx-skip-banner {
  margin: 0 12px 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 122, 106, 0.45);
  background: rgba(255, 80, 60, 0.08);
  color: #ffc2b8;
  font-size: 0.82rem;
  text-align: center;
}

.ctmx-cell.is-skipped {
  opacity: 0.72;
  border-color: rgba(255, 122, 106, 0.35);
}

.ctmx-cell.is-skipped .ctmx-slider {
  pointer-events: none;
  filter: grayscale(0.35);
  opacity: 0.45;
}

.ctmx-cell.is-skipped .ctmx-slide-attrs {
  display: none;
}

.ctmx-slider {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 0 10px;
}

.ctmx-track {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

/*
 * Slides en flux normal (plus d’absolute inset) :
 * image au-dessus, bandeau meta réservé en bas — pas de superposition.
 */
.ctmx-slide {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  padding: 0 12px;
  min-height: 0;
  width: 100%;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.ctmx-slide.is-active,
.ctmx-slide.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.ctmx-slide[hidden] {
  display: none !important;
}

.ctmx-slide-media {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 280px;
  height: clamp(280px, 36vw, 420px);
  max-height: 420px;
  border-radius: 10px;
  background: #0e0e14;
  overflow: hidden;
}

/* Image affichée (scène) — flux normal, jamais 0×0. */
.ctmx-gallery-stage {
  display: block !important;
  position: relative !important;
  z-index: 1;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
  opacity: 1 !important;
  visibility: visible !important;
  transition: opacity 0.25s ease;
}

.ctmx-gallery-stage.is-fading {
  opacity: 0.55 !important;
}

/* Pool hors écran : sources + métadonnées couleur uniquement. */
.ctmx-gallery-pool {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.ctmx-gallery-pool img.ctmx-gallery-img {
  position: static !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.ctmx-slide-ph {
  width: 48%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: linear-gradient(145deg, #222230, #121218);
}

/* Bandeau nom + flèches produit (changement de modèle, pas de couleur). */
.ctmx-slide-meta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-height: 0;
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #0c0c12;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex: 0 0 auto;
}

.ctmx-slide-meta--switch {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-color: rgba(0, 210, 190, 0.28);
}

.ctmx-slide-meta-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ctmx-slide-switch-hint {
  margin: 0;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff66;
  font-weight: 600;
}

.ctmx-slide-name {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  color: #fff;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ctmx-slide-price {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ctmx-slide-price-label {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff7a;
  font-weight: 600;
}

.ctmx-slide-price-value {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--ctmx-teal);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Couleur | Taille sur 1 ligne, 2 colonnes. */
.ctmx-slide-attrs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  align-items: start;
  padding: 0 2px 6px;
  flex: 0 0 auto;
  overflow: visible;
}

.ctmx-slide-attrs.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Si 1 seul champ (ou 3+) : pleine largeur sur la ligne. */
.ctmx-slide-attrs > .ctmx-attr-field:only-child,
.ctmx-slide-attrs > .ctmx-attr-field:nth-child(n+3) {
  grid-column: 1 / -1;
}

.ctmx-attr-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

.ctmx-fixed-color {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 3px 8px 3px 3px;
  border-radius: 999px;
  border: 1px solid rgba(0, 210, 190, 0.28);
  background: rgba(0, 210, 190, 0.08);
}

.ctmx-fixed-color .ctmx-swatch {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.ctmx-fixed-color-label {
  font-size: 0.78rem;
  font-weight: 650;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ctmx-attr-label {
  flex: 0 0 auto;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff88;
  font-weight: 650;
}

.ctmx-opt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  width: 100%;
}

.ctmx-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.ctmx-opt-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.ctmx-opt--swatch {
  flex-direction: row;
  max-width: none;
}

.ctmx-swatch {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* Libellé couleur : tooltip title uniquement — pastille seule. */
.ctmx-opt--swatch .ctmx-opt-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ctmx-opt--swatch:hover .ctmx-swatch,
.ctmx-opt--swatch:focus-within .ctmx-swatch {
  border-color: var(--ctmx-teal);
  transform: scale(1.08);
}

.ctmx-opt--swatch:has(.ctmx-opt-input:checked) .ctmx-swatch {
  border-color: var(--ctmx-teal);
  box-shadow:
    0 0 0 1.5px rgba(0, 210, 190, 0.45),
    inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.ctmx-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 26px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #0c0c12;
  color: #ffffffcc;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ctmx-opt--chip:hover .ctmx-chip,
.ctmx-opt--chip:focus-within .ctmx-chip {
  border-color: var(--ctmx-teal);
  color: #fff;
}

.ctmx-opt--chip:has(.ctmx-opt-input:checked) .ctmx-chip {
  border-color: var(--ctmx-teal);
  background: rgba(0, 210, 190, 0.14);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(0, 210, 190, 0.2);
}

.ctmx-opt.is-unavailable,
.ctmx-opt[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .ctmx-slide,
  .ctmx-gallery-img,
  .ctmx-swatch,
  .ctmx-chip {
    transition: none;
  }
}

/* Flèches au niveau du nom = changer de produit (pas la couleur). */
.ctmx-nav {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  transform: none;
  z-index: 2;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(0, 210, 190, 0.35);
  background: rgba(0, 210, 190, 0.1);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.ctmx-nav:hover {
  border-color: var(--ctmx-teal);
  color: var(--ctmx-teal);
  background: rgba(0, 210, 190, 0.18);
}

.ctmx-nav--prev,
.ctmx-nav--next {
  left: auto;
  right: auto;
}

.ctmx-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(120deg, rgba(0, 210, 190, 0.08), rgba(139, 92, 246, 0.12));
}

.ctmx-total {
  margin: 0;
  font-size: 1.05rem;
  color: #ffffffb0;
}

.ctmx-total strong {
  color: #fff;
  font-size: 1.25rem;
}

.ctmx-submit {
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .ctmx-bento {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .ctmx-slide-media {
    min-height: 240px;
    height: 280px;
    max-height: 300px;
  }

  .ctmx-col--right .ctmx-slide-media {
    min-height: 180px;
    height: 210px;
    max-height: 220px;
  }
}

@media (max-width: 760px) {
  .ctmx-hero:not(.ctmx-hero--compact) {
    min-height: min(58vh, 420px);
  }

  .ctmx-hero:not(.ctmx-hero--compact) .ctmx-hero-inner {
    padding-top: 4.75rem;
    padding-bottom: 1.85rem;
  }

  .ctmx-hero--compact .ctmx-hero-inner {
    padding-top: 4.25rem;
    padding-bottom: 0.55rem;
  }

  .ctmx-bento {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ctmx-col--right .ctmx-slide-media {
    min-height: 220px;
    height: 250px;
    max-height: 270px;
  }

  .ctmx-col--right .ctmx-slide-name {
    font-size: 0.88rem;
  }

  .ctmx-col--right .ctmx-swatch {
    width: 20px;
    height: 20px;
  }

  .ctmx-slide {
    padding: 0 10px;
  }

  .ctmx-slide-media {
    min-height: 260px;
    height: 300px;
    max-height: 320px;
  }

  /* Mobile étroit : attrs empilés si trop serré. */
  .ctmx-slide-attrs {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .ctmx-swatch {
    width: 22px;
    height: 22px;
  }

  .ctmx-slide-meta {
    padding: 9px 10px;
  }

  .ctmx-slide-name {
    font-size: 0.95rem;
  }

  .ctmx-slide-price-value {
    font-size: 1.05rem;
  }

  .ctmx-nav {
    width: 38px;
    height: 38px;
  }

  .ctmx-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .ctmx-submit {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .ctmx-slide-media {
    min-height: 240px;
    height: 260px;
    max-height: 280px;
  }

  .ctmx-slide-attrs {
    grid-template-columns: 1fr;
  }

  .ctmx-nav {
    width: 36px;
    height: 36px;
  }

  .ctmx-slide-name {
    font-size: 0.9rem;
  }

  .ctmx-chip {
    min-width: 28px;
    min-height: 24px;
    font-size: 0.72rem;
  }
}
