.price-skeleton {
	width: 80px;
	height: 20px;
	background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
	background-size: 200% 100%;
	animation: shimmer 1.5s infinite;
	border-radius: 4px;
}

@keyframes shimmer {
	100% {
		background-position: -200% 0;
	}
}

.picture-frame-item {
	width: 100%;
	max-width: 250px;
	margin-inline: 0;
}

.frame-images-main {
	width: 100%;
	max-width: 327px;
}

.frame-mat-container {
	position: relative;
	width: 100%;
	display: block;
	overflow: hidden;
	aspect-ratio: var(--frame-aspect, 4 / 5);
}

.frame-mat-container .frame-main-image {
	display: block;
	width: 100%;
	height: auto;
	vertical-align: top;
}

#results-container.is-collage-results .frame-mat-container {
	aspect-ratio: auto;
	height: 250px;
}

.results-skeleton-item .frame-details-container {
	min-height: 4.5rem;
}

.mat-shimmer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
	background-size: 200% 100%;
	animation: shimmer 1.5s infinite;
	border-radius: 4px;
	z-index: 0;
}

@media (max-width: 1450px) {
	.price-text-responsive {
		font-size: 1.25rem !important; /* text-xl instead of text-2xl */
	}
}

.results-area {
	position: relative;
	isolation: isolate;
}

#results-container {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
	justify-content: start;
	gap: 1.25rem 1rem;
}

#results-container:not(.is-dual-image-view) {
	gap: 4rem 1.5rem;
}

.results-loader {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 200;
}

.results-loader img {
	position: fixed;
	left: var(--loader-x, 50vw);
	top: 50vh;
	transform: translate(-50%, -50%);
	display: block;
	z-index: 201;
}

/* Ensure minimum 2 items per row on very small screens */
@media (max-width: 640px) {
	#results-container {
		grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(50% - 0.5rem)), 1fr));
	}

	#results-container:not(.is-dual-image-view) {
		grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(50% - 0.75rem)), 1fr));
	}
}

/* Hide frame-images-more by default, show on hover */
.picture-frame-item .flex.justify-center {
	position: relative;
}

.frame-images-more {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	margin: 0 auto;
	width: 100%;
	height: 100%;
	max-width: 327px;
	pointer-events: none;
}

.frame-images-more img {
	pointer-events: none;
}

.frame-images-more img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.frame-images-more img.active {
	opacity: 1;
}

.frame-images-main {
	transition: opacity 0.3s ease;
}

.picture-frame-item:hover .frame-images-more,
.picture-frame-item:active .frame-images-more {
	display: block;
}

/* Enable touch interactions on the item itself */
@media (hover: none) and (pointer: coarse) {
	.picture-frame-item:active .frame-images-more {
		display: block;
	}
}

.picture-frame-item:hover .frame-images-main:not(.show-main),
.picture-frame-item:active .frame-images-main:not(.show-main),
.picture-frame-item.touching .frame-images-main:not(.show-main) {
	opacity: 0;
	pointer-events: none;
}

/* Premade (single static thumb): never fade or swap on hover/touch */
.picture-frame-item.no-image-hover:hover .frame-images-more,
.picture-frame-item.no-image-hover:active .frame-images-more,
.picture-frame-item.no-image-hover.touching .frame-images-more {
	display: none !important;
}

.picture-frame-item.no-image-hover .frame-images-main,
.picture-frame-item.no-image-hover:hover .frame-images-main,
.picture-frame-item.no-image-hover:active .frame-images-main,
.picture-frame-item.no-image-hover.touching .frame-images-main,
.picture-frame-item.no-image-hover:hover .frame-images-main:not(.show-main),
.picture-frame-item.no-image-hover:active .frame-images-main:not(.show-main),
.picture-frame-item.no-image-hover.touching .frame-images-main:not(.show-main) {
	opacity: 1 !important;
	pointer-events: auto;
}

.frame-images-main.show-main {
	opacity: 1 !important;
}

.frame-type-title {
	font-weight: bold;
}

