body.pb-dragging {
    overflow: hidden;
    touch-action: none;
}

.pb-brick {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

div:not(.filled)>.pb-brick[data-in-pyramid='true'] {
    opacity: 0.3;
    pointer-events: none;
}

.pb-brick {
    touch-action: manipulation;
    padding: 5px 10px;
}

.pb-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 40px;
}

.pb-inner-wrapper {
    display: grid;
    grid-template-areas:
        'bricks bricks bricks'
        'pyramid pyramid total';
    gap: 30px;
    width: 100%;
}

.pb-bricks {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-area: bricks;
    gap: 15px;
}

.pb-brick:first-child {
    grid-row: 1/3;
}

.pb-brick.used {
    opacity: 0.3;
    pointer-events: none;
}

.pb-old-price {
    text-decoration: line-through;
    font-weight: 500;
}

.pb-price {
    font-weight: 700;
}

.pb-pyramid {
    width: 100%;
    grid-area: pyramid;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
    background: #DC7D6E;
    -webkit-clip-path: polygon(50% 0, 0 100%, 100% 100%);
    clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.pb-level {
    display: flex;
    justify-content: center;
    width: 100%;
}

.pb-level .pb-slot {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
    padding: 5px 10px;
    box-sizing: content-box;
}

.pb-level:has(.pb-slot.filled) {
    background: #ffffff50;
}

.pb-brick {
    width: 100%;
    height: 80px;
    cursor: grab;
    box-sizing: border-box;
    border: 2px solid var(--e-global-color-primary);
    background: var(--e-global-color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.pb-brick.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pb-slot.filled .pb-brick {
    border: none;
    background: transparent;
}

.pb-base {
    height: 80px;
    font-weight: bold;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--black);
    background: #ffffff50;
}

.pb-base a {
    color: var(--black);
}

.pb-base a:hover {
    color: var(--e-global-color-primary);
}

.pb-summary {
    grid-area: total;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-family: 'Heebo', sans-serif;
    font-weight: 500;
}

.pb-total {
    display: block;
    text-align: center;
}

.pb-validate {
    display: block;
    background: var(--e-global-color-tertiary);
    color: var(--white);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 0;
    border: none;
    cursor: pointer;
    overflow: hidden;
    font-size: 20px;
    font-weight: 500;
    font-family: 'Heebo', sans-serif;
}

.pb-validate::before {
    position: absolute;
    content: '';
    display: inline-block;
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%;
    background: #ffffff50;
    transition: all 0.3s;
    z-index: 0;
}

.pb-validate:hover::before {
    left: 0;
}

.pb-validate:hover {
    color: var(--black);
}

.pb-validate-content {
    z-index: 1;
}

.pb-remove {
    position: absolute;
    right: -20px;
    top: 30px;
    cursor: pointer;
    font-weight: bold;
    color: var(--black);
    background: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 16px;
    font-size: 16px;
}

.info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
}

.pb-brick {
    user-select: none;
}

.pb-brick input {
    user-select: auto;
}

.pb-qty {
    width: 50px;
    border: 2px solid var(--e-global-color-primary);
    color: var(--black);
}

.pb-slot.filled .pb-qty {
    background: #ffffff50;
}

.offer {
    font-weight: bold;
    color: var(--e-global-color-primary);
}

@media screen and (max-width: 1024px) {
    .pb-inner-wrapper {
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
        /* empêche le scroll horizontal de l’ensemble */
    }

    .pb-pyramid {
        clip-path: none !important;
        width: 100%;
    }

    .pb-slot {
        width: 100% !important;
    }

    /* =========================
       BRICKS HORIZONTAL SCROLL MOBILE
    ========================== */
    .pb-bricks {
        display: flex;
        gap: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* scroll fluide sur iOS */
        scrollbar-width: thin;
        /* Firefox */
        width: 100%;
        padding-bottom: 10px;
    }

    .pb-bricks::-webkit-scrollbar {
        height: 6px;
    }

    .pb-bricks::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 3px;
    }

    .pb-brick {
        flex: 0 0 auto;
        /* empêche la briques de s’étirer */
        width: 200px;
        /* largeur fixe adaptée mobile */
    }
}