/*
 * Save as: woodmart-child/assets/css/sort-pills.css
 * Enqueued by tfn_sort_enqueue_assets() in functions.php
 */

.tfn-sort-wrap {
	direction: rtl;
	margin: 0 0 24px;
}

/* ---------- Desktop / tablet pill row (single line) ---------- */

.tfn-sort-wrap {
	position: relative;
}

.tfn-sort-pills-row {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	width: 100%;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.tfn-sort-pills-row::-webkit-scrollbar {
	display: none;
}

/* Fade hint on the scroll-start edge (right side in RTL) so it reads as
   "more items this way" instead of looking cut off. Purely decorative —
   doesn't block clicks. */
.tfn-sort-wrap::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 28px;
	height: calc(100% - 9px);
	background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
	pointer-events: none;
}

@media (max-width: 767px) {
	.tfn-sort-wrap::before {
		display: none;
	}
}

.tfn-sort-pill {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	padding: 8px 18px;
	border-radius: 999px;
	border: 1px solid #e2e2e2;
	background: #fff;
	color: #333;
	font-size: 13px;
	line-height: 1.6;
	white-space: nowrap;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.tfn-sort-pill:hover {
	border-color: #c9a35a;
	color: #c9a35a;
	text-decoration: none;
}

/* ---------- Mobile trigger row (holds this + future trigger buttons, side by side, scrollable) ---------- */

.tfn-sort-trigger-row {
	display: none;
	flex-wrap: nowrap;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.tfn-sort-trigger-row::-webkit-scrollbar {
	display: none;
}

/* !important throughout: the theme applies its own global styling to every
   <button> element (often with !important itself), which otherwise wins
   even over a more specific class selector like this one. */
.tfn-sort-trigger {
	flex: 0 0 auto !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 9px 16px !important;
	border-radius: 999px !important;
	border: 1px solid #e2e2e2 !important;
	background: #fff !important;
	background-image: none !important;
	color: #333 !important;
	font-size: 13px !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	white-space: nowrap !important;
	box-shadow: none !important;
	cursor: pointer;
}

.tfn-sort-trigger:hover,
.tfn-sort-trigger:focus {
	background: #fff !important;
	color: #333 !important;
	border-color: #c9a35a !important;
}

.tfn-sort-trigger-label {
	max-width: 140px;
	overflow: hidden;
	text-overflow: ellipsis;
	color: inherit !important;
	font-size: inherit !important;
}

/* ---------- Mobile modal (bottom sheet) ---------- */

.tfn-sort-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: none;
}

.tfn-sort-modal.is-open {
	display: block;
}

.tfn-sort-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	transition: opacity .25s ease;
}

.tfn-sort-modal.is-open .tfn-sort-modal-backdrop {
	opacity: 1;
}

.tfn-sort-modal-sheet {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	max-height: 75vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 18px 18px 0 0;
	box-shadow: 0 -6px 24px rgba(0, 0, 0, .15);
	transform: translateY(100%);
	transition: transform .28s cubic-bezier(.32, .72, 0, 1);
	padding-bottom: env(safe-area-inset-bottom, 0);
}

.tfn-sort-modal.is-open .tfn-sort-modal-sheet {
	transform: translateY(0);
}

.tfn-sort-modal-handle {
	width: 36px;
	height: 4px;
	border-radius: 3px;
	background: #e0e0e0;
	margin: 10px auto 0;
}

.tfn-sort-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px 16px;
	border-bottom: 1px solid #f0f0f0;
	font-size: 15px;
	font-weight: 600;
}

.tfn-sort-modal-close {
	background: none;
	border: none;
	padding: 6px;
	line-height: 0;
	color: #666;
	cursor: pointer;
}

.tfn-sort-modal-list {
	display: flex;
	flex-direction: column;
}

.tfn-sort-modal-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 15px 20px;
	border-bottom: 1px solid #f5f5f5;
	color: #333;
	font-size: 14px;
	text-decoration: none;
}

.tfn-sort-modal-item:last-child {
	border-bottom: none;
}

.tfn-sort-modal-item.is-active {
	color: #c9a35a;
	font-weight: 600;
}

/* ---------- Breakpoint: collapse pills into the trigger row on mobile ---------- */

@media (max-width: 767px) {
	.tfn-sort-pills-row {
		display: none;
	}

	.tfn-sort-trigger-row {
		display: flex;
	}
}

