/* Postavljanje sekcija u istu ravninu */
.layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.filter-section {
    max-width: 300px;
    background: color-mix(in srgb, var(--accent-color), transparent 90%);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px;
    /* Ostavlja 100px prostora od vrha ekrana */
    margin-bottom: 4rem;
}

.filter-section h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--nav-color);
    margin-bottom: 15px;
}

.filter-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 15px;
    color: var(--nav-color)
}

.filter-section input[type="text"],
.filter-section select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.filter-section input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.filter-section label {
    font-size: 1rem;
    color: var(--nav-color);
    cursor: pointer;
    padding: 0;
    margin-bottom: 0;
    display: inline; /* ili inline, odluči prema potrebi */
    align-items: center;
}


.filter-section .btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: 0.3s;
}

/* Apply */
.filter-section .btn-apply {
    background: var(--danger-color);
    color: var(--surface-color);
}
/*Reset*/
.filter-section .btn-reset {
    background: var(--surface-color);
    color: var(--danger-color);
}

.filter-section button:hover {
    opacity: 0.8;
}


.filter-badge {
    background-color: var(--accent-color);
    color: white;
    padding: 2px 10px;
    border-radius: 15px;
    margin: 2px;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.filter-badge span {
    margin-right: 5px;
}

.filter-badge i {
    font-size: 14px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .filter-section {
        position: relative;
        top: auto;
        width: 100%;
        max-width: 100%;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        box-shadow: none;
    }
    .filter-section input[type="text"] {
    margin: 0;
}
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
}

.filter-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 1.2em;
}

.filter-header i {
    margin-right: 8px;
}

.toggle-filter-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
}

/* Responsive prikaz: */
@media (max-width: 768px) {
    .toggle-filter-btn {
        display: inline-block;
    }

    #filterSection {
        max-height: 0;
        padding: 0 10px;
        overflow: hidden;
    }

    #filterSection.show {
        max-height: 1000px;
        /* dovoljno da stane sav sadržaj */
        transition: max-height 0.5s ease;
    }
}

/*novo*/
/* Dugme sa ikonicom i tekstom */
.toggle-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    background-color: color-mix(in srgb, var(--accent-color), transparent 90%);
    /* Bela unutrašnjost */
    color: var(--accent-color);
    /* Tekst i ikonica u boji akcenta */
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    width: 100%;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-bottom: -20px;
    outline: none;
    border: none;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    /* Ako postoji i border */
}

.toggle-filters i {
    font-size: 1.2rem;
}

.active-filter {
    color: var(--danger-color); /* ili npr. red */
}

/* Sakrivena sekcija sa animacijom */
.collapsible {
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.5s ease;
    max-height: 0;
    opacity: 0;
}

.collapsible.show {
    max-height: 2000px;
    /* dovoljno veliko da stane ceo sadržaj */
    opacity: 1;
}

/* Samo za mobilne */
@media (min-width: 768px) {
    .toggle-filters {
        display: none;
    }

    .collapsible {
        max-height: none !important;
        opacity: 1 !important;
        overflow: visible;
    }
}







.products {
    width:75%;
    padding-top: 0;
    margin: 0;
}

.products .product-item {
    background-color: var(--surface-color);
    padding: 10px 10px 0px 10px;
    transition: all ease-in-out 0.3s;
    border-radius: 18px;
    height: 100%;
    border-bottom: 5px solid var(--surface-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); 
}

.products .product-item .image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    /* iseče sliku tako da popuni ceo okvir bez izobličenja */
    border-radius: 5px;
}

.products .product-item .price .old-price {
    font-size: 0.9em;
    opacity: 0.6;
    text-decoration: line-through;
    padding: 0;
    margin: 0;
}

.products .product-item .price .active-price {
    font-size: 1.3em;
    font-weight: bold;
    margin: 0;
    padding: 0;
}

.products .product-item .price .discount-price {
    font-size: 1.3em;
    color: var(--danger-color);
    font-weight: bold;
    margin: 0;
    padding: 0;
}

.products .product-item h3 {
    font-size: 1.3em;
    font-weight: 700;
    margin: 10px 0px;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.products .product-item .btn {
    background-color: var(--accent-color);
    color: var(--contrast-color);
    padding: 5px 15px;
    border: none;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: -2px 2px 4px var(--default-color);
}

.product-item .description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* broj linija */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    /* prilagodi po potrebi */
    min-height: 2.8em;
    /* 2 * line-height */
    margin: 0;
    color: color-mix(in srgb, var(--default-color), transparent 20%);
}

.badge-discount {
    position: absolute;
    right: 10px;
    background-color: var(--danger-color);
    color: var(--contrast-color);
    padding: 6px 12px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 5px;
    z-index: 10;
    box-shadow: -2px 2px 4px var(--default-color);
}

.badge-unavailable {
    position: absolute;
    right: 10px;
    background-color: var(--default-color);
    color: var(--contrast-color);
    padding: 6px 12px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 5px;
    z-index: 10;
    box-shadow: -2px 2px 4px var(--default-color);
}

.category-badge {
    display: inline-block;
    background-color: color-mix(in srgb, var(--accent-color), transparent 90%);
    color: var(--accent-color);
    font-size: 13px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 6px;
}




@media (min-width: 1365px) {
    .products .product-item:hover {
        transform: translateY(-10px);
        border-color: var(--accent-color);
    }

    .products .product-item:hover h3 {
        color: var(--accent-color);
    }
}   

@media (max-width: 767.98px) {
    .products{
        width: auto;
        padding: 0 40px 40px 40px;
    }
    .products .product-item .image img { 
    height: 280px;
    }
}
