:root {
	--pgm-primary: #1BC4B5;
	--pgm-secondary: #FF8C4D;
	--pgm-text: #1f2937;
	--pgm-muted: #6b7280;
	--pgm-bg: #f7f9fa;
	--pgm-border: #e5e7eb;
	--pgm-white: #ffffff;
}

.pgm-gallery-wrapper * { box-sizing: border-box; }

.pgm-gallery-wrapper {
	direction: rtl;
	font-family: inherit;
	color: var(--pgm-text);
}

.pgm-gallery-inner {
	display: flex;
	align-items: flex-start;
	gap: 28px;
}

/* ---------------- Sidebar filters (Amazon style) ---------------- */
.pgm-filters-sidebar {
	width: 260px;
	flex: 0 0 260px;
	background: var(--pgm-white);
	border: 1px solid var(--pgm-border);
	border-radius: 14px;
	padding: 20px;
	position: sticky;
	top: 20px;
}

.pgm-filters-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--pgm-bg);
}

.pgm-filters-header h3 {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
}

.pgm-reset-filters {
	background: none;
	border: none;
	color: var(--pgm-primary);
	font-size: 13px;
	cursor: pointer;
	font-weight: 600;
}
.pgm-reset-filters:hover { text-decoration: underline; }

.pgm-filter-group {
	padding: 14px 0;
	border-bottom: 1px solid var(--pgm-bg);
	transition: opacity .25s ease, max-height .25s ease;
}
.pgm-filter-group:last-child { border-bottom: none; }

.pgm-filter-group h4 {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 700;
	color: var(--pgm-text);
}

.pgm-filter-group.pgm-hidden-group {
	display: none;
}

.pgm-check {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	color: var(--pgm-muted);
	padding: 5px 0;
	cursor: pointer;
	user-select: none;
}
.pgm-check:hover { color: var(--pgm-text); }
.pgm-check input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--pgm-primary);
	cursor: pointer;
}

/* ---------------- Main area ---------------- */
.pgm-gallery-main { flex: 1; min-width: 0; }

.pgm-search-box {
	position: relative;
	margin-bottom: 16px;
}
.pgm-search-input {
	width: 100%;
	padding: 13px 44px 13px 16px;
	border: 1px solid var(--pgm-border);
	border-radius: 10px;
	font-size: 14px;
	background: var(--pgm-white);
	transition: border-color .2s;
}
.pgm-search-input:focus {
	outline: none;
	border-color: var(--pgm-primary);
	box-shadow: 0 0 0 3px rgba(27, 196, 181, .15);
}
.pgm-search-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--pgm-muted);
}

.pgm-active-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}
.pgm-active-filters:empty { display: none; }
.pgm-active-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(27, 196, 181, .1);
	color: var(--pgm-primary);
	border: 1px solid rgba(27, 196, 181, .3);
	padding: 5px 10px;
	border-radius: 20px;
	font-size: 12.5px;
	font-weight: 600;
}
.pgm-active-chip button {
	background: none; border: none; cursor: pointer; color: inherit; font-size: 14px; line-height: 1;
}

/* ---------------- Grid ---------------- */
.pgm-grid {
	--pgm-columns: 4;
	--pgm-gap: 20px;
	display: grid;
	grid-template-columns: repeat(var(--pgm-columns), 1fr);
	gap: var(--pgm-gap);
	min-height: 120px;
	position: relative;
}

.pgm-layout-masonry {
	display: block;
	column-count: var(--pgm-columns);
	column-gap: var(--pgm-gap);
}
.pgm-layout-masonry .pgm-card {
	break-inside: avoid;
	margin-bottom: var(--pgm-gap);
}

.pgm-card {
	background: var(--pgm-white);
	border: 1px solid var(--pgm-border);
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	transition: box-shadow .25s ease, transform .25s ease;
}
.pgm-card:hover {
	box-shadow: 0 10px 30px rgba(17, 24, 39, .1);
}

.pgm-card-image {
	position: relative;
	height: 320px;
	overflow: hidden;
	background: var(--pgm-bg);
}
.pgm-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease, opacity .4s ease, filter .4s ease;
}

/* Hover animations (driven by the wrapper's data-hover attribute) */
.pgm-gallery-wrapper[data-hover="zoom"] .pgm-card:hover .pgm-card-image img { transform: scale(1.08); }
.pgm-gallery-wrapper[data-hover="lift"] .pgm-card:hover { transform: translateY(-6px); box-shadow: 0 14px 34px rgba(17,24,39,.14); }
.pgm-gallery-wrapper[data-hover="fade"] .pgm-card:hover .pgm-card-image img { opacity: .55; }

