.custom-filter-widget .pfw-button {
    outline: none !important;
    color: #fff !important;
    background-color: transparent !important;
    border: 1px solid;
    padding: calc(var(--tx) * 8) calc(var(--tx) * 30);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-color: rgba(188, 149, 81, 0.3) !important;
    font-size: calc(var(--tx) * 20) !important;
    border-radius: calc(var(--tx) * 10) !important;
    font-weight: 600;
    white-space: normal;
}

.custom-filter-widget .terms ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: calc(var(--tx) * 21);
    padding: 0;
}

.custom-filter-widget .terms-container {
    display: flex;
    justify-content: space-between;
    gap: calc(var(--tx) * 152) !important;
}

.custom-filter-widget .terms {
    width: 100%;
}

.post-portfolio-temp {
    aspect-ratio: 0.72;
}

.custom-filter-widget .portfolio_list_container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    margin-bottom: calc(var(--tx) * 83);
}

.terms-divider {
    width: 1px;
    background: #bc9551;
}

@media (min-width:767px) and (max-width:1024px) {
    .custom-filter-widget {
        gap: 25px;
    }
}

.custom-filter-widget {
    display: flex;
    flex-direction: column;
    gap: calc(var(--tx) * 80)
}

.custom-filter-widget .filter-footer {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    margin-top: calc(var(--tx) * 50);
}

.custom-filter-widget .department_title {
    font-weight: 600;
    font-size: calc(var(--tx) * 20) !important;
}

.custom-filter-widget .terms-selected-container {
    color: #5b5b5b;
}

.custom-filter-widget #filter-submit {
    background: #bc9551;
    border-radius: 5px;
    color: #fff;
    font-weight: 900;
    padding: 8px 18px
}

.department-main-btn {
    margin-bottom: calc(var(--tx) * 24) !important;
    width: fit-content;
    border-radius: 5px;
    font-weight: 800;
    font-size: calc(var(--tx) * 25) !important;
}

@media(min-width:767px) and (max-width:1024px) {
    .custom-filter-widget .terms-container ul {
        grid-template-columns: 1fr 1fr 1fr !important;
    }
}

@media(max-width:767px) {
    .custom-filter-widget .terms {
        width: 100%;
    }

    .custom-filter-widget {
        gap: 10px;
    }

    .custom-filter-widget .terms-container {
        gap: 10px;
        flex-direction: column !important;
    }

    .custom-filter-widget .department_btn,
    #filter-submit,
    .custom-filter-widget .department-main-btn {
        border-radius: 5px !important;
        font-size: calc(var(--tx) * 10) !important;
    }

    .custom-filter-widget .pfw-button {
        font-size: calc(var(--tx) * 10) !important;
        padding: calc(var(--tx) * 15) calc(var(--tx) * 5);
    }

    #filter-submit {
        margin-top: 20px;
    }

    .filter-footer {
        margin-top: 20 !important;
        justify-content: center !important;
    }

    .custom-filter-widget .terms-container ul {
        grid-template-columns: 1fr 1fr 1fr !important;
    }

    /* This new rule makes our new wrapper the scroller */
    .adp-mobile-scroll-wrapper {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        gap: 16px;
        padding: 0;
    }
    
    .elementor-widget-adp_portfolio_filter .portfolio_list_container {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        overflow-y: hidden !important;
        gap: 16px;
        padding: 0;
        grid-template-columns: none !important;
        margin-bottom: 20px;
    }

    .custom-filter-widget .portfolio_list_container {
        grid-template-columns: 1fr 1fr !important;
    }

    .custom-filter-widget .post-portfolio-temp {
        margin: auto;
    }


    .responsive-items-container {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;

        gap: 16px;
        padding: 0 0;
    }

    .responsive-items-container::-webkit-scrollbar,
    .responsive-items-container::-webkit-scrollbar-thumb,
    .responsive-items-container::-webkit-scrollbar-track {
        background: initial !important;
        width: auto !important;
        height: auto !important;
    }

    .responsive-items-container .elementor-4173 {

        min-width: 65% !important;
        scroll-snap-align: start !important;
        flex-shrink: 0 !important;
    }

    .responsive-items-container .elementor-4173:first-child {
        margin-left: 16px !important;
    }

    .responsive-items-container .elementor-4173:last-child {
        margin-right: 16px !important;
    }

    .swiper-pagination {
        text-align: center;
        margin-top: 12px;
    }

    .custom-filter-widget .terms ul {
        gap: calc(var(--tx) * 12);
    }

    #adp-pagination-container {
        display: flex;
        justify-content: center;
        margin-top: 10px;
    }

    /* Style the load more button as the last item in the slider */
    #adp-load-more {
        flex-shrink: 0; /* Prevent the button from shrinking */
        min-width: 65%; /* Make it the same width as a portfolio item */
        margin-left: 16px;
        margin-right: 16px; /* Margin for the last item */
        scroll-snap-align: start !important;
    }
}

.responsive-items-container {
    column-gap: calc(var(--tx) * 62);
    row-gap: calc(var(--tx) * 83)
}

/* --- Loading Spinner Styles --- */

/* This style is temporarily added to the container to center the spinner */
.custom-filter-widget .portfolio_list_container.adp-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px; /* Gives the container some height so the spinner is visible */
}

/* This centers the spinner in the new main wrapper */
#adp-lists-wrapper.adp-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* This is the spinner itself */
.custom-filter-widget .adp-spinner {
  border: 5px solid #f3f3f3; /* Light grey circle */
  border-top: 5px solid #bc9551; /* THE COLOR YOU WANTED */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: adp-spin 1s linear infinite;
}

/* This is the rotation animation */
@keyframes adp-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#adp-pagination-container {
    text-align: center;
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#adp-load-more {
    /* Uses the .pfw-button styles by default */
    padding-left: calc(var(--tx) * 40); /* More padding for a bigger button */
    padding-right: calc(var(--tx) * 40);
}