.frame-type-description-text {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.frame-type-description.expanded .frame-type-description-text {
	-webkit-line-clamp: unset;
}

/* Required filters section styles */
#pictureframe_search_required_filters {
	display: none;
}

#pictureframe_search_required_filters .required_filter_diploma_styles_title,
#pictureframe_search_required_filters .required_filter_premade_shapes_title,
#pictureframe_search_required_filters .required_filter_floater_types_title {
	text-align: center;
	margin-bottom: 1rem;
	font-weight: bold;
}

#required_filter_diploma_styles,
#required_filter_premade_shapes,
#required_filter_floater_types {
	border: 1px solid rgb(237, 237, 237);
	border-radius: 0.5rem;
	padding: 1.5rem 1.5rem 2.5rem 1.5rem;
	background-color: rgb(237, 237, 237);
}

#required_filter_premade_shapes {
	container-type: inline-size;
	container-name: premade-shapes;
}

#required_filter_premade_shapes .required_filter_premade_shapes_options {
	--shape-col-gap: clamp(0.5rem, 2.5vw, 2rem);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	column-gap: var(--shape-col-gap);
	row-gap: clamp(0.75rem, 2.5vw, 2rem);
}

#required_filter_premade_shapes .required_filter_premade_shapes_options > label {
	box-sizing: border-box;
	min-width: 0;
	/* 5 per row → wraps to centered 4 on the next */
	flex: 0 0 calc((100% - 4 * var(--shape-col-gap)) / 5);
	max-width: calc((100% - 4 * var(--shape-col-gap)) / 5);
}

/* Wide enough for all 9 on one row */
@container premade-shapes (min-width: 720px) {
	#required_filter_premade_shapes .required_filter_premade_shapes_options > label {
		flex: 0 0 calc((100% - 8 * var(--shape-col-gap)) / 9);
		max-width: calc((100% - 8 * var(--shape-col-gap)) / 9);
	}
}

.filter-modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 2147483646;
}

.filter-modal-overlay.is-open {
	display: block;
}

.filter-modal-overlay.is-closing {
	display: block;
	background: transparent;
	/* Must not steal taps from Filter button / page while fading out (iOS). */
	pointer-events: none;
}

/*
 * iOS Safari: the HTML [hidden] attribute uses display:none !important and
 * breaks <label> activation for checkboxes/radios. Keep inputs in the a11y
 * tree / label-activatable while remaining visually invisible so peer/:checked
 * and filter change handlers still work.
 */
#filter-modal input[hidden] {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	display: block !important;
	opacity: 0 !important;
	appearance: none;
	pointer-events: none;
}

@media (max-width: 1023px) {
	#filter-modal.filter-modal {
		display: none !important;
		position: fixed;
		top: 0;
		left: 0;
		right: auto;
		z-index: 2147483647;
		width: 100%;
		max-width: 290px;
		max-height: 70vh;
		overflow-y: auto;
		background: #fff;
		padding: 1rem;
		box-shadow: 0 4px 4px 0 #00000040;
	}

	#filter-modal.filter-modal.is-open {
		display: block !important;
	}

	body.filter-modal-open {
		overflow: hidden;
	}
}

.dual-image-view-toggle {
	color: #444444;
}

.dual-image-view-toggle.is-active {
	color: #094DBC;
	outline-color: #094DBC;
	background-color: #ffffff;
}

#results-container.is-dual-image-view {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
}

#results-container.is-dual-image-view .picture-frame-item,
#results-container.is-dual-image-view .frame-dual-card {
	max-width: none;
	width: 100%;
	height: 100%;
}

.frame-dual-card {
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 12px;
	background: #ffffff;
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: 100%;
}

.frame-dual-card-link {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	color: inherit;
	text-decoration: none;
	min-height: 0;
}

.frame-dual-card-link:hover {
	color: inherit;
}

.frame-dual-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 2px;
}

.frame-dual-name {
	font-size: 18px;
	font-weight: 700;
	overflow-wrap: anywhere;
	line-height: 1.2;
}

.frame-dual-size {
	font-size: 14px;
	font-weight: 600;
	color: #374151;
	line-height: 1.3;
	margin-top: 2px;
}