body.tfn-sort-modal-open {
	overflow: hidden;
}

/* ===================================================================
 * TFN Brand Collections — [tfn_brand_collections] shortcode
 * Save alongside this file (same enqueue as the sort pills), or as its
 * own stylesheet if you'd rather keep it separate — either works, this
 * block doesn't depend on anything above it.
 * =================================================================== */

.tfn-brandcol-wrap {
	direction: rtl;
	margin: 0 0 20px;
}

.tfn-brandcol-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.tfn-brandcol-label {
	flex: 0 0 auto;
	font-size: 14px;
	font-weight: 600;
	color: #333;
	white-space: nowrap;
}

.tfn-brandcol-pills {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	min-width: 0; /* required for flex children to actually shrink/scroll */
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: #cfcfcf transparent;
	padding-bottom: 4px;
}

.tfn-brandcol-pills::-webkit-scrollbar {
	height: 5px;
}

.tfn-brandcol-pills::-webkit-scrollbar-thumb {
	background: #cfcfcf;
	border-radius: 3px;
}

.tfn-brandcol-pills::-webkit-scrollbar-track {
	background: transparent;
}

.tfn-brandcol-pills::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 24px;
	height: calc(100% - 9px);
	background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
	pointer-events: none;
}

.tfn-brandcol-pill {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	padding: 8px 18px;
	border-radius: 999px;
	border: 1px solid #e2e2e2;
	background: #fff;
	color: #333;
	font-size: 13px;
	line-height: 1.6;
	white-space: nowrap;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.tfn-brandcol-pill:hover {
	border-color: #c9a35a;
	color: #c9a35a;
	text-decoration: none;
}

/* ---------- Brand Collections: mobile trigger + modal ---------- */

.tfn-brandcol-mobile {
	display: none;
}

.tfn-brandcol-trigger {
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 9px 16px !important;
	border-radius: 999px !important;
	border: 1px solid #e2e2e2 !important;
	background: #fff !important;
	background-image: none !important;
	color: #333 !important;
	font-size: 13px !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	white-space: nowrap !important;
	box-shadow: none !important;
	cursor: pointer;
}

.tfn-brandcol-trigger:hover,
.tfn-brandcol-trigger:focus {
	background: #fff !important;
	color: #333 !important;
	border-color: #c9a35a !important;
}

@media (max-width: 767px) {
	.tfn-brandcol-row {
		display: none;
	}

	.tfn-brandcol-mobile {
		display: block;
	}
}

.tfn-brandcol-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: none;
}

.tfn-brandcol-modal.is-open {
	display: block;
}

.tfn-brandcol-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	transition: opacity .25s ease;
}

.tfn-brandcol-modal.is-open .tfn-brandcol-modal-backdrop {
	opacity: 1;
}

.tfn-brandcol-modal-sheet {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	max-height: 75vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 18px 18px 0 0;
	box-shadow: 0 -6px 24px rgba(0, 0, 0, .15);
	transform: translateY(100%);
	transition: transform .28s cubic-bezier(.32, .72, 0, 1);
	padding-bottom: env(safe-area-inset-bottom, 0);
}

.tfn-brandcol-modal.is-open .tfn-brandcol-modal-sheet {
	transform: translateY(0);
}

.tfn-brandcol-modal-handle {
	width: 36px;
	height: 4px;
	border-radius: 3px;
	background: #e0e0e0;
	margin: 10px auto 0;
}

.tfn-brandcol-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px 16px;
	border-bottom: 1px solid #f0f0f0;
	font-size: 15px;
	font-weight: 600;
	direction: rtl;
}

.tfn-brandcol-modal-close {
	background: none;
	border: none;
	padding: 6px;
	line-height: 0;
	color: #666;
	cursor: pointer;
}

.tfn-brandcol-modal-list {
	display: flex;
	flex-direction: column;
	direction: rtl;
}

.tfn-brandcol-modal-item {
	display: block;
	padding: 15px 20px;
	border-bottom: 1px solid #f5f5f5;
	color: #333;
	font-size: 14px;
	text-decoration: none;
}

.tfn-brandcol-modal-item:last-child {
	border-bottom: none;
}

body.tfn-brandcol-modal-open {
	overflow: hidden;
}