/* Spliff — Product Loyalty Bar (page produit)
 * Bar visuel = layout screen 2 (camion + titre + barre + sous-titre + CTA),
 * la barre de progression intègre les 2 jalons (99€ / 169€) du modal.
 * Modal visuel = screen 1, sans la barre interne (déjà sur la barre).
 */

.spliff-pbar {
    --spliff-pbar-accent: #7C7CFF;
    --spliff-pbar-accent-soft: rgba(124, 124, 255, 0.15);

    box-sizing: border-box;
    width: 100%;
    background: transparent;
    padding: 10px 0;
    -webkit-tap-highlight-color: transparent;
}

.spliff-pbar *,
.spliff-pbar *::before,
.spliff-pbar *::after {
    box-sizing: border-box;
}

.spliff-pbar__row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.spliff-pbar__truck {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2px;
    color: #FFB347;
}

.spliff-pbar__content {
    flex: 1 1 auto;
    min-width: 0;
}

.spliff-pbar__title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: #0F0F10;
    margin: 0 0 8px 0;
}

.spliff-pbar__title strong {
    color: var(--spliff-pbar-accent);
    font-weight: 700;
}

/* Barre de progression — avec jalons internes (style modal) */
.spliff-pbar__progress {
    width: 100%;
    margin-bottom: 6px;
}

.spliff-pbar__track {
    position: relative;
    height: 10px;
    background: #E8E8EC;
    border-radius: 100px;
    overflow: visible;
}

.spliff-pbar__fill {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
    width: 0%;
    background: var(--spliff-pbar-accent);
    border-radius: 100px;
    transition: width 0.6s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 1;
}

.spliff-pbar__milestone {
    position: absolute;
    top: 50%;
    z-index: 2;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ancrages cohérents avec les libellés (gauche / centre / droite) */
.spliff-pbar__milestone--start {
    left: 0%;
    transform: translate(0, -50%);
}

.spliff-pbar__milestone--mid {
    /* left: <milestone1_pct>% (set inline) */
    transform: translate(-50%, -50%);
}

.spliff-pbar__milestone--end {
    left: 100%;
    transform: translate(-100%, -50%);
}

.spliff-pbar__milestone-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    padding: 0;
    background: transparent;
}

.spliff-pbar__milestone-plus {
    margin: 0 1px;
    color: var(--spliff-pbar-accent);
    font-weight: 700;
}

.spliff-pbar__milestone.is-reached .spliff-pbar__milestone-icon {
    filter: none;
}

/* Labels alignés avec les milestones (mêmes positions / mêmes ancrages) */
.spliff-pbar__labels {
    position: relative;
    height: 18px;
    margin-top: 12px;
    font-size: 12px;
    color: #7A7A7A;
    font-weight: 500;
}

.spliff-pbar__labels span {
    position: absolute;
    top: 0;
    line-height: 18px;
    white-space: nowrap;
}

/* Les labels start/end sont centrés sous le centre visuel de leur emoji.
   `--spliff-pbar-emoji-size` est exposée par le contrôle Elementor "Taille des emojis"
   et représente la largeur d'em-box de l'emoji ; on décale donc d'une demi-largeur
   pour aligner le centre du label avec le centre du glyph emoji. */
.spliff-pbar__labels span.is-start {
    left: calc(var(--spliff-pbar-emoji-size, 14px) / 2);
    transform: translateX(-50%);
}

.spliff-pbar__labels span.is-mid {
    /* left: <milestone1_pct>% (set inline) */
    transform: translateX(-50%);
}

.spliff-pbar__labels span.is-end {
    left: calc(100% - var(--spliff-pbar-emoji-size, 14px) / 2);
    transform: translateX(-50%);
}

/* Sous-titre */
.spliff-pbar__subtitle {
    font-size: 12px;
    color: #7A7A7A;
    margin-top: 8px;
    line-height: 1.4;
}

/* CTA principal */
.spliff-pbar__cta {
    display: block;
    width: 100%;
    background: var(--spliff-pbar-accent);
    color: #FFFFFF;
    border: 0;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: opacity 0.2s ease, transform 0.1s ease;
    font-family: inherit;
}

.spliff-pbar__cta:hover {
    opacity: 0.92;
}

