/* Démo d'essayage en direct — page d'accueil.
   Styles volontairement locaux : la section #demo réutilise les variables
   de site.css et ne dépend d'aucun framework. */
.tryon-demo__shell {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
}

.tryon-demo__progress {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.tryon-demo__progress li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.tryon-demo__progress li + li::before {
  content: '';
  width: 18px;
  height: 1px;
  margin-right: 2px;
  background: var(--line);
}

.tryon-demo__progress span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.tryon-demo__progress strong {
  font-weight: 600;
}

.tryon-demo__progress li.is-active {
  color: var(--ink);
}

.tryon-demo__progress li.is-active span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.tryon-demo__progress li.is-done span {
  border-color: var(--mint);
  background: var(--mint);
  color: var(--ink);
}

.tryon-demo__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.tryon-demo__panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.tryon-demo__panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.tryon-demo__kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  line-height: 1.3;
}

.tryon-demo__panel-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.tryon-demo__count,
.tryon-demo__badge {
  flex-shrink: 0;
  white-space: nowrap;
}

.tryon-demo__count {
  padding-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.tryon-demo__badge {
  padding: 5px 9px;
  border-radius: 30px;
  background: var(--soft);
  color: var(--ink);
  font-size: 9px;
  font-weight: 600;
}

.tryon-demo__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 11px;
}

.tryon-filter {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}

.tryon-filter:hover {
  border-color: #c9c9cf;
}

.tryon-filter.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.tryon-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 352px;
  padding-right: 3px;
  overflow: auto;
  scrollbar-width: thin;
}

