/* ==========================================================================
   MJ World Food - Shop Archive & Product Listing Page Styles
   ========================================================================== */

/* Hide native scrollbars while preserving touch/mouse scrolling */
.hide-scrollbar::-webkit-scrollbar {
	display: none;
}
.hide-scrollbar {
	-ms-overflow-style: none;
	scrollbar-width: none;
}

/* Custom Checkbox Styling - MJ Brand Green (#85A91B) */
.custom-checkbox {
	appearance: none;
	-webkit-appearance: none;
	background-color: #ffffff;
	margin: 0;
	font: inherit;
	color: currentColor;
	width: 1.2em;
	height: 1.2em;
	border: 1.5px solid #E4E9D8;
	border-radius: 0.3em;
	display: inline-grid;
	place-content: center;
	cursor: pointer;
	vertical-align: middle;
	flex-shrink: 0;
	transition: all 0.15s ease-in-out;
}

.custom-checkbox::before {
	content: "";
	width: 0.65em;
	height: 0.65em;
	transform: scale(0);
	transition: 120ms transform ease-in-out;
	box-shadow: inset 1em 1em white;
	background-color: white;
	transform-origin: center;
	clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.custom-checkbox:hover {
	border-color: #85A91B;
}

.custom-checkbox:checked {
	background-color: #85A91B;
	border-color: #85A91B;
}

.custom-checkbox:checked::before {
	transform: scale(1);
}

.custom-checkbox:focus-visible {
	outline: 2px solid #85A91B;
	outline-offset: 2px;
}

/* Slim Custom Scrollbar for Brand & Department Filter Boxes - Regular Grey */
.custom-scrollbar {
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 #f3f4f6;
	overflow-y: auto !important;
	-webkit-overflow-scrolling: touch;
}
.custom-scrollbar::-webkit-scrollbar {
	width: 5px;
	height: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
	background: #f3f4f6;
	border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 9999px;
	border: 1px solid #f3f4f6;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

/* Accordion Caret Transition */
.accordion-caret {
	transition: transform 0.25s ease-in-out;
}
.accordion-closed .accordion-caret {
	transform: rotate(180deg);
}

/* Filter Content Slide Transition */
.filter-accordion-content {
	transition: opacity 0.25s ease-in-out;
}
.filter-accordion-content.overflow-y-auto,
.filter-accordion-content.custom-scrollbar {
	overflow-y: auto !important;
	-webkit-overflow-scrolling: touch;
}
.accordion-closed .filter-accordion-content,
.accordion-closed .brand-search-wrapper {
	display: none !important;
}

/* Loading Overlay for Product Grid */
#product-grid-container {
	position: relative;
	min-height: 250px;
}

#product-grid-container.is-loading {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.grid-loader {
	display: none;
	position: absolute;
	top: 15%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 20;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid #E4E9D8;
	padding: 0.75rem 1.25rem;
	border-radius: 9999px;
	box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
	color: #527D18;
	font-weight: 600;
	font-size: 0.875rem;
	align-items: center;
	gap: 0.5rem;
}

#product-grid-container.is-loading .grid-loader {
	display: flex;
}

/* ==========================================================================
   List View Mode (Modern Supermarket Layout)
   ========================================================================== */
.products-view-list #product-grid,
.products-view-list ul.products {
	display: flex !important;
	flex-direction: column !important;
	gap: 1.25rem !important;
}

.products-view-list .mj-product-card {
	width: 100% !important;
	height: auto !important;
}

.products-view-list .mj-product-card > div {
	display: flex !important;
	flex-direction: row !important;
	align-items: stretch !important;
	gap: 1.75rem !important;
	padding: 1.25rem 1.5rem !important;
	border-radius: 1rem !important;
	background: #ffffff !important;
	border: 1px solid #E4E9D8 !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
	transition: all 0.3s ease !important;
}

.products-view-list .mj-product-card > div:hover {
	border-color: #85A91B !important;
	box-shadow: 0 8px 24px -4px rgba(133, 169, 27, 0.12) !important;
}

/* 1. Left: Product Image Box */
.products-view-list .product-card-image-wrap {
	width: 160px !important;
	height: 160px !important;
	min-width: 160px !important;
	flex-shrink: 0 !important;
	margin-bottom: 0 !important;
	border-radius: 0.875rem !important;
	background: #F4F8E8 !important;
}

/* 2. Middle: Product Details */
.products-view-list .product-card-details {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	display: flex !important;
	flex-direction: column !important;
	justify-content: center !important;
	padding-right: 1.25rem !important;
}

.products-view-list .product-card-details h4 {
	font-size: 1.15rem !important;
	line-height: 1.35 !important;
	font-weight: 700 !important;
	margin-bottom: 0.35rem !important;
	-webkit-line-clamp: 2 !important;
}

.products-view-list .product-card-description {
	display: -webkit-box !important;
	-webkit-box-orient: vertical !important;
	-webkit-line-clamp: 2 !important;
	overflow: hidden !important;
	color: #6B7280 !important;
	font-size: 0.8125rem !important;
	line-height: 1.5 !important;
	margin-top: 0.25rem !important;
	margin-bottom: 0.5rem !important;
}

.products-view-list .product-list-perks {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 1rem !important;
	padding-top: 0.5rem !important;
	border-top: 1px dashed #EAEFE0 !important;
	margin-top: auto !important;
}

/* 3. Right: Dedicated Pricing & Action Box */
.products-view-list .product-card-pricing-action {
	width: 210px !important;
	min-width: 210px !important;
	flex-shrink: 0 !important;
	margin-top: 0 !important;
	padding-left: 1.5rem !important;
	border-left: 1px solid #EEF2E6 !important;
	display: flex !important;
	flex-direction: column !important;
	justify-content: space-between !important;
	align-items: flex-end !important;
	text-align: right !important;
}