.spliff-pbar__cta:active {
    transform: translateY(1px);
}

.spliff-pbar__cta:focus-visible {
    outline: 2px solid var(--spliff-pbar-accent);
    outline-offset: 2px;
}

/* ─── Modal (overlay bottom-sheet) ────────────────────────────────────── */

.spliff-pbar-overlay {
    --spliff-pbar-accent: #7C7CFF;

    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: background 0.3s ease;
    pointer-events: none;
}

.spliff-pbar-overlay.is-open {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.spliff-pbar-modal {
    position: relative;
    background: #FFFFFF;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 540px;
    max-height: 88vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 22px 20px 20px 20px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
}

.spliff-pbar-overlay.is-open .spliff-pbar-modal {
    transform: translateY(0);
}

@media (min-width: 720px) {
    .spliff-pbar-overlay {
        align-items: center;
    }
    .spliff-pbar-modal {
        border-radius: 18px;
        max-height: 84vh;
    }
}

.spliff-pbar-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.spliff-pbar-modal__title {
    font-size: 18px;
    font-weight: 800;
    color: #0F0F10;
    line-height: 1.3;
    flex: 1;
    padding-right: 12px;
    margin: 0;
}

.spliff-pbar-modal__close {
    background: none;
    border: 0;
    font-size: 24px;
    line-height: 1;
    color: #7A7A7A;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
}

.spliff-pbar-modal__sub {
    font-size: 13px;
    color: #5A5A5A;
    margin: 0 0 18px 0;
    line-height: 1.4;
}

.spliff-pbar-modal__sub strong {
    color: var(--spliff-pbar-accent);
    font-weight: 700;
}

.spliff-pbar-modal__products {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    min-height: 80px;
}

.spliff-pbar-modal__loading,
.spliff-pbar-modal__empty {
    text-align: center;
    color: #7A7A7A;
    font-size: 13px;
    padding: 28px 0;
}

/* Cartes produit */
.spliff-pbar-product {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1.5px solid #E8E8EC;
    border-radius: 12px;
    padding: 10px 12px;
    background: #FFFFFF;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.spliff-pbar-product:hover {
    border-color: var(--spliff-pbar-accent);
}

.spliff-pbar-product__img {
    position: relative;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #F4F4F4;
}

.spliff-pbar-product__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spliff-pbar-product__badge {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1.2;
    color: #FFFFFF;
    text-transform: uppercase;
}

.spliff-pbar-product__badge--cbd {
    background: #34C759;
}

.spliff-pbar-product__badge--thc {
    background: #FF9500;
}

.spliff-pbar-product__badge--thcx {
    background: #AF52DE;
}

.spliff-pbar-product__badge--accessoires {
    background: #8E8E93;
}

.spliff-pbar-product__info {
    flex: 1;
    min-width: 0;
}

.spliff-pbar-product__name {
    font-size: 13px;
    font-weight: 700;
    color: #0F0F10;
    line-height: 1.3;
    margin: 0 0 6px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-decoration: none;
}

.spliff-pbar-product__name a {
    color: inherit;
    text-decoration: none;
}

.spliff-pbar-product__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #5A5A5A;
}

.spliff-pbar-product__rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.spliff-pbar-product__star {
    color: #34C759;
    font-size: 13px;
    line-height: 1;
}

.spliff-pbar-product__price {
    font-weight: 700;
    color: #0F0F10;
    font-style: italic;
}

.spliff-pbar-product__add {
    flex-shrink: 0;
    background: var(--spliff-pbar-accent);
    color: #FFFFFF;
    border: 0;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: opacity 0.15s ease;
    font-family: inherit;
}

.spliff-pbar-product__add:hover {
    opacity: 0.92;
}

.spliff-pbar-product__add[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.spliff-pbar-product__add.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Footer modal — bouton J'ai fait mon choix */
.spliff-pbar-modal__done {
    display: block;
    width: 100%;
    margin-top: 6px;
    background: var(--spliff-pbar-accent);
    color: #FFFFFF;
    border: 0;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: opacity 0.2s ease;
    font-family: inherit;
}

.spliff-pbar-modal__done:hover {
    opacity: 0.92;
}