.frame-dual-price {
	font-size: 18px;
	font-weight: 700;
	color: #094DBC;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 1px;
	flex-shrink: 0;
}

.frame-dual-images-wrap {
	position: relative;
}

.frame-dual-reviews {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-top: 8px;
	min-height: 24px;
}

.frame-dual-shop-button {
	display: block;
	width: 100%;
	flex-shrink: 0;
	appearance: none;
	border: 0;
	border-radius: 6px;
	padding: 10px 14px;
	background: #094DBC;
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.frame-dual-shop-button:hover {
	background: #073a94;
	color: #ffffff;
}

.frame-dual-images {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	width: 100%;
}

.frame-dual-image-box {
	min-height: 145px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: #fafbfc;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	position: relative;
}

.frame-dual-image-media {
	flex: 1 1 auto;
	width: 100%;
	min-height: 120px;
	overflow: hidden;
	background: #fafbfc;
}

.frame-dual-image-box img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 5px 5px 0 0;
}

.frame-dual-image-box-rotate .frame-dual-image-media {
	position: relative;
}

.frame-dual-image-box-rotate .frame-dual-images-more {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.frame-dual-image-box-rotate .frame-dual-images-more img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.3s ease;
	border-radius: 5px 5px 0 0;
}

.frame-dual-image-box-rotate .frame-dual-images-more img.active {
	opacity: 1;
}

.frame-dual-image-label {
	width: 100%;
	padding: 5px 7px;
	font-size: 11px;
	color: #6b7280;
	background: #f6f8fa;
	border-top: 1px solid #d1d5db;
	text-align: center;
	line-height: 1.2;
}

.frame-dual-image-unavailable {
	display: none;
	color: #6b7280;
	font-size: 11px;
	padding: 12px 8px;
	text-align: center;
}

.frame-dual-image-box.is-unavailable .frame-dual-image-media {
	display: none;
}

.frame-dual-image-box.is-unavailable .frame-dual-image-unavailable {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	min-height: 120px;
}

@media (max-width: 640px) {
	#results-container.is-dual-image-view {
		grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(100% - 0.5rem)), 1fr));
	}

	.frame-dual-image-box {
		min-height: 120px;
	}

	.frame-dual-image-media {
		min-height: 90px;
	}
}

@media (min-width: 1024px) {
	.filter-toggle {
		display: none !important;
	}

	#filter-modal.filter-modal {
		display: block !important;
		position: static;
		max-width: 260px;
		max-height: none;
		overflow: visible;
		padding: 0;
		background: transparent;
		box-shadow: none;
		z-index: auto;
	}

	.filter-modal-overlay,
	.filter-modal-overlay.is-open,
	.filter-modal-overlay.is-closing {
		display: none !important;
	}
}

/*
 * Filter accordion expand/collapse.
 * Previously provided by livechat's Tailwind Play CDN (peer-has-[:checked]:*).
 * Without these, panels stay at max-h-0 and filter contents never open.
 */
.peer:has(:checked) ~ .peer-has-\[\:checked\]\:max-h-96 {
	max-height: 24rem;
}

.peer:has(:checked) ~ .peer-has-\[\:checked\]\:mt-5 {
	margin-top: 1.25rem;
}

.group:has(:checked) .group-has-\[\:checked\]\:transform,
.group\/nested:has(:checked) .group-has-\[\:checked\]\/nested\:transform {
	transform: var(--tw-transform, none);
}

.group:has(:checked) .group-has-\[\:checked\]\:rotate-180,
.group\/nested:has(:checked) .group-has-\[\:checked\]\/nested\:rotate-180 {
	transform: rotate(180deg);
}

.group\/inner:has(:checked) .group-has-\[\:checked\]\/inner\:text-blue {
	color: #094DBC;
}

.group\/inner:has(:checked) .group-has-\[\:checked\]\/inner\:font-semibold {
	font-weight: 600;
}

.group\/image:has(:checked) .group-has-\[\:checked\]\/image\:border-blue {
	border-color: #094DBC;
}

.col-span-2 {
	grid-column: span 2 / span 2;
}

.gap-2\.5 {
	gap: 0.625rem;
}
