.ndbp,
.ndbp *{
    box-sizing:border-box;
}

.ndbp{
    width:100%;
    overflow:hidden;
    background:#efefef;
    font-family:inherit;
}

.ndbp-row{
    width:100%;
    margin:0 auto;
    display:grid;
    align-items:stretch;
}

.ndbp--rtl .ndbp-row{ direction:rtl; }
.ndbp--ltr .ndbp-row{ direction:ltr; }

.ndbp-item{
    position:relative;
    min-width:0;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    color:inherit;
}

.ndbp-item:hover,
.ndbp-item:focus{
    color:inherit;
    text-decoration:none;
}

.ndbp-icon{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
}

.ndbp-icon img{
    display:block;
    width:64px;
    max-width:100%;
    height:auto;
    object-fit:contain;
}

.ndbp-item[style*="--ndbp-item-icon-width"] .ndbp-icon img{
    width:var(--ndbp-item-icon-width) !important;
}

.ndbp-title,
.ndbp-text{
    width:100%;
    margin-left:0;
    margin-right:0;
}

.ndbp--title-nowrap .ndbp-title{ white-space:nowrap; }
.ndbp--text-nowrap .ndbp-text{ white-space:nowrap; }

.ndbp-item::after{
    content:"";
    position:absolute;
    top:50%;
    display:none;
    height:154px;
    width:1px;
    background:rgba(20,23,28,.42);
    transform:translateY(calc(-50% + var(--ndbp-divider-y, 0px)));
    pointer-events:none;
}

.ndbp--rtl .ndbp-item::after{
    left:calc(0px + var(--ndbp-divider-x, 0px));
}

.ndbp--ltr .ndbp-item::after{
    right:calc(0px + var(--ndbp-divider-x, 0px));
}

.ndbp-item--custom-divider::after{
    height:var(--ndbp-item-divider-length, 154px) !important;
    --ndbp-divider-x:var(--ndbp-item-divider-x, 0px) !important;
    --ndbp-divider-y:var(--ndbp-item-divider-y, 0px) !important;
}

/* The last DOM item has no divider because there is nothing after it. */
.ndbp-item:last-child::after{
    display:none !important;
}

@media (min-width:1025px){
    .ndbp--div-desktop .ndbp-item:not(:last-child)::after{ display:block; }
}

@media (min-width:768px) and (max-width:1024px){
    .ndbp--div-tablet .ndbp-item:not(:last-child)::after{ display:block; }
}

@media (max-width:767px){
    /*
     * Mobile premium layout:
     * 2 + 2 + centered final item, compact and symmetrical.
     * Desktop/tablet rules remain untouched.
     */
    .ndbp{
        width:100%;
        max-width:100%;
        overflow:hidden;
        padding-top:18px !important;
        padding-right:10px !important;
        padding-bottom:18px !important;
        padding-left:10px !important;
    }

    .ndbp-row{
        width:100%;
        max-width:100% !important;
        min-width:0;
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        column-gap:0 !important;
        row-gap:0 !important;
        align-items:start;
        justify-items:stretch;
    }

    .ndbp-item{
        width:100%;
        max-width:100%;
        min-width:0;
        min-height:128px !important;
        padding:10px 4px !important;
        overflow:visible;
        justify-content:flex-start;
        align-items:center;
        text-align:center;
    }

    /* Keep the icon area identical in every cell for clean row alignment. */
    .ndbp-icon{
        width:100%;
        height:54px;
        max-width:100%;
        min-width:0;
        margin-bottom:8px !important;
        display:flex;
        align-items:center;
        justify-content:center;
    }

    .ndbp-icon img{
        width:auto;
        max-width:58px !important;
        max-height:52px !important;
        height:auto;
        object-fit:contain;
    }

    /*
     * Mobile must always stay on one line.
     * Responsive clamp keeps long Hebrew copy inside a half-width cell.
     */
    .ndbp-title,
    .ndbp--title-nowrap .ndbp-title{
        width:100%;
        max-width:100%;
        min-width:0;
        margin-left:0;
        margin-right:0;
        white-space:nowrap !important;
        overflow:visible;
        overflow-wrap:normal !important;
        word-break:normal !important;
        text-wrap:nowrap !important;
        font-size:clamp(11px,3.55vw,15px) !important;
        line-height:1.12 !important;
        margin-bottom:4px !important;
    }

    .ndbp-text,
    .ndbp--text-nowrap .ndbp-text{
        width:100%;
        max-width:100%;
        min-width:0;
        margin-left:0;
        margin-right:0;
        white-space:nowrap !important;
        overflow:visible;
        overflow-wrap:normal !important;
        word-break:normal !important;
        text-wrap:nowrap !important;
        font-size:clamp(10.5px,3.25vw,14px) !important;
        line-height:1.12 !important;
    }

    /* No dividers on mobile unless the widget switch explicitly enables them. */
    .ndbp--div-mobile .ndbp-item:not(:last-child)::after{
        display:block;
    }

    /* Existing explicit full-width option still works for even/custom layouts. */
    .ndbp-item--mobile-full{
        grid-column:1 / -1;
    }

    /*
     * For an odd number of benefits (e.g. 5), center the final card exactly
     * between the two columns instead of leaving it aligned to one side.
     */
    .ndbp-row > .ndbp-item:last-child:nth-child(odd){
        grid-column:1 / -1 !important;
        width:50% !important;
        max-width:50% !important;
        justify-self:center !important;
    }
}
