/**  Collection style **/

.collection-layout {
	max-width: 100%;
	width: 100%;
	box-sizing: border-box;
}

.collection-layout.boxed {
	margin: 0 auto 8px;
	padding: 0 16px;
	max-width: var(--wp--style--global--wide-size);
}

.collection-grid__container {
	max-width: 90vw;
	margin: 0 auto;
}

/* Collection Header Styles */
.shopify-collection-header {
	margin-bottom: 32px;
	padding: 0 16px;
}

.shopify-collection-title {
	font-size: 2.5rem;
	font-weight: 700;
	margin: 0 0 16px 0;
	color: #333;
	line-height: 1.2;
}

.shopify-collection-description {
	font-size: 1.125rem;
	line-height: 1.6;
	color: #666;
	margin: 0;
}

.shopify-collection-description p {
	margin: 0 0 12px 0;
}

.shopify-collection-description p:last-child {
	margin-bottom: 0;
}

.collection-grid__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	/* grid-auto-rows: 1fr; */
	gap: 16px;
	width: 100%;
	box-sizing: border-box;
}

/* Classic theme compatibility */
.shopify-collection-content .collection-grid__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 16px;
	width: 100%;
	box-sizing: border-box;
}

/* Ensure product cards are visible in classic themes */
.shopify-collection-content .product-card {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid #ddd;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.shopify-collection-content .product-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Product card image container */
.shopify-collection-content .product-card__image-container {
	position: relative;
	width: 100%;
	height: 200px;
	overflow: hidden;
}

.shopify-collection-content .product-card__image-container img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Product card details */
.shopify-collection-content .product-card__details {
	padding: 16px;
}

.shopify-collection-content .product-card__title {
	margin: 0 0 8px 0;
	font-size: 16px;
	font-weight: 600;
	color: #333;
	line-height: 1.4;
}

.shopify-collection-content .product-card__price {
	margin: 0;
	font-size: 17.6px;
	font-weight: 700;
	color: #000;
}

.shopify-collection-content .product-card__category {
	margin: 0 0 8px 0;
	font-size: 14px;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Debug styles for troubleshooting */
.shopify-collection-content {
	padding: 16px;
	margin: 16px 0;
}

.shopify-collection-content:empty::before {
	content: "No collection content loaded - check console for errors";
	display: block;
	color: #ff6b6b;
	font-weight: bold;
	text-align: center;
	padding: 32px;
}

/* Pagination */
.pagination-button-list {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 16px;
	max-width: var(--wp--style--global--wide-size);
	margin: 40px auto 0;
	padding: 0;
	list-style: none;
}

.pagination-button-list button {
	background: none;
	border: 1px solid #c5c4c4;
	border-radius: 50%;
	padding: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	width: 40px;
	height: 40px;
	display: flex;
	justify-content: center;
	align-items: center;
	outline-width: 0;
}

.pagination-button-list button:focus {
	outline-width: 0;
}

.pagination-button-list button:hover {
	background: #000;
	border: 1px solid #000;
}

.pagination-button-list button svg {
	stroke: #000;
	transition: stroke 0.3s ease;
}

.pagination-button-list button:hover svg polyline {
	stroke: #fff;
}

.pagination-button-list button svg polyline {
	stroke-width: 1px;
}

/* Disabled pagination button styles */
.pagination-button-list button[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
	background: #f5f5f5;
	border-color: #ddd;
}

.pagination-button-list button[disabled]:hover {
	background: #f5f5f5;
	border-color: #ddd;
}

.pagination-button-list button[disabled] svg polyline {
	stroke: #999;
}

/* Collection Filters and Sorting Styles */
.shopify-collection-filters {
	margin-bottom: 24px;
	padding: 0 16px;
}

.shopify-collection-filters__container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.shopify-collection-filters__filters {
	position: relative;
}

.shopify-collection-filters__toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	color: #333;
	transition: all 0.2s ease;
}

.shopify-collection-filters__toggle:hover {
	border-color: #000;
	background: #f9f9f9;
}

.shopify-collection-filters__toggle-icon {
	font-size: 18px;
}

.shopify-collection-filters__active-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	background: #000;
	color: #fff;
	border-radius: 10px;
	font-size: 12px;
	font-weight: 600;
	margin-left: 4px;
}

