/*============================*/
/* Products List (CPT: produkt)
/*============================*/

.cg-products-list-wrapper {
    position: relative;
}

/* Filter bar */

.cg-products-filter-wrap {
    margin-bottom: 50px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    row-gap: 60px;
}

.cg-products-filter-cat,
.cg-products-filter-search {
    position: relative;
    flex-basis: 25%;
}

.cg-products-filter-cat::before {
    position: absolute;
    top: 50%;
    content: '';
    background-image: url('arrow-down.svg');
    width: 22px;
    height: 22px;
    right: 10px;
    background-size: 22px;
    margin-top: -11px;
    z-index: 2;
	pointer-events: none; /* keep select clickable under arrow */
}

#cg-products-category {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Select styling */
.cg-products-filter-cat select {
    border: 0px solid #cccccc;
    border-radius: 0 !important;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
    background: #f4f4f4;
    position: relative;
    z-index: 1;

    width: 100%;
    box-sizing: border-box;

    padding: 8px 60px 8px 8px0;     /* <-- space on the right for the arrow */
    white-space: nowrap;         /* prevent wrapping under the arrow */
    overflow: hidden;
    text-overflow: ellipsis;     /* show "…" if text is too long */
}

.cg-products-filter-cat select:focus {
    outline: none;
    border: 0px solid #cccccc;
}

.cg-products-filter-search input {
    background-color: #ffffff;
    border: 2px solid #000000 !important;
    border-radius: 0 !important;
    font-size: 14px;
	font-weight: 600;
	border-width: 0 0 2px 0 !important;

}

.cg-products-filter-search input:focus {
    outline: none;
    border: 2px solid #000000 !important;
	border-width: 0 0 2px 0 !important;
}

.cg-products-filter-search:after {
    position: absolute;
    top: 50%;
    content: '';
    background-image: url('../search-b.svg');
    width: 22px;
    height: 22px;
    right: 10px;
    background-size: 22px;
    margin-top: -11px;
    z-index: 0;
}

/* Placeholder styles */

.cg-products-filter-search input::-webkit-input-placeholder {
    font-weight: 600;
    text-transform: uppercase;
    color: #000000;
}
.cg-products-filter-search input::-moz-placeholder {
    font-weight: 600;
    text-transform: uppercase;
    color: #000000;
}
.cg-products-filter-search input:-ms-input-placeholder {
    font-weight: 600;
    text-transform: uppercase;
    color: #000000;
}
.cg-products-filter-search input::-ms-input-placeholder {
    font-weight: 600;
    text-transform: uppercase;
    color: #000000;
}
.cg-products-filter-search input::placeholder {
    font-weight: 600;
    text-transform: uppercase;
    color: #000000;
}

/* Results container + animation */

#cg-products-results {
    opacity: 0;
}

#cg-products-results.show {
    opacity: 1;
}

.cg-product-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.cg-product-item.show {
    opacity: 1;
    transform: translateY(0);
}

/* Grid layout (inner wrapper = .cg-products-list-grid) */

#cg-products-results .cg-products-list-grid {
    --columns: 3;
    --gap: 30px;
    --gap-count: calc(var(--columns) - 1);
    display: flex;
    gap: var(--gap);
    flex-wrap: wrap;
    row-gap: 60px;
}

#cg-products-results .cg-product-item {
    flex-basis: calc( (100% / var(--columns)) - (var(--gap) / var(--columns) * var(--gap-count)) );
}

/* Card content */

.cg-product-title {
    text-align: center;
    font-size: 24px;      /* updated */
    font-weight: 600;
    margin-bottom: 20px;  /* updated */
}

.cg-product-title a {
    color: #000000;
    transition: all 0.3s linear;
}

.cg-product-title a:hover {
    color: #112746;
}

/* Bottom content with product_info_buttons row */

.cg-product-content {
    background-color: #F8F8F8;
    color: #000000;
    font-size: 16px;
    padding: 20px;
    text-align: center;
}

/* Thumbnail image */

.cg-product-thumb img {
    width: 100%;
    max-height: 360px;
    height: 360px;
    -o-object-fit: cover;
       object-fit: cover;
    display: block;
}

/* Responsive columns / filters / title */

@media (max-width: 992px) {

    #cg-products-results .cg-products-list-grid {
        --columns: 2;
    }

    .cg-products-filter-wrap {
        justify-content: flex-start;
        gap: 20px;
    }

    .cg-products-filter-cat,
    .cg-products-filter-search {
        flex-basis: calc(50% - 10px);
    }
}

@media (max-width: 767px) {

    #cg-products-results .cg-products-list-grid {
        --columns: 1;
    }

    .cg-products-filter-wrap {
        justify-content: flex-start;
        gap: 15px;
        row-gap: 20px;
    }

    .cg-products-filter-cat,
    .cg-products-filter-search {
        flex-basis: 100%;
    }

    .cg-product-title {
        font-size: 20px;  /* mobile size */
        margin-bottom: 20px;
    }
}

/* Fix small typo in select padding (if not already fixed) */
.cg-products-filter-cat select {
    /* ... existing properties ... */
    padding: 8px 60px 8px 8px;  /* right space for arrow */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Load more button */

.cg-products-load-more-wrap {
    text-align: center;
    margin-top: 40px;
}

.cg-products-load-more {
    display: inline-block;
    font-size: 16px;
    font-weight: 400;
    text-decoration: underline !important;
    color: #000000;
    cursor: pointer;
    transition: opacity 0.2s ease;
	opacity: 0.7;
}

.cg-products-load-more:hover {
    opacity: 1;
}
