.cosmos-personalisation {
    --nuit: #241711;
    --nuit-2: #33231A;
    --or: #C9A05C;
    --or-clair: #EAD7A8;
    --or-sombre: #A8763A;
    --ivoire: #FBF3E7;
    --cacao: #4A2C1D;
    --rose: #C79A98;

    position: relative;
    font-family: 'Jost', 'Segoe UI', sans-serif;
    color: var(--ivoire);
    background: var(--nuit);
    /* Clip horizontal decoration without creating a nested vertical scroll container. */
    overflow-x: clip;
    overflow-y: visible;
    padding-bottom: 1px; /* évite le collapse de marge avec le footer */
  }
  .cosmos-personalisation * { box-sizing: border-box; }
  .cosmos-personalisation h1, .cosmos-personalisation h2 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0;
  }
  .cosmos-personalisation a { text-decoration: none; }

  .cosmos-personalisation .cosmos-eyebrow {
    font-family: 'Jost', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 0.7rem;
    color: var(--or-clair);
  }

  /* ---------- FIL D'ARIANE + INTRO (bandeau compact) ---------- */
  .cosmos-pageheader {
    position: relative;
    padding: 2rem 1.2rem 1.8rem;
    text-align: center;
    background:
      radial-gradient(circle at 20% 10%, rgba(201,160,92,0.12), transparent 42%),
      radial-gradient(circle at 84% 90%, rgba(199,154,152,0.09), transparent 44%),
      var(--nuit);
  }
  @media (min-width: 641px) {
    .cosmos-pageheader { padding: 2.8rem 1.5rem 2.4rem; }
  }
  .cosmos-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: rgba(251,243,231,0.55);
    margin-bottom: 0.9rem;
  }
  .cosmos-breadcrumb a { color: rgba(251,243,231,0.78); transition: color 0.25s ease; }
  .cosmos-breadcrumb a:hover, .cosmos-breadcrumb a:active { color: var(--or-clair); }
  .cosmos-breadcrumb span.is-current { color: var(--or-clair); }
  .cosmos-pageheader h1 {
    font-size: clamp(1.65rem, 5.5vw, 2.35rem);
    color: var(--ivoire);
    margin: 0.4rem 0 0.5rem;
  }
  .cosmos-pageheader p {
    max-width: 480px;
    margin: 0 auto;
    color: rgba(251,243,231,0.75);
    font-size: 0.92rem;
    line-height: 1.6;
  }

  /* ---------- ÉTAPES ---------- */
  .cosmos-etape {
    display: flex;
    gap: 0.9rem;
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.2rem 0;
  }
  @media (min-width: 641px) {
    .cosmos-etape { gap: 1.2rem; padding: 2.6rem 1.5rem 0; }
  }
  .cosmos-etape__num {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--or);
    color: var(--or-clair);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 600;
  }
  .cosmos-etape__body { flex: 1 1 auto; min-width: 0; padding-bottom: 2.4rem; }
  .cosmos-etape__body h2 {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    color: var(--ivoire);
    margin: 0.2rem 0 1rem;
  }

  /* ---------- TAILLES ---------- */
  .cosmos-perso-tailles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
  }
  .cosmos-perso-taille {
    padding: 0.7rem 1.3rem;
    border: 1px solid rgba(201,160,92,0.4);
    border-radius: 999px;
    background: rgba(251,243,231,0.04);
    color: var(--ivoire);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.15s ease, color 0.25s ease;
  }
  .cosmos-perso-taille:hover { border-color: var(--or); background: rgba(201,160,92,0.09); }
  .cosmos-perso-taille:active { transform: scale(0.97); }
  .cosmos-perso-taille:focus-visible { outline: 2px solid var(--or-sombre); outline-offset: 2px; }
  .cosmos-perso-taille.is-active {
    background: var(--or);
    border-color: var(--or);
    color: var(--nuit);
    box-shadow: 0 8px 20px rgba(201,160,92,0.2);
  }

  /* ---------- NOTICE / CONSEIL ---------- */
  .cosmos-notice {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(201,160,92,0.3);
    border-radius: 12px;
    background: rgba(201,160,92,0.07);
    margin-bottom: 1.6rem;
  }
  .cosmos-notice svg { width: 18px; height: 18px; fill: var(--or-clair); flex: 0 0 auto; margin-top: 2px; }
  .cosmos-notice p { margin: 0; font-size: 0.85rem; line-height: 1.6; color: rgba(251,243,231,0.85); }

  /* ---------- APERÇU VISUEL DU COFFRET ---------- */
  .cosmos-coffret-apercu {
    margin-bottom: 1.8rem;
    padding: 1.1rem;
    border: 1px solid rgba(201,160,92,0.22);
    border-radius: 14px;
    background: rgba(0,0,0,0.14);
  }
  .cosmos-coffret-grille {
    display: grid;
    gap: 4px;
    justify-content: center;
    margin-bottom: 0.9rem;
  }
  .cosmos-coffret-case {
    width: 18px; height: 18px;
    border-radius: 4px;
    background-color: rgba(251,243,231,0.08);
    border: 1px solid rgba(251,243,231,0.14);
    /* Propriétés explicites (pas le raccourci "background") pour garantir
       une animation fiable à chaque recoloration de case. */
    transition: background-color 0.35s ease, border-color 0.35s ease;
  }
  @media (min-width: 641px) {
    .cosmos-coffret-case { width: 22px; height: 22px; }
  }
  .cosmos-coffret-legende {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
    justify-content: center;
  }
  .cosmos-coffret-legende__item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    color: rgba(251,243,231,0.7);
  }
  .cosmos-coffret-legende__dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

  /* ---------- LISTE DES CHOCOLATS ---------- */
  .cosmos-articles {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }
  @media (min-width: 641px) {
    .cosmos-articles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  }
  .cosmos-article {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.6rem;
    border: 1px solid rgba(201,160,92,0.2);
    border-radius: 12px;
    background: rgba(251,243,231,0.03);
    transition: border-color 0.25s ease, background 0.25s ease;
  }
  .cosmos-article.has-qte { border-color: rgba(201,160,92,0.5); background: rgba(201,160,92,0.06); }
  .cosmos-article__photo {
    width: 52px; height: 52px;
    flex: 0 0 auto;
    border-radius: 10px;
    border: 1px solid rgba(201,160,92,0.25);
    background-image: var(--img, none), linear-gradient(145deg, var(--or-clair), var(--cacao));
    background-size: cover, cover;
    background-position: center, center;
  }
  .cosmos-article__info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }
  .cosmos-article__nom {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--ivoire);
  }
  .cosmos-article__prix {
    font-size: 0.76rem;
    color: rgba(251,243,231,0.75);
    transition: color 0.25s ease;
  }
  .cosmos-article.has-qte .cosmos-article__prix { color: var(--or-clair); }
  .cosmos-article__stepper {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
  }
  .cosmos-article__stepper button {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(201,160,92,0.45);
    background: rgba(251,243,231,0.05);
    color: var(--ivoire);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
  }
  .cosmos-article__stepper button:hover:not(:disabled) { border-color: var(--or); background: rgba(201,160,92,0.14); }
  .cosmos-article__stepper button:active:not(:disabled) { transform: scale(0.92); }
  .cosmos-article__stepper button:disabled { opacity: 0.3; cursor: not-allowed; }
  .cosmos-article__stepper button:focus-visible { outline: 2px solid var(--or-sombre); outline-offset: 2px; }
  .cosmos-article__qte { min-width: 20px; text-align: center; font-size: 0.95rem; }

  /* ---------- NOSCRIPT (secours si JavaScript est bloqué) ---------- */
  .cosmos-noscript {
    max-width: 720px;
    margin: 1.6rem auto 0;
    padding: 1rem 1.2rem;
    border: 1px solid rgba(201,160,92,0.4);
    border-radius: 12px;
    background: rgba(201,160,92,0.08);
    color: var(--ivoire);
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.6;
  }
  .cosmos-noscript a { color: var(--or-clair); text-decoration: underline; }

  /* ---------- BARRE FLOTTANTE : progression + prix + commander ---------- */
  .cosmos-perso-barre-spacer { height: 128px; }
  @media (min-width: 641px) { .cosmos-perso-barre-spacer { height: 112px; } }

  .cosmos-perso-barre {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    background: rgba(23,14,9,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(201,160,92,0.28);
    box-shadow: 0 -8px 24px rgba(0,0,0,0.35);
    padding: 0.85rem 1.1rem calc(0.85rem + env(safe-area-inset-bottom));
  }
  .cosmos-perso-barre__inner {
    max-width: 700px;
    margin: 0 auto;
  }
  .cosmos-perso-barre__infos {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
  }
  .cosmos-perso-barre__progress { flex: 1 1 auto; min-width: 0; }
  .cosmos-perso-barre__track {
    position: relative;
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(251,243,231,0.14);
    overflow: hidden;
    margin-bottom: 0.4rem;
  }

  .cosmos-perso-barre__fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #C9A05C 0%, #EAD7A8 100%);
    transition: width 0.20s ease-out;
    transform: none;
    will-change: width;
  }
  .cosmos-perso-barre__progress span { font-size: 0.74rem; color: rgba(251,243,231,0.78); }
  .cosmos-perso-barre__prix {
    flex: 0 0 auto;
    text-align: right;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1;
  }
  .cosmos-perso-barre__prix small {
    display: block;
    font-family: 'Jost', sans-serif;
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(251,243,231,0.5);
    margin-top: 0.2rem;
  }

  .cosmos-perso-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.95rem 1.2rem;
    border-radius: 14px;
    border: 1px solid var(--or);
    background: var(--cacao);
    color: var(--ivoire);
    font-family: 'Jost', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(201,160,92,0.3);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
  }
  .cosmos-perso-cta:hover {
    background: #E8D2B5;
    border-color: #E8D2B5;
    color: #241711;
    box-shadow: 0 10px 28px rgba(232,210,181,0.16);
  }
  .cosmos-perso-cta:active { transform: scale(0.98); }
  .cosmos-perso-cta svg { width: 18px; height: 18px; fill: currentColor; flex: 0 0 auto; }
  .cosmos-perso-cta.is-disabled {
    background: rgba(251,243,231,0.05);
    border-color: rgba(201,160,92,0.32);
    box-shadow: none;
    pointer-events: none;
  }

  /* Supprime les soulignements / lignes bleues sur les liens */
  .cosmos-personalisation a, .cosmos-personalisation a:link, .cosmos-personalisation a:visited,
  .cosmos-personalisation a:hover, .cosmos-personalisation a:focus, .cosmos-personalisation a:active {
    text-decoration: none;
    border-bottom: none;
  }

  .cosmos-is-hidden { display: none; }

  /* ===== LAYOUT DESKTOP COMPACT : évite l'effet étiré sur grand écran ===== */
  .cosmos-personalisation .cosmos-etape {
    width: calc(100% - 40px);
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
  }

  .cosmos-personalisation .cosmos-etape__body {
    width: 100%;
    max-width: 100%;
  }

  .cosmos-personalisation .cosmos-notice {
    width: 100%;
    max-width: 100%;
  }

  .cosmos-personalisation .cosmos-coffret-apercu {
    width: 100%;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    padding: 1.25rem;
  }

  .cosmos-personalisation .cosmos-articles {
    width: 100%;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
  }

  .cosmos-personalisation .cosmos-article {
    min-height: 92px;
  }

  .cosmos-perso-barre__inner {
    width: calc(100% - 40px);
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
  }

  @media (min-width: 900px) {
    .cosmos-personalisation .cosmos-etape {
      padding-left: 0;
      padding-right: 0;
    }

    .cosmos-personalisation .cosmos-articles {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 1rem;
    }

    .cosmos-personalisation .cosmos-article {
      padding: 0.8rem;
    }

    .cosmos-personalisation .cosmos-article__photo {
      width: 64px;
      height: 64px;
    }
  }

  @media (max-width: 640px) {
    .cosmos-personalisation .cosmos-etape {
      width: calc(100% - 20px);
      max-width: 100%;
      padding-left: 0.4rem;
      padding-right: 0.4rem;
    }

    .cosmos-personalisation .cosmos-coffret-apercu {
      max-width: 100%;
    }

    .cosmos-perso-barre__inner {
      width: 100%;
      max-width: 100%;
    }
  }



