/* ============================================================================== #filters */

#filters h3 {
	margin-bottom: 1rem
}

#filters .row .col-title {
	width: 150px;
	max-width: 150px
}

.slider {
	margin: 0 10px;
}

#filters #brands {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
	gap: 5px 10px;
}

#filters #brands .form-check {
	margin: 0;
}

/* ====================== */

#filters .btn.btn-primary {
	background-color: transparent;
	position: relative;
}

#filters .btn.btn-primary::before {
	z-index: 0;
}

#filters .btn.btn-primary::after {
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2) 0%, rgba(0, 0, 0, 0.2) 100%);
	content: '';
	display: block;
	width: 100%;
	height: 100%;
	position: absolute;
	left: 0;
	top: 0;
	z-index: 1;
}

#filters .btn.btn-primary:hover:after {
	opacity: 0;
}

#filters .btn.btn-primary span {
	position: relative;
	z-index: 2;
}

#filters #filters-form #brands.col label.form-check-label{
	font-size:1rem;
}

#active-filters span.badge{
	font-size:14px

}

@media (min-width: 992px) {
	#filters .btn.min-width {
		min-width: 250px
	}
}

#filters hr {
	border-width: 1px;
	opacity: 1
}

@media (max-width: 767px) { 

	#filters {
		flex-direction: column;
		padding: 2rem 1rem;
	}

	#filters .container {
		padding: 0;
	}

	#filters h3 {
		text-align: center;
		margin-bottom: 1rem;
	}

	#filters .row {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}

	#filters .col-title {
		width: 100%;
		max-width: 100%;
		margin-bottom: 0.25rem;
		font-weight: 600;
	}

	#filters #brands {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
		gap: 5px;
	}

	#filters .form-check {
		margin-bottom: 0.25rem;
	}

	#filters input[type="number"] {
		width: 100% !important;
		margin-bottom: 0.5rem;
	}

	#filters .slider {
		width: 100% !important;
		margin: 0 0 1rem 0;
	}

	#filters .btn.min-width {
		width: 100%;
		text-align: center;
		min-width: unset;
	}

	#filters hr {
		margin: 1rem 0;
	}
} 



/* ====================== FILTERS ============================== */

@media (max-width: 992px) {

	#filters {
		flex-direction: column;
		margin-left: 1rem;
		margin-right: 1rem;
		padding: 1rem !important;
		max-width: calc(100% - 2rem);
		position: relative;
	}
}

@media (max-width: 767px) {


	#filters .row[data-slider] {
		padding: 0 10px; 
	}

	#filters .slider {
		width: 100%; 
		margin-bottom: 1rem;
	}

	#filters .container {
		padding: 0;
	}

	#filters h3 {
		text-align: center;
		margin-bottom: 1rem;
	}

	#filters .row {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}

	#filters .row .col-title {
		text-decoration:underline;
		font-weight: 600;
		width: 100%;
		max-width: 100%;
		margin-bottom: 0.25rem;
		
	}

	#filters #brands {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
		gap: 5px;
	}

	#filters .form-check {
		margin-bottom: 0.25rem;
	}

	#filters input[type="number"] {
		width: 100% !important;
		margin-bottom: 0.5rem;
	}

	#filters .slider {
		width: 100% !important;
		margin: 0 0 1rem 0;
	}

	#filters .btn.min-width {
		width: 100%;
		text-align: center;
		min-width: unset;
	}

	#filters hr {
		margin: 1rem 0;
	}

	#filters .row.tipe {
		flex-direction: row;
		gap: 0
	} 
}

/* =============================================================================
   KLIMATICY PAGE - SIDEBAR FILTER STYLES
   ============================================================================= */

/* --- Layout: prevent sidebar from stretching to card grid height --- */
#klimaticy-layout {
    align-items: flex-start;
}

/* --- Sidebar sticky behaviour on desktop --- */
@media (min-width: 992px) {
    #klimaticy-sidebar {
        align-self: flex-start;
    }
}

/* --- Filter panel box --- */
.sidebar-filters {
    background: #f7f6f3;
    border: solid 1px #babec8;
    box-shadow: 0 4px 12px rgba(0,0,0,.10);
    font-weight: 500;
    font-size: .85rem;
    padding: 1.25rem 1rem;
}

.sidebar-filters__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--sec-color);
    margin-bottom: 1rem;
}

.sidebar-filters__label {
    font-size: .88rem;
    color: var(--sec-color);
    display: block;
}

.sidebar-filters__section {
    margin-bottom: .25rem;
}

.sidebar-filters__divider {
    margin: .75rem 0;
    border-color: var(--border-light);
}

