/* PNA - AJAX product filter loader */

/* The theme's old full-page loader is replaced by the one below */
body.pna-ajax-ready .h_product_loader_inner { display: none !important; }

/* Top progress bar */
#pna-ajax-bar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	z-index: 100000;
	pointer-events: none;
	opacity: 0;
	overflow: hidden;
	transition: opacity .2s ease;
}
#pna-ajax-bar::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: -40%;
	width: 40%;
	background: linear-gradient(90deg, rgba(135, 104, 45, 0), #87682d 30%, #b8954a 70%, rgba(135, 104, 45, 0));
}
body.pna-is-loading #pna-ajax-bar { opacity: 1; }
body.pna-is-loading #pna-ajax-bar::before { animation: pna-bar 1.1s ease-in-out infinite; }
body.admin-bar #pna-ajax-bar { top: 32px; }
@media (max-width: 782px) { body.admin-bar #pna-ajax-bar { top: 46px; } }

@keyframes pna-bar {
	0%   { left: -40%; }
	100% { left: 100%; }
}

/* Product grid overlay */
.banner_slider_r.new_pro_container { position: relative; }

.pna-ajax-overlay {
	position: absolute;
	inset: 0;
	z-index: 20;
	background: rgba(255, 255, 255, .72);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .18s ease, visibility .18s ease;
}
body.pna-is-loading .pna-ajax-overlay {
	opacity: 1;
	visibility: visible;
}

/* Spinner: fixed to the window, centred on the visible part of the grid by JS */
#pna-ajax-spinner {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 100001;
	transform: translate(-50%, -50%);
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity .18s ease, visibility .18s ease;
}
body.pna-is-loading #pna-ajax-spinner {
	opacity: 1;
	visibility: visible;
}
.pna-ajax-spinner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 22px 28px;
	background: #fff;
	border: 1px solid #ece7dc;
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(28, 25, 23, .12);
	white-space: nowrap;
}
.pna-ring {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 3px solid #efe8da;
	border-top-color: #87682d;
	border-right-color: #87682d;
	animation: pna-spin .75s linear infinite;
}
.pna-ajax-text {
	font-size: 14px;
	letter-spacing: .02em;
	color: #3a3631;
}
@keyframes pna-spin { to { transform: rotate(360deg); } }

/* Filters are read-only while a request runs */
body.pna-is-loading .sh_shop_filter {
	opacity: .55;
	pointer-events: none;
	transition: opacity .18s ease;
}

/* Fade the new results in */
.pna-ajax-in {
	animation: pna-fade .28s ease both;
}
@keyframes pna-fade {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	body.pna-is-loading #pna-ajax-bar::before { animation-duration: 2.4s; }
	.pna-ring { animation-duration: 1.6s; }
	.pna-ajax-in { animation: none; }
}

/* ---------- Shop page: skeleton cards while a category section loads ---------- */
.pna-shop-lazy { margin: 0 0 20px; }
.pna-skel-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.pna-skel-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 10px;
	border: 1px solid #ececec;
	background: #fff;
	min-height: 400px;
}
.pna-skel-img,
.pna-skel-line,
.pna-skel-btns {
	display: block;
	border-radius: 4px;
	background: linear-gradient(90deg, #f1efea 25%, #e7e3da 37%, #f1efea 63%);
	background-size: 400% 100%;
	animation: pna-shimmer 1.3s ease-in-out infinite;
}
.pna-skel-img   { height: 220px; }
.pna-skel-line  { height: 14px; width: 85%; }
.pna-skel-short { width: 45%; }
.pna-skel-btns  { height: 40px; margin-top: auto; }
@keyframes pna-shimmer {
	0%   { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}
@media (max-width: 991px) {
	.pna-skel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.pna-skel-card { min-height: 320px; }
	.pna-skel-img  { height: 160px; }
}
.pna-shop-lazy-error .pna-shop-retry {
	padding: 30px 10px;
	text-align: center;
	color: #3a3631;
	border: 1px dashed #d8d2c4;
	margin: 0;
}
.pna-shop-retry-btn {
	margin-left: 8px;
	padding: 6px 14px;
	border: 0;
	background: #87682d;
	color: #fff;
	cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
	.pna-skel-img, .pna-skel-line, .pna-skel-btns { animation: none; }
}

/* ---------- Category pages: light version while filter + products load ---------- */
body.pna-loading-quiet .pna-ajax-overlay,
body.pna-loading-quiet #pna-ajax-spinner { opacity: 0 !important; visibility: hidden !important; }

.pna-skel-filter { display: flex; flex-direction: column; gap: 12px; padding: 14px 0; }
.pna-skel-filter .pna-skel-range { height: 28px; width: 100%; }
.pna-skel-swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pna-skel-swatches .pna-skel-img { height: 54px; }
.pna-skel-dark { background: #cfcac0; animation: none; }
.pna-skel-sort { display: flex; justify-content: flex-end; margin: 0 0 20px; }
.pna-skel-sort .pna-skel-btns { width: 170px; height: 34px; margin: 0; }
.pna-shell-results .pna-skel-grid { margin-bottom: 20px; }
.pna-skel-filter .pna-skel-img,
.pna-skel-filter .pna-skel-line,
.pna-skel-filter .pna-skel-btns { display: block; border-radius: 4px; background: linear-gradient(90deg, #f1efea 25%, #e7e3da 37%, #f1efea 63%); background-size: 400% 100%; animation: pna-shimmer 1.3s ease-in-out infinite; }
.pna-skel-filter .pna-skel-btns { height: 34px; margin: 0; }
@media (max-width: 992px) {
	.pna-skel-filter { display: none; } /* the filter is collapsed on mobile anyway */
}
.pna-skel-filter .pna-skel-dark { background: #cfcac0; animation: none; }

/* Category list placeholder on the light category page */
.pna-skel-cats {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid #e3e0d8;
	border-bottom: 0;
}
.pna-skel-cats li {
	height: 38px;
	display: flex;
	align-items: center;
	padding: 0 10px;
	border-bottom: 1px solid #e3e0d8;
}
.pna-skel-cats .pna-skel-line {
	display: block;
	height: 12px;
	border-radius: 4px;
	background: linear-gradient(90deg, #f1efea 25%, #e7e3da 37%, #f1efea 63%);
	background-size: 400% 100%;
	animation: pna-shimmer 1.3s ease-in-out infinite;
}
@media (max-width: 992px) {
	.pna-skel-cats { display: none; } /* collapsed behind the "Categories" toggle on mobile */
}
@media (prefers-reduced-motion: reduce) {
	.pna-skel-cats .pna-skel-line { animation: none; }
}
