/**
 * Shop Filters Styles
 * Price Range Slider + Custom Dropdowns
 */

/* Shop Page: Always show product-card__buttons (no hover required) */
.products-list .product-card .product-card__buttons {
	display: -ms-flexbox !important;
	display: flex !important;
	opacity: 1 !important;
	visibility: visible !important;
}

.products-list .product-card:hover {
	margin-bottom: 0 !important;
}

@media (hover:hover) {
	.products-list .product-card .product-card__buttons {
		display: -ms-flexbox !important;
		display: flex !important;
	}
	
	.products-list .product-card:hover {
		margin-bottom: 0 !important;
	}
}

@media (-ms-high-contrast:none),
screen and (-ms-high-contrast:active) {
	.products-list .product-card .product-card__buttons {
		display: -ms-flexbox !important;
		display: flex !important;
	}
	
	.products-list .product-card:hover {
		margin-bottom: 0 !important;
	}
}

/* Shop Page: Hide quickview spinner (no preload animation) */
.products-list .product-card__quickview--preload {
	color: inherit !important;
}

.products-list .product-card__quickview--preload:after {
	display: none !important;
}

/* Price Filter Slider Container */
.filter-price__slider {
	position: relative;
	width: 100%;
	margin: 20px 0;
}

.filter-price__slider-wrapper {
	position: relative;
	width: 100%;
	height: 40px;
	display: flex;
	align-items: center;
}

/* Double Range Slider - Two overlapping range inputs */
.filter-price__range-inputs {
	position: relative;
	width: 100%;
	height: 6px;
	background: #e5e5e5;
	border-radius: 3px;
	margin: 0;
}

.filter-price__range-inputs input[type="range"] {
	position: absolute;
	width: 100%;
	height: 6px;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0;
	top: -6px;
}

/* Track styling (shared) */
.filter-price__range-inputs input[type="range"]::-webkit-slider-runnable-track {
	width: 100%;
	height: 6px;
	background: transparent;
	border: none;
	border-radius: 3px;
}

.filter-price__range-inputs input[type="range"]::-moz-range-track {
	width: 100%;
	height: 6px;
	background: transparent;
	border: none;
	border-radius: 3px;
}

/* Thumb styling */
.filter-price__range-inputs input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	background: #fff;
	border: 2px solid #217076;
	border-radius: 50%;
	cursor: pointer;
	pointer-events: all;
	position: relative;
	z-index: 2;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	transition: box-shadow 0.2s ease;
}

.filter-price__range-inputs input[type="range"]::-webkit-slider-thumb:hover {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.filter-price__range-inputs input[type="range"]::-webkit-slider-thumb:active {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.filter-price__range-inputs input[type="range"]::-moz-range-thumb {
	width: 18px;
	height: 18px;
	background: #fff;
	border: 2px solid #217076;
	border-radius: 50%;
	cursor: pointer;
	pointer-events: all;
	position: relative;
	z-index: 2;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	transition: box-shadow 0.2s ease;
}

.filter-price__range-inputs input[type="range"]::-moz-range-thumb:hover {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.filter-price__range-inputs input[type="range"]::-moz-range-thumb:active {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Range fill (active area between min and max) */
.filter-price__range-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 6px;
	background: rgba(17, 112, 118, 1);
	border-radius: 3px;
	pointer-events: none;
	z-index: 1;
}

/* Ensure min range is above max range for proper z-index handling */
.filter-price__range-min {
	z-index: 3;
}

.filter-price__range-max {
	z-index: 2;
}

/* Hide number inputs on desktop when slider is active (but keep them for accessibility) */
.filter-price__inputs {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
}

.filter-price__inputs input[type="number"] {
	width: 80px;
	padding: 6px 8px;
	border: 1px solid #ddd;
	border-radius: 2px;
	font-size: 14px;
}

/* Responsive: Show inputs more prominently on mobile */
@media (max-width: 768px) {
	.filter-price__slider {
		margin: 16px 0;
	}
	
	.filter-price__inputs {
		margin-top: 16px;
	}
	
	.filter-price__inputs input[type="number"] {
		width: 100px;
	}
}

/* Focus states for accessibility */
.filter-price__range-inputs input[type="range"]:focus {
	outline: none;
}

.filter-price__range-inputs input[type="range"]:focus::-webkit-slider-thumb {
	box-shadow: 0 0 0 3px #2170766a;
}

.filter-price__range-inputs input[type="range"]:focus::-moz-range-thumb {
	box-shadow: 0 0 0 3px #2170766a;
}

/* Shop Toolbar Form (for sort/per_page) */
.view-options__form {
	display: -ms-flexbox;
	display: flex;
	-ms-flex-align: center;
	align-items: center;
	font-size: 15px;
	margin: 0;
	padding: 0;
	border: none;
	background: none;
}

/* Ensure form doesn't break layout */
.view-options__form .view-options__control {
	margin-left: 24px;
}

@media (max-width:767px) {
	.view-options__form {
		-ms-flex-wrap: wrap;
		flex-wrap: wrap;
	}
}

/* Custom Dropdown Styles */
.custom-dropdown {
	position: relative;
	width: 100%;
	min-width: 150px;
}

.custom-dropdown__button {
	width: 100%;
	padding: 8px 32px 8px 12px;
	border: 1px solid #ddd;
	border-radius: 2px;
	background: #fff;
	color: #333;
	font-size: 14px;
	text-align: left;
	cursor: pointer;
	position: relative;
	transition: border-color 0.2s ease;
}

.custom-dropdown__button:hover {
	border-color: #999;
}

.custom-dropdown__button:focus {
	outline: none;
	border-color: #1a66ff;
	box-shadow: 0 0 0 3px rgba(26, 102, 255, 0.1);
}

/* Caret arrow */
.custom-dropdown__button::after {
	content: '';
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 5px solid #666;
	transition: transform 0.2s ease;
}

.custom-dropdown--open .custom-dropdown__button::after {
	transform: translateY(-50%) rotate(180deg);
}

/* Dropdown list */
.custom-dropdown__list {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 999;
	display: none;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 2px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	list-style: none;
	margin: 0;
	padding: 4px 0;
	max-height: 250px;
	overflow-y: auto;
}

.custom-dropdown--open .custom-dropdown__list {
	display: block;
}

/* Dropdown items */
.custom-dropdown__item {
	display: block;
	padding: 8px 12px;
	color: #333;
	font-size: 14px;
	cursor: pointer;
	transition: background-color 0.15s ease;
	border: none;
	background: none;
	width: 100%;
	text-align: left;
}

.custom-dropdown__item:hover,
.custom-dropdown__item:focus {
	background-color: #f5f5f5;
	outline: none;
}

.custom-dropdown__item--selected {
	background-color: #e8f0fe;
	color: rgba(17, 112, 118, 1);
	font-weight: 500;
}

.custom-dropdown__item--selected:hover,
.custom-dropdown__item--selected:focus {
	background-color: #d2e3fc;
}

/* Keyboard focus state */
.custom-dropdown__item:focus {
	outline: 2px solid #1a66ff;
	outline-offset: -2px;
}

/* Filter list item: active/selected state (rehydration from URL) */
.filter-list__item.is-active {
	background-color: rgba(17, 112, 118, 0.08);
	border-radius: 4px;
}

.filter-list__item.is-active .filter-list__title {
	color: rgba(17, 112, 118, 1);
	font-weight: 500;
}

/* Filter block has selection (optional highlight) */
.filter.filter--has-selection .filter__title {
	color: rgba(17, 112, 118, 1);
}