.products-view-list .product-pricing-box {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-end !important;
	text-align: right !important;
	width: 100% !important;
}

.products-view-list .price-wrapper-loop {
	justify-content: flex-end !important;
	font-size: 1.35rem !important;
	color: #1A1E14 !important;
}

.products-view-list .unit-price-text {
	text-align: right !important;
	color: #6B7280 !important;
	font-size: 0.75rem !important;
}

.products-view-list .stock-badge-wrap {
	justify-content: flex-end !important;
	margin-top: 0.35rem !important;
	margin-bottom: 1rem !important;
}

.products-view-list .product-action-box {
	width: 100% !important;
	max-width: 180px !important;
	margin-top: auto !important;
}

.products-view-list .product-action-box a,
.products-view-list .product-action-box button {
	width: 100% !important;
	height: 44px !important;
	border-radius: 0.625rem !important;
	font-size: 0.8125rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.05em !important;
	box-shadow: 0 2px 8px -1px rgba(133, 169, 27, 0.25) !important;
}

/* Responsive adjustment for Mobile (< 640px) */
@media (max-width: 640px) {
	.products-view-list .mj-product-card > div {
		flex-direction: row !important;
		flex-wrap: wrap !important;
		align-items: flex-start !important;
		gap: 0.875rem !important;
		padding: 1rem !important;
	}

	.products-view-list .product-card-image-wrap {
		width: 105px !important;
		height: 105px !important;
		min-width: 105px !important;
		border-radius: 0.75rem !important;
	}

	.products-view-list .product-card-details {
		flex: 1 1 0% !important;
		padding-right: 0 !important;
	}

	.products-view-list .product-card-details h4 {
		font-size: 0.95rem !important;
	}

	.products-view-list .product-card-description,
	.products-view-list .product-list-perks {
		display: none !important;
	}

	.products-view-list .product-card-pricing-action {
		width: 100% !important;
		min-width: 100% !important;
		border-left: none !important;
		padding-left: 0 !important;
		padding-top: 0.75rem !important;
		border-top: 1px solid #EEF2E6 !important;
		flex-direction: row !important;
		justify-content: space-between !important;
		align-items: center !important;
		text-align: left !important;
	}

	.products-view-list .product-pricing-box {
		align-items: flex-start !important;
		text-align: left !important;
		width: auto !important;
	}

	.products-view-list .price-wrapper-loop {
		justify-content: flex-start !important;
		font-size: 1.15rem !important;
	}

	.products-view-list .unit-price-text {
		text-align: left !important;
	}

	.products-view-list .stock-badge-wrap {
		display: none !important;
	}

	.products-view-list .product-action-box {
		width: auto !important;
		max-width: none !important;
		margin-top: 0 !important;
	}

	.products-view-list .product-action-box a,
	.products-view-list .product-action-box button {
		width: auto !important;
		min-width: 125px !important;
		height: 38px !important;
		padding: 0 1rem !important;
		font-size: 0.75rem !important;
	}
}

/* ==========================================================================
   Shop Pagination (Native WooCommerce & AJAX Loop)
   ========================================================================== */
#shop-pagination .woocommerce-pagination,
#shop-pagination nav {
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
	width: 100% !important;
	border: none !important;
}

#shop-pagination ul.page-numbers {
	display: inline-flex !important;
	align-items: center !important;
	gap: 0.375rem !important;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
}

#shop-pagination ul.page-numbers li {
	margin: 0 !important;
	padding: 0 !important;
	display: inline-flex !important;
	border: none !important;
}

#shop-pagination .page-numbers {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-width: 2.5rem !important;
	height: 2.5rem !important;
	padding: 0 0.75rem !important;
	border-radius: 0.5rem !important;
	font-size: 0.875rem !important;
	font-weight: 600 !important;
	text-decoration: none !important;
	border: 1px solid #E4E9D8 !important;
	background-color: #ffffff !important;
	color: #5F6658 !important;
	transition: all 0.2s ease !important;
}

#shop-pagination .page-numbers:hover {
	border-color: #85A91B !important;
	color: #85A91B !important;
	background-color: #F4F8E8 !important;
}

#shop-pagination .page-numbers.current,
#shop-pagination span.current {
	background-color: #85A91B !important;
	border-color: #85A91B !important;
	color: #ffffff !important;
	font-weight: 700 !important;
	box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
}

#shop-pagination .page-numbers.prev,
#shop-pagination .page-numbers.next {
	font-size: 1rem !important;
	padding: 0 0.625rem !important;
}

#shop-pagination .page-numbers.dots {
	border: none !important;
	background: transparent !important;
	min-width: 1.75rem !important;
	padding: 0 !important;
	cursor: default !important;
	color: #8F9489 !important;
	box-shadow: none !important;
}
#shop-pagination .page-numbers.dots:hover {
	border: none !important;
	background: transparent !important;
	color: #8F9489 !important;
}

@media (max-width: 640px) {
	#shop-pagination ul.page-numbers,
	#shop-pagination nav {
		gap: 0.25rem !important;
		flex-wrap: wrap !important;
	}
	#shop-pagination .page-numbers {
		min-width: 2.125rem !important;
		height: 2.125rem !important;
		padding: 0 0.4rem !important;
		font-size: 0.8125rem !important;
	}
	#shop-pagination .page-numbers.dots {
		min-width: 1.25rem !important;
		padding: 0 !important;
	}
}