.tryon-catalog__status {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.tryon-catalog__status--error {
  color: #8a1c2b;
}

.tryon-catalog__retry {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 8px;
}

.tryon-product {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 66px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tryon-product:hover {
  border-color: #c9c9cf;
}

.tryon-product.is-selected {
  border-color: var(--mint);
  box-shadow: 0 0 0 2px var(--soft);
}

.tryon-product__media {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
}

.tryon-product__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tryon-product__media.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.tryon-product__name {
  display: block;
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tryon-product__meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
}

.tryon-product__check {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 9px;
  line-height: 1;
}

.tryon-product.is-selected .tryon-product__check {
  border-color: var(--mint);
  background: var(--mint);
}

.tryon-selection {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.tryon-selection__label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.tryon-selection__items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tryon-selection__item {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 4px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 30px;
  font-size: 9px;
  line-height: 1.3;
}

.tryon-selection__item img {
  width: 23px;
  height: 23px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--paper);
  object-fit: contain;
}

.tryon-selection__item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tryon-selection__item button {
  flex-shrink: 0;
  padding: 1px 3px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.tryon-selection__item button:hover {
  color: var(--ink);
}

.tryon-demo__actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
}

.tryon-demo__actions .button {
  min-height: 40px;
  padding: 9px 15px;
  font-size: 11px;
}

.tryon-demo__actions .button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tryon-demo .button.secondary {
  margin-top: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.tryon-demo .tryon-clear {
  margin-left: auto;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.tryon-photo {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  overflow: hidden;
  border: 1px dashed #cfcfd4;
  border-radius: 14px;
  background: var(--paper);
}

.tryon-photo.is-dragover {
  border-color: var(--mint);
  background: var(--soft);
}

.tryon-photo__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 24px 16px;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.tryon-photo__icon {
  font-size: 27px;
  line-height: 1;
}

.tryon-photo__drop strong {
  font-size: 13px;
  font-weight: 600;
}

.tryon-photo__drop small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.tryon-photo__preview {
  display: block;
  width: 100%;
  max-height: 320px;
  background: #fff;
  object-fit: contain;
}

.tryon-photo__change {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}

.tryon-tips {
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.tryon-tips summary {
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.tryon-tips ul {
  margin: 7px 0 0;
  padding-left: 15px;
}

.tryon-privacy {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.tryon-privacy a {
  color: var(--ink);
  text-decoration: underline;
}

.tryon-status {
  min-height: 15px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.tryon-feedback {
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid #bfe9dc;
  border-radius: 10px;
  background: var(--soft);
  color: var(--ink);
  font-size: 10px;
  line-height: 1.5;
}

.tryon-feedback.is-error {
  border-color: #ffd0d6;
  background: #fff1f2;
  color: #8a1c2b;
}

.tryon-feedback a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.tryon-result {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.tryon-result__figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.tryon-result__figure img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.tryon-result__figure figcaption {
  padding: 7px 9px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 8px;
}

.tryon-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.tryon-result__actions .button {
  min-height: 38px;
  padding: 8px 13px;
  font-size: 10px;
}

.tryon-video {
  margin-top: 11px;
}

.tryon-video video {
  display: block;
  width: 100%;
  max-height: 440px;
  border-radius: 12px;
  background: #000;
  object-fit: contain;
}

.tryon-video .button {
  margin-top: 7px;
}

.tryon-video__status {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.tryon-demo__note {
  max-width: 900px;
  margin: 13px 2px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.tryon-demo button:focus-visible,
.tryon-demo a:focus-visible,
.tryon-photo__drop:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (min-width: 801px) {
  .tryon-demo__panel:first-child {
    position: sticky;
    top: 100px;
    align-self: start;
  }
}

@media (max-width: 800px) {
  .tryon-demo .visual-heading h2 {
    font-size: 30px;
  }

  .tryon-demo__grid {
    grid-template-columns: 1fr;
  }

  .tryon-catalog {
    max-height: 300px;
  }

  .tryon-photo {
    min-height: 190px;
  }

  .tryon-demo__progress {
    gap: 5px;
  }

  .tryon-demo__progress li + li::before {
    width: 10px;
    margin-right: 0;
  }

  .tryon-demo__progress li {
    font-size: 9px;
  }
}

@media (max-width: 430px) {
  .tryon-demo__shell {
    padding: 14px;
  }

  .tryon-demo__panel {
    padding: 13px;
  }

  .tryon-catalog {
    grid-template-columns: 1fr;
    max-height: 320px;
  }

  .tryon-product {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .tryon-product__name {
    white-space: normal;
  }

  .tryon-demo__progress strong {
    display: none;
  }

  .tryon-demo__progress li {
    flex: 1;
    justify-content: center;
  }

  .tryon-demo__progress li + li::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tryon-product,
  .tryon-filter,
  .tryon-photo,
  .tryon-demo .button {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Modale de qualification avant le premier essayage
   -------------------------------------------------------------------------- */
.tryon-modal {
  width: min(560px, calc(100% - 32px));
  max-width: 560px;
  max-height: min(90vh, 860px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
}

.tryon-modal::backdrop {
  background: rgba(11, 11, 15, 0.58);
  backdrop-filter: blur(6px);
}

body:has(dialog.tryon-modal[open]) {
  overflow: hidden;
}

.tryon-modal__card {
  position: relative;
  max-height: min(90vh, 860px);
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(11, 11, 15, 0.28);
}

.tryon-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.tryon-modal__close:hover {
  background: var(--paper);
}

.tryon-modal__head {
  padding-right: 30px;
}

.tryon-modal.is-blocked .tryon-modal__head {
  display: none;
}

.tryon-modal__head h2 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.tryon-modal__head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.tryon-modal__form {
  margin-top: 20px;
}

.tryon-modal__fieldset {
  margin: 0 0 17px;
  padding: 0;
  border: 0;
}

.tryon-modal__fieldset legend {
  padding: 0;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.tryon-choice-grid {
  display: grid;
  gap: 7px;
}

.tryon-choice-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tryon-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.tryon-choice:hover {
  border-color: #c9c9cf;
}

.tryon-choice.is-selected,
.tryon-choice:has(input:checked) {
  border-color: var(--mint);
  box-shadow: 0 0 0 2px var(--soft);
}

.tryon-choice:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

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

.tryon-choice__icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
}

.tryon-choice__icon svg {
  width: 17px;
  height: 17px;
}

.tryon-choice__body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tryon-choice__body strong {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.tryon-choice__body small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.tryon-choice__check {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: transparent;
  font-size: 9px;
  line-height: 1;
}

.tryon-choice.is-selected .tryon-choice__check,
.tryon-choice:has(input:checked) .tryon-choice__check {
  border-color: var(--mint);
  background: var(--mint);
  color: var(--ink);
}

.tryon-field {
  display: grid;
  gap: 6px;
  margin-bottom: 17px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
}

.tryon-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
}

.tryon-field input:focus {
  border-color: var(--ink);
  outline: 2px solid var(--soft);
  outline-offset: 1px;
}

.tryon-field input::placeholder {
  color: #9a9aa2;
}

.tryon-field small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.45;
}

.tryon-modal__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  cursor: pointer;
}

.tryon-modal__consent input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  flex-shrink: 0;
  accent-color: var(--ink);
}

.tryon-modal__consent a {
  color: var(--ink);
  text-decoration: underline;
}

.tryon-modal__error {
  margin: 10px 0 0;
  padding: 9px 11px;
  border: 1px solid #ffd0d6;
  border-radius: 10px;
  background: #fff1f2;
  color: #8a1c2b;
  font-size: 10px;
  line-height: 1.5;
}

.tryon-modal__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.tryon-modal .button {
  min-height: 40px;
  padding: 9px 16px;
  font-size: 11px;
}

.tryon-modal .button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tryon-modal__blocked {
  padding: 16px 0 4px;
  text-align: center;
}

.tryon-modal__blocked-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #fff1f2;
  color: #8a1c2b;
  font-size: 20px;
  font-weight: 700;
}

.tryon-modal__blocked h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.tryon-modal__blocked p {
  max-width: 380px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.tryon-modal__blocked-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-width: 280px;
  margin: 18px auto 0;
}

.tryon-modal__blocked-actions .button {
  width: 100%;
}

@media (max-width: 560px) {
  .tryon-modal {
    width: calc(100% - 20px);
    max-height: 92vh;
  }

  .tryon-modal__card {
    padding: 20px;
    max-height: 92vh;
  }

  .tryon-modal__head h2 {
    font-size: 23px;
  }

  .tryon-choice-grid--2 {
    grid-template-columns: 1fr;
  }

  .tryon-modal__actions {
    flex-direction: column;
  }

  .tryon-modal__actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tryon-modal,
  .tryon-modal__card,
  .tryon-choice {
    transition: none;
  }
}