/* Brand checkboxes in 2-column grid */
.sidebar-filters__brands {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .3rem .5rem;
}

/* --- Range slider: track on top, two inputs side by side below --- */
.sf-slider-row {
    display: block;
    width: 100%;
}

.sf-slider-row .slider {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.sf-slider-inputs {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.sf-slider-inputs .min-val,
.sf-slider-inputs .max-val {
    width: 48%;
	max-width: 80px;
    text-align: center;
    padding-left: 4px;
    padding-right: 4px;
}

/* --- Mobile: sidebar slides in from left as overlay --- */
#toggle-filter-mobile {
    display: none;
}

@media (max-width: 991px) {

    #toggle-filter-mobile {
        display: inline-flex;
        align-items: center;
        gap: .4rem;
    }

    #klimaticy-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        /*width: min(320px, 90vw);*/
		width: 100%;
        height: 100vh;
        height: 100dvh; /* На мобилни браузъри 100vh включва зоната зад адрес-лентата —
                            когато тя е видима, долната част на панела (бутоните) се
                            озовава извън реално видимата площ. 100dvh следва истинската
                            видима височина. */
        z-index: 9999;
        overflow-y: auto;
        overflow-x: hidden;
        background: #fff;
        padding: 1rem .75rem;
        border-radius: 0 .9rem .9rem 0;
        box-shadow: 4px 0 20px rgba(0,0,0,.25);
        transform: translateX(-110%);
        transition: transform .3s ease;
    }
	
	body.sidebar-open{
		overflow:hidden
	}

    body.sidebar-open #klimaticy-sidebar {
        transform: translateX(0);
    }
}



#klimaticy-sidebar .noUi-horizontal {
	height: 0.25rem;
	margin: 1rem auto;
	max-width:90%
}
 
#klimaticy-sidebar .noUi-connect {
	background: var(--sec-color) 
} 

#klimaticy-sidebar .noUi-handle::before,
#klimaticy-sidebar .noUi-handle::after{
	display:none !important
}

#klimaticy-sidebar .noUi-touch-area,
#klimaticy-sidebar .noUi-handle,
#klimaticy-sidebar .noUi-handle::after, 
#klimaticy-sidebar .noUi-handle::before {
	width: .85rem !important;
	height:.85rem !important;
	border-radius:50%;
	background: var(--sec-color);
	overflow:hidden;
	border:none !important
}

.noUi-horizontal .noUi-handle {
	right: -0.5rem;
	top: -0.4rem;
}

/* Remove spin buttons from number inputs in the filter sidebar */
.sidebar-filters input[type="number"]::-webkit-inner-spin-button,
.sidebar-filters input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sidebar-filters input[type="number"] {
    -moz-appearance: textfield;
}

/* Close button inside sidebar — visible only on mobile */
#sidebar-close-btn {
    display: none;
}
 
@media (max-width: 991px) {
    #sidebar-close-btn {
		font-size: 2rem;
        font-weight: 600;
        color: var(--sec-color);
		
		display: flex;
		justify-content: center;
		align-items: center;
        gap: 0;
        width: 40px !important;
		height:40px !important;
        margin: auto 0 1rem auto;
        padding: 0  !important;
        background: none;
        border: solid 1px #babec8;
        border-radius: 50%;
       
        cursor: pointer;
    }
 
    #sidebar-close-btn:hover {
        background: #f0f0f0;
    }
 
    #sidebar-close-btn i {
        font-size: 1.1rem;
    }
}

/* =============================================================================
   SF PILL BUTTONS – BTU, Energy class, Origin
   ============================================================================= */

.sf-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

/* 3-column grid variant (BTU) */
.sf-pills--3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.sf-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    padding: 5px 12px !important;
    border: 1.5px solid #2d3d63 !important;
    border-radius: 999px !important;
    font-size: .78rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    user-select: none;
    transition: background .15s, border-color .15s, color .15s;
    color: #2d3d63 !important;
    background: #fff !important;
    white-space: nowrap;
    text-align: center;
    line-height: 1.3;
    margin: 0;
}

.sf-pill:hover {
    background: rgba(45, 61, 99, .09) !important;
}

.sf-pill.is-active,
.sf-pill:has(input:checked) {
    background: #2d3d63 !important;
    border-color: #2d3d63 !important;
    color: #fff !important;
}

.sf-pill input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
    border: none !important;
}

/* Clear link */
.sf-clear-link {
    font-size: .8rem;
    color: #888;
    text-decoration: underline;
}

.sf-clear-link:hover {
    color: var(--sec-color);
}

