/*
 * Save as: woodmart-child/assets/css/brand-collections.css
 * Enqueued by tfn_brandcol_enqueue_assets() in functions.php
 *
 * Self-contained: doesn't rely on sort-pills.css being loaded, even
 * though it reuses the same ".tfn-sort-pill" class name for the sort
 * links inside this merged row.
 */

.tfn-brandcol-wrap {
	direction: rtl;
	width: 100%;
	margin: 0 0 20px;
}

/* ---------- Toolbar: collections toggle + gender pills + sort, one row ---------- */

.tfn-brandcol-toolbar {
	position: relative;
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 8px;
	width: 100%;
	margin-bottom: 10px;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.tfn-brandcol-toolbar::-webkit-scrollbar {
	display: none;
}

/* Fade on the left (the cropped side in this RTL layout) hinting there's
   more to scroll to, e.g. if more pills get added later. */
.tfn-brandcol-toolbar::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;
	z-index: 1;
}

.tfn-gender-pill {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 999px;
	border: 1px solid #e2e2e2;
	background: #fff;
	color: #333;
	font-size: 13px;
	white-space: nowrap;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.tfn-gender-pill:hover {
	border-color: #c9a35a;
	color: #c9a35a;
	text-decoration: none;
}

.tfn-gender-pill.is-active {
	background: #232323;
	border-color: #232323;
	color: #fff;
}

.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;
}

.tfn-sort-pill.is-active {
	background: #7a2748;
	border-color: #7a2748;
	color: #fff;
}

/* Raw <button> element — the theme applies its own global button styling
   (often with !important) that otherwise wins, so this needs it too. */
.tfn-collections-toggle {
	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: 8px 18px !important;
	border-radius: 999px !important;
	border: 1px solid #7a2748 !important;
	background: #7a2748 !important;
	background-image: none !important;
	color: #fff !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-collections-toggle-chevron {
	transition: transform .2s ease;
	transform: rotate(180deg); /* panel starts open */
}

.tfn-collections-toggle[aria-expanded="false"] {
	background: #fff !important;
	color: #7a2748 !important;
}

.tfn-collections-toggle[aria-expanded="false"] .tfn-collections-toggle-chevron {
	transform: rotate(0deg);
}

/* ---------- Collections panel (open by default) ---------- */

.tfn-collections-panel {
	width: 100%;
	border: 1px solid #ececec;
	border-radius: 12px;
	padding: 16px 20px;
	margin-bottom: 20px;
	box-sizing: border-box;
}

.tfn-collections-panel[hidden] {
	display: none;
}

.tfn-collections-header {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 600;
	color: #222;
	margin-bottom: 12px;
}

.tfn-collections-header svg {
	color: #7a2748;
}

.tfn-collections-flow {
	display: flex;
	flex-wrap: nowrap;
	overflow: hidden;
	align-items: center;
	gap: 18px;
	min-width: 0;
}

.tfn-collections-flow.is-expanded {
	flex-wrap: wrap;
	overflow: visible;
	row-gap: 10px;
}

.tfn-collections-link {
	flex: 0 0 auto;
	white-space: nowrap;
	font-size: 14px;
	text-decoration: none;
	/* No color set here on purpose — inherits the theme's own link color. */
}

.tfn-collections-more {
	display: none;
	align-items: center !important;
	gap: 4px !important;
	flex: 0 0 auto !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	background: none !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #999 !important;
	font-size: 13px !important;
	font-weight: 400 !important;
	line-height: 1.6 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	white-space: nowrap !important;
	cursor: pointer;
}

.tfn-collections-more:hover {
	color: #7a2748 !important;
	background: none !important;
}

.tfn-collections-more svg {
	transition: transform .2s ease;
}

.tfn-collections-flow.is-expanded .tfn-collections-more svg {
	transform: rotate(180deg);
}

@media (max-width: 767px) {
	.tfn-collections-flow {
		gap: 12px;
	}

	.tfn-collections-link {
		font-size: 13px;
	}

	.tfn-collections-panel {
		padding: 14px 16px;
	}
}

/* ---------- Sort: desktop pills vs mobile trigger+modal ---------- */

.tfn-sort-trigger-mobile {
	display: none;
}

@media (max-width: 767px) {
	.tfn-sort-pill-desktop {
		display: none;
	}

	.tfn-sort-trigger-mobile {
		display: inline-flex !important;
		align-items: center !important;
		gap: 6px !important;
		flex: 0 0 auto !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-sort-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: none;
}

.tfn-brandcol-sort-modal.is-open {
	display: block;
}

.tfn-brandcol-sort-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	transition: opacity .25s ease;
}

.tfn-brandcol-sort-modal.is-open .tfn-brandcol-sort-modal-backdrop {
	opacity: 1;
}

.tfn-brandcol-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-brandcol-sort-modal.is-open .tfn-brandcol-sort-modal-sheet {
	transform: translateY(0);
}

.tfn-brandcol-sort-modal-handle {
	width: 36px;
	height: 4px;
	border-radius: 3px;
	background: #e0e0e0;
	margin: 10px auto 0;
}

.tfn-brandcol-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;
	direction: rtl;
}

.tfn-brandcol-sort-modal-close {
	background: none;
	border: none;
	padding: 6px;
	line-height: 0;
	color: #666;
	cursor: pointer;
}

.tfn-brandcol-sort-modal-list {
	display: flex;
	flex-direction: column;
	direction: rtl;
}

.tfn-brandcol-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-brandcol-sort-modal-item:last-child {
	border-bottom: none;
}

.tfn-brandcol-sort-modal-item.is-active {
	background: #faf1f5;
	color: #7a2748;
	font-weight: 600;
}

body.tfn-brandcol-sort-modal-open {
	overflow: hidden;
}