/* Frill Thrills — Shop / collection archive + filters */

/* Content layout only — do NOT target header .zak-row (breaks desktop header) */
body.ft-shop-archive #zak-content > .zak-container > .zak-row,
body.ft-shop-archive .zak-content > .zak-container > .zak-row {
	display: flex !important;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 24px;
}

/* Keep header mobile row hidden on desktop even if other flex rules exist */
body.ft-shop-archive #zak-masthead .zak-mobile-row,
body.ft-shop-archive .zak-header-builder > .zak-mobile-row {
	display: none !important;
}

@media (max-width: 768px) {
	body.ft-shop-archive #zak-masthead .zak-mobile-row,
	body.ft-shop-archive .zak-header-builder > .zak-mobile-row {
		display: block !important;
	}

	body.ft-shop-archive #zak-masthead .zak-desktop-row,
	body.ft-shop-archive .zak-header-builder > .zak-desktop-row {
		display: none !important;
	}
}

body.ft-shop-archive aside#zak-secondary {
	display: block !important;
	width: 280px !important;
	max-width: 280px;
	flex: 0 0 280px !important;
	padding: 0;
	box-sizing: border-box;
	/* Zakra left layout already uses flex-direction:row-reverse — don't force order */
	order: 0 !important;
}

/* Sticky filter column — aside must stick (panel alone has no scroll room). */
@media screen and (min-width: 769px) {
	body.ft-shop-archive aside#zak-secondary {
		position: sticky;
		top: 96px;
		align-self: flex-start;
		max-height: calc(100vh - 108px);
		overflow-y: auto;
		overscroll-behavior: contain;
		z-index: 5;
		scrollbar-width: thin;
	}
}

body.ft-shop-archive main#zak-primary {
	width: auto !important;
	flex: 1 1 auto !important;
	max-width: none !important;
	padding-inline: 0 !important;
	box-sizing: border-box;
}

body.ft-shop-archive .zak-content,
body.ft-shop-archive #zak-content,
body.ft-shop-archive .zak-container {
	align-items: flex-start;
}

/* Reset old purple card styles when using new grid cards */
body.ft-shop-archive ul.products.ft-shop-products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
	align-items: stretch;
}

body.ft-shop-archive ul.products.ft-shop-products::before,
body.ft-shop-archive ul.products.ft-shop-products::after {
	display: none !important;
	content: none !important;
}

body.ft-shop-archive ul.products li.product,
body.ft-shop-archive ul.products li.product.ft-shop-item {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	padding-bottom: 0 !important;
	border: none !important;
	box-shadow: none !important;
	float: none !important;
	clear: none !important;
	display: flex !important;
	flex-direction: column !important;
	align-self: stretch !important;
	height: 100% !important;
	background: transparent !important;
	align-content: stretch !important;
	overflow: visible !important;
}

body.ft-shop-archive ul.products li.product a.woocommerce-LoopProduct-link {
	margin-top: 0 !important;
	border-radius: 0 !important;
	overflow: visible !important;
	align-items: stretch !important;
}

body.ft-shop-archive ul.products li.product.ft-shop-item .ft-pg-card {
	height: 100% !important;
	min-height: 100% !important;
	width: 100%;
	flex: 1 1 auto;
}

body.ft-shop-archive ul.products li.product a.button,
body.ft-shop-archive ul.products li.product .button {
	/* Hide legacy loop buttons — card has its own CTA */
	display: none !important;
}

/* Fill the card image frame — do not use height:auto (leaves a gray gap). */
body.ft-shop-archive ul.products li.product .ft-pg-image img,
body.ft-shop-archive ul.products li.product a.ft-pg-image img {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	object-fit: cover !important;
}

body.ft-shop-archive ul.products li.product h2,
body.ft-shop-archive ul.products li.product .woocommerce-loop-product__title {
	display: none !important;
}

body.ft-shop-archive ul.products li.product > .price,
body.ft-shop-archive ul.products li.product > span.price {
	display: none !important;
}

body.ft-shop-archive ul.products li .woosw-btn {
	display: none !important;
}

/* Toolbar */
body.ft-shop-archive .zak-wc-filter,
body.ft-shop-archive .woocommerce-result-count,
body.ft-shop-archive .woocommerce-ordering {
	margin-bottom: 16px;
}

body.ft-shop-archive .woocommerce-result-count {
	color: #666;
	font-size: 13px;
}

/* —— Filters —— */
.ft-shop-filters {
	width: 100%;
}

.ft-shop-filters__mobile-bar {
	display: none;
	margin-bottom: 12px;
}

.ft-shop-filters__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 42px;
	padding: 0 18px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	color: #222;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ft-shop-filters__panel {
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 12px;
	padding: 18px 16px 20px;
	position: static;
}

.ft-shop-filters__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid #eee;
}

.ft-shop-filters__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #1a1a1a;
	letter-spacing: 0.02em;
}

.ft-shop-filters__close {
	display: none;
	border: 0;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 0 4px;
}

.ft-shop-filters__group {
	margin-bottom: 20px;
}