.pgm-badges {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	z-index: 2;
}
.pgm-badge {
	font-size: 11px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 20px;
	color: #fff;
}
.pgm-badge-featured { background: var(--pgm-secondary); }
.pgm-badge-new { background: var(--pgm-primary); }
.pgm-badge-most_requested { background: #7c3aed; }

.pgm-quick-view {
	position: absolute;
	bottom: 10px;
	left: 10px;
	background: rgba(255, 255, 255, .95);
	border: none;
	border-radius: 50%;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .2s ease, transform .2s ease;
}
.pgm-card:hover .pgm-quick-view { opacity: 1; transform: translateY(0); }

.pgm-card-body { padding: 14px 16px; }
.pgm-card-title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 700;
	color: var(--pgm-text);
}
.pgm-card-meta {
	font-size: 12.5px;
	color: var(--pgm-muted);
}

.pgm-no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 50px 20px;
	color: var(--pgm-muted);
	font-size: 15px;
}

/* ---------------- Pagination / load more ---------------- */
.pgm-pagination-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: 28px;
	gap: 14px;
}
.pgm-pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pgm-pagination button {
	min-width: 38px;
	height: 38px;
	border-radius: 8px;
	border: 1px solid var(--pgm-border);
	background: var(--pgm-white);
	cursor: pointer;
	font-weight: 600;
	color: var(--pgm-text);
	transition: all .2s ease;
}
.pgm-pagination button.is-active,
.pgm-pagination button:hover {
	background: var(--pgm-primary);
	border-color: var(--pgm-primary);
	color: #fff;
}

.pgm-load-more {
	background: var(--pgm-secondary);
	color: #fff;
	border: none;
	padding: 12px 34px;
	border-radius: 30px;
	font-weight: 700;
	cursor: pointer;
	transition: transform .2s ease, box-shadow .2s ease;
}
.pgm-load-more:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255, 140, 77, .35); }

.pgm-spinner {
	display: inline-block;
	width: 26px;
	height: 26px;
	border: 3px solid var(--pgm-bg);
	border-top-color: var(--pgm-primary);
	border-radius: 50%;
	animation: pgm-spin 0.8s linear infinite;
}
@keyframes pgm-spin { to { transform: rotate(360deg); } }

.pgm-grid.pgm-loading { opacity: .4; pointer-events: none; }

/* ---------------- Popup ---------------- */
.pgm-popup-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, .65);
	z-index: 99999;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.pgm-popup-overlay.is-open { display: flex; }

.pgm-popup {
	background: #fff;
	border-radius: 18px;
	max-width: 920px;
	width: 100%;
	max-height: 90vh;
	overflow: auto;
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	position: relative;
	direction: rtl;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
@media (max-width: 720px) {
	.pgm-popup { grid-template-columns: 1fr; }
}

.pgm-popup-close {
	position: absolute;
	top: 14px;
	left: 14px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	z-index: 3;
}

.pgm-popup-image { background: var(--pgm-bg); }
.pgm-popup-image img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 280px; }

.pgm-popup-details { padding: 30px; }
.pgm-popup-details h2 { margin: 0 0 16px; font-size: 22px; font-weight: 800; }
.pgm-popup-row { margin: 0 0 10px; font-size: 14px; color: var(--pgm-muted); }
.pgm-popup-row strong { color: var(--pgm-text); }
.pgm-popup-desc { font-size: 14px; line-height: 1.8; color: var(--pgm-muted); margin: 16px 0; }

.pgm-whatsapp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	background: var(--pgm-secondary);
	color: #fff !important;
	font-weight: 800;
	font-size: 16px;
	padding: 15px 20px;
	border-radius: 12px;
	text-decoration: none !important;
	margin-top: 10px;
	transition: transform .2s ease, box-shadow .2s ease;
}
.pgm-whatsapp-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(255, 140, 77, .4);
}

.pgm-whatsapp-btn.pgm-disabled {
	opacity: .5;
	cursor: not-allowed;
	pointer-events: none;
}
.pgm-admin-notice {
	background: #fff4e5;
	border: 1px solid #ffd8a8;
	color: #8a4b00;
	font-size: 12.5px;
	padding: 10px 12px;
	border-radius: 8px;
	margin: 10px 0;
}
.pgm-admin-notice a { color: #8a4b00; font-weight: 700; text-decoration: underline; }

body.pgm-no-scroll { overflow: hidden; }

/* ---------------- Single photo page ---------------- */
.pgm-single-photo {
	direction: rtl;
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: 40px;
	align-items: start;
}
@media (max-width: 782px) {
	.pgm-single-photo { grid-template-columns: 1fr; }
}
.pgm-single-image img {
	width: 100%;
	border-radius: 16px;
	display: block;
	object-fit: cover;
}
.pgm-single-details h1 {
	font-size: 28px;
	font-weight: 800;
	margin: 0 0 18px;
	color: var(--pgm-text);
}
.pgm-single-details .pgm-popup-desc p { margin: 0 0 12px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 992px) {
	.pgm-gallery-inner { flex-direction: column; }
	.pgm-filters-sidebar { width: 100%; flex: 1 1 auto; position: static; }
	.pgm-grid { --pgm-columns: 2 !important; }
	.pgm-layout-masonry { column-count: 2 !important; }
}
@media (max-width: 560px) {
	.pgm-grid { --pgm-columns: 1 !important; }
	.pgm-layout-masonry { column-count: 1 !important; }
	.pgm-card-image { height: 260px; }
}
