:root {
    /* --- images width and height --- */
    --widget-item-width_five: 13em;
}

/* --- parent container --- */
.container-dynamic-items-widget_five {
    width: 100%;
    margin-top: 5px;
    height: auto;
}

/* --- main title widget  --- */
.container-widget-dynamic-items_five h3 {
    text-align: center;
    margin-bottom: 0px !important;
    font-size: 2em;
    font-weight: bold;
}

.container-widget-item_five {
    display: flex;
    flex-direction: column;
    padding: 5px 10px;
    margin: 5px 0px 5px 5px;
    box-sizing: border-box;
}

.container-widget-item_five a {
    border-bottom: none !important;
}

.container-widget-name_five {
    color: white;
    text-align: center;
    font-size: 1.5em;
    margin: 0;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---Denumire 1, Denumire 2 --- */
.container-widget-link-name_five {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1; /* Aligns the name vertically */
    margin-top: 10px;
    width: 100%;
}

.container-widget-image_five {
    display: flex;
    justify-content: center;
    align-items: center;
}

.rectangular-shape-item_five {
    width: 100%;
    background: unset !important;
}

.rectangular-shape-item_five img {
    object-fit: contain;
    width: var(--widget-item-width_five);
    height: var(--widget-item-width_five);
    border-radius: 3px;
    display: block;
    margin: 0 auto;
}

.container-widget-description_five {
    margin-top: 5px;
    text-align: initial;
    overflow: hidden;
}

/* --- DESKTOP VIEW --- */
@media screen and (min-width: 769px) {
    .container-dynamic-items-widget_five {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: stretch; /* Forces equal height for all 5 boxes */
        width: 100%;
    }

    .container-widget-item_five {
        flex: 0 0 20%; /* Five items = 20% each */
    }
}

/* --- MOBILE VIEW (Preserves Slider) --- */
@media screen and (max-width: 768px) {
    .container-widget-dynamic-items_five {
        overflow: auto;
    }

    .container-widget-dynamic-items_five h3 {
        font-size: 1.7em;
        margin-top: 20px !important;
        margin-bottom: 0px !important;
        position: sticky;
        top: 0;
        left: 0;
    }

    /* ---the container imgs --- */
    .container-dynamic-items-widget_five {
        display: inline-flex;
        width: auto;
        align-items: stretch;
    }

    .container-widget-item_five {
        width: 18em;
        flex: 0 0 auto;
        margin: 0px 5px 5px 5px;
        display: flex;
        flex-direction: column;
    }

    .container-widget-link-name_five {
        margin-top: 10px;
        flex-grow: 1;
    }

    /* --single img --*/
    .rectangular-shape-item_five img {
        object-fit: contain;
        width: auto; 
        height: auto;
        border-radius: 3px;
    }
}