.ft-shop-filters__group-title {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #444;
}

.ft-shop-filters__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ft-shop-filters__check {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	color: #333;
	cursor: pointer;
}

.ft-shop-filters__check input {
	accent-color: var(--ft-pink, #f71358);
	width: 16px;
	height: 16px;
}

.ft-shop-filters__sizes {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ft-shop-filters__size {
	position: relative;
	cursor: pointer;
}

.ft-shop-filters__size input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.ft-shop-filters__size span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	font-size: 13px;
	font-weight: 600;
	color: #222;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ft-shop-filters__size:hover span,
.ft-shop-filters__size.is-active span,
.ft-shop-filters__size input:checked + span {
	border-color: var(--ft-pink, #f71358);
	background: var(--ft-pink, #f71358);
	color: #fff;
}

.ft-shop-filters__price {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ft-shop-filters__price input {
	width: 100%;
	min-height: 40px;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	box-sizing: border-box;
}

.ft-shop-filters__price input:focus {
	outline: none;
	border-color: var(--ft-pink, #f71358);
}

.ft-shop-filters__price-sep {
	color: #999;
	flex: 0 0 auto;
}

.ft-shop-filters__search {
	width: 100%;
	min-height: 42px;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	box-sizing: border-box;
}

.ft-shop-filters__search:focus {
	outline: none;
	border-color: var(--ft-pink, #f71358);
}

.ft-shop-filters__clear.is-hidden,
.ft-shop-filters__apply[hidden] {
	display: none !important;
}

.ft-shop-filters__status {
	margin: 0;
	min-height: 1.2em;
	font-size: 12px;
	color: #888;
}

.ft-shop-results {
	position: relative;
	min-height: 120px;
	transition: opacity 0.2s ease;
}

.ft-shop-results.is-loading {
	opacity: 0.45;
	pointer-events: none;
}

.ft-shop-results.is-loading::after {
	content: "";
	position: absolute;
	top: 24px;
	left: 50%;
	width: 28px;
	height: 28px;
	margin-left: -14px;
	border: 2px solid var(--ft-pink, #f71358);
	border-right-color: transparent;
	border-radius: 50%;
	animation: ftShopSpin 0.7s linear infinite;
	z-index: 2;
}

@keyframes ftShopSpin {
	to {
		transform: rotate(360deg);
	}
}

.ft-shop-empty {
	margin: 24px 0;
}

.ft-shop-filters__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 8px;
}

.ft-shop-filters__apply {
	min-height: 44px;
	border: 0;
	border-radius: 8px;
	background: var(--ft-pink, #f71358);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.ft-shop-filters__apply:hover {
	opacity: 0.9;
}

.ft-shop-filters__clear {
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: #666;
	text-decoration: underline;
}

.ft-shop-filters__clear:hover {
	color: var(--ft-pink, #f71358);
}

/* Hide Zakra widget chrome around our custom filters */
body.ft-shop-archive #zak-secondary > .widget:not(.ft-filter-widget) {
	display: none !important;
}

@media screen and (max-width: 1280px) {
	body.ft-shop-archive ul.products.ft-shop-products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media screen and (max-width: 900px) {
	body.ft-shop-archive ul.products.ft-shop-products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Keep sidebar beside products on tablet+; drawer only on small phones */
@media screen and (max-width: 1100px) and (min-width: 769px) {
	body.ft-shop-archive aside#zak-secondary {
		max-width: 240px;
		flex: 0 0 240px;
	}

	body.ft-shop-archive main#zak-primary {
		max-width: calc(100% - 240px);
	}
}

@media screen and (max-width: 768px) {
	body.ft-shop-archive aside#zak-secondary {
		max-width: none;
		flex: 1 1 100%;
		padding: 0 12px 16px;
		order: -1;
	}

	body.ft-shop-archive main#zak-primary {
		max-width: 100%;
		flex: 1 1 100%;
	}

	body.ft-shop-archive .zak-content,
	body.ft-shop-archive #zak-content,
	body.ft-shop-archive #zak-content > .zak-container > .zak-row {
		flex-wrap: wrap;
	}

	.ft-shop-filters__mobile-bar {
		display: block;
	}

	.ft-shop-filters__panel {
		display: none;
		position: fixed;
		inset: 0 auto 0 0;
		width: min(360px, 92vw);
		max-height: 100vh;
		overflow: auto;
		z-index: 100050;
		border-radius: 0;
		border: 0;
		box-shadow: 8px 0 32px rgba(0, 0, 0, 0.18);
		top: 0;
		padding-top: 20px;
	}

	.ft-shop-filters.is-open .ft-shop-filters__panel {
		display: block;
	}

	.ft-shop-filters__close {
		display: block;
	}

	body.ft-filters-open::before {
		content: "";
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.45);
		z-index: 100040;
	}

	body.ft-filters-open {
		overflow: hidden;
	}
}

@media screen and (max-width: 560px) {
	body.ft-shop-archive ul.products.ft-shop-products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	body.ft-shop-archive .ft-pg-image {
		min-height: 0;
	}
}