.shopify-collection-filters__panel {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1000;
	width: 320px;
	max-width: 90vw;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	margin-top: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: all 0.3s ease;
	max-height: 80vh;
	overflow-y: auto;
}

.shopify-collection-filters__panel.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.shopify-collection-filters__panel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px;
	border-bottom: 1px solid #eee;
}

.shopify-collection-filters__panel-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #333;
}

.shopify-collection-filters__close {
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.shopify-collection-filters__close:hover {
	background: #f5f5f5;
	color: #000;
}

.shopify-collection-filters__panel-content {
	padding: 16px;
}

.shopify-collection-filter-group {
	margin-bottom: 24px;
}

.shopify-collection-filter-group:last-child {
	margin-bottom: 0;
}

.shopify-collection-filter-group__title {
	margin: 0 0 12px 0;
	font-size: 14px;
	font-weight: 600;
	color: #333;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.shopify-collection-filter-group__options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.shopify-collection-filter-option {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	padding: 8px;
	border-radius: 4px;
	transition: background 0.2s ease;
}

.shopify-collection-filter-option:hover {
	background: #f9f9f9;
}

.shopify-collection-filter-checkbox {
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: #000;
}

.shopify-collection-filter-option span {
	font-size: 14px;
	color: #333;
	user-select: none;
}

.shopify-collection-filter-price-range {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.shopify-collection-filter-price-range label {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.shopify-collection-filter-price-range span {
	font-size: 13px;
	font-weight: 500;
	color: #666;
}

.shopify-collection-filter-price-input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.2s ease;
}

.shopify-collection-filter-price-input:focus {
	outline: none;
	border-color: #000;
}

.shopify-collection-filters__actions {
	display: flex;
	gap: 8px;
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #eee;
}

.shopify-collection-filters__clear,
.shopify-collection-filters__apply {
	flex: 1;
	padding: 10px 16px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.shopify-collection-filters__clear {
	background: #fff;
	color: #333;
}

.shopify-collection-filters__clear:hover {
	background: #f9f9f9;
	border-color: #000;
}

.shopify-collection-filters__apply {
	background: #000;
	color: #fff;
	border-color: #000;
}

.shopify-collection-filters__apply:hover {
	background: #333;
	border-color: #333;
}

.shopify-collection-filters__sort {
	display: flex;
	align-items: center;
	gap: 12px;
}

.shopify-collection-filters__sort-label {
	font-size: 14px;
	font-weight: 500;
	color: #333;
	white-space: nowrap;
}

.shopify-collection-filters__sort-select {
	padding: 10px 32px 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	color: #333;
	background: #fff;
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px;
	transition: border-color 0.2s ease;
}

.shopify-collection-filters__sort-select:focus {
	outline: none;
	border-color: #000;
}

.shopify-collection-filters__active {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #eee;
}

.shopify-collection-filters__active-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}

.shopify-collection-filter-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: #f5f5f5;
	border: 1px solid #ddd;
	border-radius: 20px;
	font-size: 13px;
	color: #333;
}

.shopify-collection-filter-tag__remove {
	background: none;
	border: none;
	font-size: 18px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 0;
	width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
	margin-left: 4px;
}

.shopify-collection-filter-tag__remove:hover {
	background: #ddd;
	color: #000;
}

.shopify-collection-filters__clear-all {
	background: none;
	border: none;
	font-size: 13px;
	color: #666;
	cursor: pointer;
	text-decoration: underline;
	padding: 0;
	transition: color 0.2s ease;
}

.shopify-collection-filters__clear-all:hover {
	color: #000;
}

/* Mobile Responsive */
@media (max-width: 767px) {
	.shopify-collection-filters__container {
		flex-direction: column;
		align-items: stretch;
	}
	
	.shopify-collection-filters__filters {
		width: 100%;
	}
	
	.shopify-collection-filters__toggle {
		width: 100%;
		justify-content: center;
	}
	
	.shopify-collection-filters__panel {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: 100%;
		max-height: 100vh;
		margin: 0;
		border: none;
		border-radius: 0;
	}
	
	.shopify-collection-filters__sort {
		width: 100%;
	}
	
	.shopify-collection-filters__sort-select {
		flex: 1;
		width: 100%;
	}
}
