/* ─── Couscous'Bar — Page Commander ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ── Body overrides ─────────────────────────────────────────────────────────── */
.page-id-commander,
body:has(.cb-commander) {
    background: #0D0905;
    color: #F0E2BC;
}

/* ── Wrapper principal ──────────────────────────────────────────────────────── */
.cb-commander {
    min-height: 100vh;
    background: #0D0905;
    color: #F0E2BC;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Layout 2/3 + 1/3 avec sidebar sticky ───────────────────────────────────── */
.cb-tunnel-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Wizard ─────────────────────────────────────────────────────────────────── */
.cb-wizard {
    flex: 1 1 auto;
    min-width: 0;
    padding: 2.5rem 0 2rem;
}

/* ── Sidebar sticky : récap live ────────────────────────────────────────────── */
.cb-tunnel-sidebar {
    flex: 0 0 320px;
    position: sticky;
    top: 6.5rem; /* dégage la barre de navigation fixe du site */
    align-self: flex-start;
    margin-top: 2.5rem;
}
.cb-tunnel-sidebar__inner {
    background: #1C1008;
    border: 1px solid rgba(212, 194, 174, 0.25);
    border-radius: 16px;
    padding: 1.25rem;
}
.cb-side__title {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    color: #F0E2BC;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.cb-side-recap { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1rem; }
.cb-side__line { display: flex; justify-content: space-between; gap: .75rem; font-size: .85rem; color: #F0E2BC; }
.cb-side__name { flex: 1; }
.cb-side__meta { font-size: .72rem; color: #9E8A63; margin-top: .15rem; line-height: 1.35; }
.cb-side__price { color: #D4C2AE; font-weight: 600; white-space: nowrap; }
.cb-side-empty { font-size: .82rem; color: #9E8A63; font-style: italic; margin: 0; }
.cb-side-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(240, 226, 188, 0.12);
    padding-top: .85rem;
    font-weight: 700;
    color: #F0E2BC;
}
#cb-side-total {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #D4C2AE;
}

@media (max-width: 900px) {
    .cb-tunnel-layout { display: block; padding: 0; }
    .cb-tunnel-sidebar { display: none; position: static; margin-top: 0; flex: none; }
    .cb-tunnel-sidebar--inline { display: block; margin: 0 0 1.75rem; }
    .cb-tunnel-sidebar--hidden { display: none; }
    .cb-wizard { padding: 2.5rem 1.5rem 4rem; max-width: 800px; margin: 0 auto; }
}

/* ── Progress bar ───────────────────────────────────────────────────────────── */
.cb-progress { margin-bottom: 2.5rem; }

.cb-progress__bar {
    height: 3px;
    background: rgba(240, 226, 188, 0.12);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.cb-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, #3B1A09, #D4C2AE);
    border-radius: 9999px;
    transition: width .4s ease;
    width: 20%;
}

.cb-progress__steps {
    display: flex;
    gap: .6rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
}
.cb-progress__steps::-webkit-scrollbar { display: none; }

.cb-progress__step {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .4rem;
    opacity: .4;
    transition: opacity .3s;
    cursor: default;
    flex: 0 0 auto;
}
.cb-progress__step.is-active { opacity: 1; }
.cb-progress__step.is-done   { opacity: .75; cursor: pointer; }

.cb-progress__icon {
    font-size: 1.05rem;
    line-height: 1;
    width: 2.1rem;
    height: 2.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(240, 226, 188, 0.2);
    background: #1C1008;
    color: #9E8A63;
    flex-shrink: 0;
    transition: all .2s;
}
.cb-progress__step.is-active .cb-progress__icon { border-color: #D4C2AE; background: rgba(212, 194, 174, 0.15); color: #D4C2AE; }
.cb-progress__step.is-done .cb-progress__icon   { border-color: rgba(212, 194, 174, 0.4); color: #D4C2AE; }

.cb-progress__label {
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #D4C2AE;
    white-space: nowrap;
    display: none;
}
.cb-progress__step.is-active .cb-progress__label { display: inline; }

/* ── Étapes ─────────────────────────────────────────────────────────────────── */
.cb-step { display: none; animation: cb-step-in .35s ease; }
.cb-step.is-active { display: block; }

@keyframes cb-step-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

/* ── Header d'étape ─────────────────────────────────────────────────────────── */
.cb-step__header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(240, 226, 188, 0.12);
}
.cb-step__icon { font-size: 2rem; line-height: 1; flex-shrink: 0; margin-top: .2rem; }
.cb-step__title {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 1.7rem;
    color: #F0E2BC;
    margin: 0 0 .3rem;
}
.cb-step__desc { color: #9E8A63; margin: 0; font-size: .9rem; }

/* ── Badge prix vivant ──────────────────────────────────────────────────────── */
.cb-price-badge { margin-left: auto; text-align: right; flex-shrink: 0; }
.cb-price-badge__label {
    display: block;
    font-size: .7rem;
    color: #9E8A63;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.cb-price-badge__price {
    display: block;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #D4C2AE;
    line-height: 1.1;
    transition: color .2s;
}

/* ── Sections internes ──────────────────────────────────────────────────────── */
.cb-section { margin-bottom: 2rem; }
.cb-section__title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #F0E2BC;
    margin: 0 0 .6rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.cb-section__icon { font-size: 1.2rem; }
.cb-section__note {
    margin-left: auto;
    font-size: .72rem;
    font-weight: 400;
    color: #9E8A63;
    text-transform: none;
    letter-spacing: 0;
    background: rgba(240, 226, 188, 0.08);
    border: 1px solid rgba(240, 226, 188, 0.12);
    padding: .2rem .6rem;
    border-radius: 9999px;
}
.cb-section__hint { font-size: .85rem; color: #9E8A63; margin: 0 0 .75rem; }

/* ── Tags légumes ───────────────────────────────────────────────────────────── */
.cb-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.cb-tag { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cb-tag input { position: absolute; opacity: 0; width: 0; height: 0; }
.cb-tag__label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .9rem;
    border: 1px solid rgba(212, 194, 174, 0.25);
    border-radius: 9999px;
    font-size: .85rem;
    color: #9E8A63;
    background: transparent;
    transition: all .2s;
    cursor: pointer;
}
.cb-tag__label::before { content: '+ '; font-size: .8rem; opacity: .6; }
.cb-tag input:checked + .cb-tag__label {
    background: #F0E2BC;
    border-color: #F0E2BC;
    color: #1C1008;
    font-weight: 600;
}
.cb-tag input:checked + .cb-tag__label::before { content: '✓ '; opacity: 1; }
@media (hover: hover) {
    .cb-tag:hover .cb-tag__label { border-color: #D4C2AE; color: #F0E2BC; }
    .cb-tag input:checked + .cb-tag__label:hover { color: #1C1008; }
}
/* Retirer le halo de focus « collant » après le clic (le style ✓ suffit) */
.cb-tag input:focus:not(:focus-visible) + .cb-tag__label { outline: none; }

/* ── Cartes viandes ─────────────────────────────────────────────────────────── */
.cb-viande-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.cb-viande-grid.cb-grid--cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
.cb-viande-grid.cb-grid--cols-2 .cb-viande-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

@media (max-width: 576px) { .cb-viande-grid { grid-template-columns: repeat(2, 1fr); } }

.cb-viande-card { cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent; }
.cb-viande-card input { position: absolute; opacity: 0; width: 0; height: 0; }

.cb-viande-card__inner {
    border: 2px solid rgba(212, 194, 174, 0.25);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    background: #1C1008;
    transition: all .2s;
}
@media (hover: hover) {
    .cb-viande-card:hover .cb-viande-card__inner {
        border-color: #D4C2AE;
        background: rgba(212, 194, 174, 0.07);
    }
}
.cb-viande-card input:checked ~ .cb-viande-card__inner,
.cb-viande-card.is-selected .cb-viande-card__inner {
    border-color: #F0E2BC;
    background: #F0E2BC;
    box-shadow: 0 0 20px rgba(240, 226, 188, 0.3);
    transform: translateY(-1px);
}
.cb-viande-card.is-selected .cb-viande-card__name { color: #1C1008; font-weight: 700; }
.cb-viande-card.is-selected .cb-viande-card__icon { color: #1C1008; }
.cb-viande-card__icon { font-size: 2.5rem; margin-bottom: .5rem; }
.cb-viande-card__name { font-size: .9rem; font-weight: 600; color: #F0E2BC; }

.cb-viande-hint {
    margin-top: .75rem;
    font-size: .85rem;
    color: #9E8A63;
    text-align: center;
    font-style: italic;
    min-height: 1.4em;
    transition: color .2s;
}

@keyframes cb-viande-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}
.cb-viande-card--shake .cb-viande-card__inner { animation: cb-viande-shake .4s ease; }

/* ── Grille sélection cartes ─────────────────────────────────────────────────── */
.cb-select-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 480px) {
    .cb-select-cards-grid .cb-select-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.cb-select-card {
    cursor: pointer; position: relative; display: block;
    border-radius: 16px; overflow: hidden;
    border: 2px solid rgba(212, 194, 174, 0.25);
    background: #1C1008;
    transition: all .2s;
    -webkit-tap-highlight-color: transparent;
}
.cb-select-card input { position: absolute; opacity: 0; width: 0; height: 0; }
@media (hover: hover) {
    .cb-select-card:hover { border-color: #D4C2AE; background: rgba(212, 194, 174, 0.07); }
}
.cb-select-card.is-selected {
    border-color: #F0E2BC;
    background: #F0E2BC;
    box-shadow: 0 0 20px rgba(240, 226, 188, 0.3);
}
/* Image pleine largeur */
.cb-select-card__img-wrap { width: 100%; aspect-ratio: 1; overflow: hidden; flex-shrink: 0; }
.cb-select-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Zone texte */
.cb-select-card__inner { padding: .8rem 1rem; text-align: center; pointer-events: none; }
.cb-select-card__icon { font-size: 2rem; margin-bottom: .6rem; color: #D4C2AE; }
.cb-select-card__name { font-size: .9rem; font-weight: 600; color: #F0E2BC; margin-bottom: .35rem; }
.cb-select-card__price { font-size: .85rem; color: #D4C2AE; }
.cb-select-card.is-selected .cb-select-card__name { color: #1C1008; font-weight: 700; }
.cb-select-card.is-selected .cb-select-card__icon { color: #1C1008; }
.cb-select-card.is-selected .cb-select-card__price { color: #1C1008; }

/* ── Grille produits quantité ────────────────────────────────────────────────── */
.cb-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ── Mobile : 2 colonnes pour cards et grilles quantité ──────────────────────── */
@media (max-width: 576px) {
    .cb-select-cards-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
    .cb-products-grid     { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
    .cb-select-card__icon { font-size: 1.6rem; margin-bottom: .4rem; }
    .cb-product-card__body { padding: .7rem; }
}
.cb-product-card {
    background: #1C1008;
    border: 1px solid rgba(240, 226, 188, 0.12);
    border-radius: 16px;
    overflow: hidden;
    text-align: center;
    transition: border-color .2s, box-shadow .2s;
}
@media (hover: hover) {
    .cb-product-card:hover { border-color: rgba(212, 194, 174, 0.25); }
}
.cb-product-card.has-qty {
    border-color: #F0E2BC;
    background: #F0E2BC;
    box-shadow: 0 0 16px rgba(240, 226, 188, 0.3);
}
.cb-product-card.has-qty .cb-product-card__name,
.cb-product-card.has-qty .cb-product-card__price,
.cb-product-card.has-qty .cb-qty-value { color: #1C1008; }
.cb-product-card.has-qty .cb-qty-btn { color: #1C1008; border-color: rgba(28, 16, 8, 0.35); }
.cb-product-card.has-qty .cb-qty-btn:hover { background: #1C1008; color: #F0E2BC; }
.cb-product-card__img-wrap { width: 100%; aspect-ratio: 1; overflow: hidden; }
.cb-product-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cb-product-card__body { padding: 1rem; }
.cb-product-card__name { font-size: .9rem; font-weight: 600; color: #F0E2BC; margin-bottom: .4rem; }
.cb-product-card__price {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.1rem;
    color: #D4C2AE;
    font-weight: 700;
    margin-bottom: .75rem;
}
.cb-product-card__qty { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.cb-qty-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(212, 194, 174, 0.25);
    background: transparent;
    color: #D4C2AE;
    font-size: 1rem;
    cursor: pointer;
    transition: all .15s;
    display: flex; align-items: center; justify-content: center; line-height: 1;
    -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
    .cb-qty-btn:hover { background: #D4C2AE; color: #0D0905; }
}
.cb-qty-value { font-size: 1rem; font-weight: 700; color: #F0E2BC; min-width: 1.5rem; text-align: center; }

/* ── Layout « Quantité sans image » : dense, 4 colonnes, typo réduite ────────── */
.cb-products-grid--compact { grid-template-columns: repeat(4, 1fr); gap: .6rem; }
/* Carte en colonne pleine hauteur : le bloc quantité est collé en bas pour
   aligner tous les +/− sur une même ligne (harmonisation de hauteur). */
.cb-product-card--noimg { display: flex; flex-direction: column; height: 100%; }
.cb-product-card--noimg .cb-product-card__body { display: flex; flex-direction: column; flex: 1; padding: .7rem .6rem; }
.cb-product-card--noimg .cb-product-card__name { font-size: .8rem; margin-bottom: .25rem; }
.cb-product-card--noimg .cb-product-card__price { font-size: .9rem; margin-bottom: .5rem; }
.cb-product-card--noimg .cb-product-card__qty { margin-top: auto; gap: .35rem; }
.cb-product-card--noimg .cb-qty-btn { width: 24px; height: 24px; font-size: .9rem; }

/* Groupes d'ingrédients en mode compact (étape 1) */
.cb-qty-list--compact { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.cb-qty-list--compact .cb-qty-row { flex-direction: column; align-items: stretch; gap: .5rem; text-align: center; padding: .55rem .5rem; }
.cb-qty-list--compact .cb-qty-name { font-size: .8rem; text-align: center; }
.cb-qty-list--compact .cb-qty-ctrl { justify-content: center; }

@media (max-width: 900px) {
    .cb-products-grid--compact { grid-template-columns: repeat(3, 1fr); }
    .cb-qty-list--compact { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
    .cb-products-grid--compact { grid-template-columns: repeat(2, 1fr); }
    .cb-qty-list--compact { grid-template-columns: repeat(2, 1fr); }
}

/* ── Actions d'étape ─────────────────────────────────────────────────────────── */
.cb-step__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(240, 226, 188, 0.12);
}
.cb-step__actions--recap { justify-content: space-between; }
.cb-step__actions-right { display: flex; align-items: center; gap: .75rem; margin-left: auto; }

/* ── Boutons ─────────────────────────────────────────────────────────────────── */
.cb-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.6rem;
    border-radius: 9999px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .2s;
    text-decoration: none;
}
.cb-btn:active { transform: scale(.98); }

.cb-btn--primary { background: #3B1A09; color: #F0E2BC; border: 1px solid rgba(212, 194, 174, 0.25); }
.cb-btn--primary:hover { background: #D4C2AE; color: #0D0905; }

.cb-btn--gold { background: #D4C2AE; color: #0D0905; border: none; }
.cb-btn--gold:hover { background: #F0E2BC; color: #0D0905; }
.cb-btn--gold:disabled { background: rgba(212, 194, 174, 0.25); cursor: not-allowed; opacity: .6; }

.cb-btn--ghost { background: transparent; color: #9E8A63; border: 1px solid rgba(240, 226, 188, 0.12); }
.cb-btn--ghost:hover { border-color: rgba(212, 194, 174, 0.25); color: #F0E2BC; }

.cb-btn__arrow { transition: transform .2s; }
.cb-btn:hover .cb-btn__arrow { transform: translateX(4px); }

.cb-btn__spinner {
    display: none;
    width: 14px; height: 14px;
    border: 2px solid rgba(0,0,0,0.3);
    border-top-color: #0D0905;
    border-radius: 50%;
    animation: cb-spin .6s linear infinite;
}
.cb-btn.is-loading .cb-btn__spinner { display: block; }

@keyframes cb-spin { to { transform: rotate(360deg); } }

/* ── Récapitulatif ───────────────────────────────────────────────────────────── */
.cb-recap {
    background: #1C1008;
    border: 1px solid rgba(212, 194, 174, 0.25);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.cb-recap__section { padding: 1rem 1.2rem; border-bottom: 1px solid rgba(240, 226, 188, 0.12); }
.cb-recap__section:last-child { border-bottom: none; }
.cb-recap__section-title {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #D4C2AE;
    margin: 0 0 .6rem;
}
.cb-recap__item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: .9rem;
    color: #F0E2BC;
    padding: .2rem 0;
}
.cb-recap__item-meta { font-size: .8rem; color: #9E8A63; margin-top: .2rem; }
.cb-recap__price { color: #D4C2AE; font-weight: 600; flex-shrink: 0; margin-left: 1rem; }
.cb-recap__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #F0E2BC;
}
#cb-recap-total {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #D4C2AE;
}

/* ── Ingrédients layout : qty (lignes) ───────────────────────────────────────── */
.cb-qty-list { display: flex; flex-direction: column; gap: .5rem; }
.cb-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem .75rem;
    border: 1px solid rgba(240, 226, 188, 0.12);
    border-radius: 8px;
    background: #1C1008;
}
.cb-qty-name { font-size: .9rem; color: #F0E2BC; flex: 1; }
.cb-qty-name i { margin-right: .4rem; color: #9E8A63; }
.cb-qty-ctrl { display: flex; align-items: center; gap: .5rem; }
/* Ligne quantité active (au moins 1) : contraste inversé */
.cb-qty-row--active { background: #F0E2BC; border-color: #F0E2BC; }
.cb-qty-row--active .cb-qty-name,
.cb-qty-row--active .cb-qty-name i,
.cb-qty-row--active .cb-qty-value { color: #1C1008; }
.cb-qty-row--active .cb-qty-btn { color: #1C1008; border-color: rgba(28, 16, 8, 0.35); }
@media (hover: hover) {
    .cb-qty-row--active .cb-qty-btn:hover { background: #1C1008; color: #F0E2BC; }
}

/* ── Ornement ────────────────────────────────────────────────────────────────── */
.cb-ornament {
    text-align: center;
    padding: 2rem;
    color: #9E8A63;
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: .9rem;
    letter-spacing: .08em;
}