/* Theme-independent integration and accessibility. */
.cosmos-personalisation { min-height: 100vh; padding-bottom: 1px; }
.cosmos-personalisation [hidden] { display: none !important; }
.cosmos-personalisation button:focus-visible, .cosmos-personalisation a:focus-visible { outline: 2px solid var(--or-clair); outline-offset: 3px; }
.cosmos-personalisation .cosmos-perso-cta { color: var(--ivoire); }
.cosmos-personalisation .cosmos-perso-cta:not(:disabled):hover { color: var(--nuit); }
.cosmos-personalisation .cosmos-perso-cta:disabled { background: rgba(251,243,231,.05); border-color: rgba(201,160,92,.32); color: rgba(251,243,231,.75); box-shadow: none; cursor: not-allowed; }
.cosmos-personalisation .cosmos-perso-cta svg { fill: currentColor; }
.cosmos-personalisation .cosmos-perso-barre__prix { color: var(--ivoire); }
.cosmos-article__photo { overflow: hidden; }
.cosmos-article__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cosmos-article__description { font-size: .75rem; line-height: 1.4; color: rgba(251,243,231,.75); }
.cosmos-personalisation .cosmos-coffret-grille { grid-template-columns: repeat(var(--box-columns,2), minmax(0,22px)); gap: 4px; }
.cosmos-personalisation .cosmos-coffret-case { width: 100%; height: auto; aspect-ratio: 1; min-width: 0; }
.cosmos-personalisation .cosmos-perso-barre-spacer { display: none; }
/* Padding after the shared footer ensures it can scroll above the fixed bar. */
body.cosmos-configurator-open { padding-bottom: var(--cosmos-order-bar-height,180px); }
.cosmos-configurator-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cosmos-personalisation .cosmos-article { flex-wrap: wrap; }
.cosmos-personalisation .cosmos-article__info { flex-basis: 85px; overflow-wrap: anywhere; }
.cosmos-personalisation .cosmos-article__stepper { margin-left: auto; }
@media (max-width:640px) { .cosmos-personalisation .cosmos-coffret-grille { grid-template-columns: repeat(var(--box-columns,2), minmax(0,18px)); } }
@media (prefers-reduced-motion:reduce) { .cosmos-personalisation *, .cosmos-personalisation *::before, .cosmos-personalisation *::after { transition: none !important; animation: none !important; } }
