/* ==========================================================================
   WooCommerce Custom Shop Grid  -  base styles
   Everything is driven by CSS variables + low-specificity selectors so the
   Elementor style controls can override any part.
   ========================================================================== */

.wcsg {
	--wcsg-accent: #ff5fa2;
	--wcsg-accent-soft: #fff0f6;
	--wcsg-text: #2b2b33;
	--wcsg-muted: #7a7a85;
	--wcsg-border: #f1e7ec;
	--wcsg-sticky-top: 20px;

	display: flex;
	align-items: flex-start;
	gap: 32px;
	width: 100%;
	color: var(--wcsg-text);
	font-family: inherit;
	box-sizing: border-box;
}
@supports (color: color-mix(in srgb, red, blue)) {
	.wcsg {
		--wcsg-accent-soft: color-mix(in srgb, var(--wcsg-accent) 10%, #fff);
	}
}
.wcsg *,
.wcsg *::before,
.wcsg *::after {
	box-sizing: border-box;
}
.wcsg a {
	box-shadow: none;
}

/* ---------- Layout ---------- */
.wcsg-sidebar {
	flex: 0 0 240px;
	width: 240px;
	min-width: 0;
}
.wcsg-main {
	flex: 1 1 0;
	min-width: 0;
}
.wcsg--side-right {
	flex-direction: row-reverse;
}
.wcsg--side-top {
	flex-direction: column;
	align-items: stretch;
	gap: 24px;
}
.wcsg--side-top .wcsg-sidebar {
	flex: none !important;
	width: 100% !important;
}
.wcsg--side-top .wcsg-cats {
	flex-direction: row;
	flex-wrap: wrap;
}
.wcsg--side-top .wcsg-cats li {
	margin-left: 0;
}
.wcsg--side-top .wcsg-filters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	align-items: start;
}
.wcsg--no-sidebar .wcsg-main {
	width: 100%;
}
.wcsg-sticky-yes .wcsg-sidebar {
	position: sticky;
	top: var(--wcsg-sticky-top);
	align-self: flex-start;
}

/* ---------- Sidebar title + categories ---------- */
.wcsg-sidebar-title {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wcsg-text);
}
.wcsg-cats {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.wcsg-cats li {
	margin: 0 0 0 calc(var(--wcsg-depth, 0) * 14px);
	padding: 0;
	list-style: none;
}
.wcsg-cat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.4;
	color: #555;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.wcsg-cat:hover {
	background-color: var(--wcsg-accent-soft);
	color: var(--wcsg-accent);
	text-decoration: none;
}
.wcsg-cat.is-active {
	background-color: var(--wcsg-accent-soft);
	color: var(--wcsg-accent);
	font-weight: 600;
}
.wcsg-cat-count {
	font-size: 12px;
	color: var(--wcsg-muted);
}

/* ---------- Sidebar filters ---------- */
.wcsg-filters {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin-top: 28px;
	--wcsg-range-color: var(--wcsg-accent);
}
.wcsg-sidebar > .wcsg-search-wrap {
	margin-bottom: 24px;
}
.wcsg-filter-title {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wcsg-text);
}
.wcsg-search {
	display: block;
	width: 100%;
	margin: 0;
	padding: 10px 14px;
	border: 1px solid var(--wcsg-border);
	border-radius: 8px;
	background-color: #fff;
	font-size: 14px;
	color: var(--wcsg-text);
	outline: 0;
	box-shadow: none;
	transition: border-color 0.2s;
}
.wcsg-search:focus {
	border-color: var(--wcsg-accent);
}

/* dual price slider */
.wcsg-range {
	position: relative;
	height: 22px;
}
.wcsg-range-track {
	position: absolute;
	left: 9px;
	right: 9px;
	top: 50%;
	height: 4px;
	margin-top: -2px;
	border-radius: 4px;
	background: var(--wcsg-border);
}
.wcsg-range-fill {
	position: absolute;
	top: 0;
	bottom: 0;
	left: calc(var(--lo, 0) * 100%);
	right: calc((1 - var(--hi, 1)) * 100%);
	border-radius: 4px;
	background: var(--wcsg-range-color, var(--wcsg-accent));
}
.wcsg-range input[type="range"] {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 22px;
	margin: 0;
	padding: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
	outline: 0;
}
.wcsg-range input[type="range"]::-webkit-slider-runnable-track {
	height: 22px;
	background: transparent;
	border: 0;
}
.wcsg-range input[type="range"]::-moz-range-track {
	height: 22px;
	background: transparent;
	border: 0;
}
.wcsg-range input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	pointer-events: auto;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	border-radius: 50%;
	border: 2px solid var(--wcsg-range-color, var(--wcsg-accent));
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
	cursor: grab;
}
.wcsg-range input[type="range"]::-moz-range-thumb {
	pointer-events: auto;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid var(--wcsg-range-color, var(--wcsg-accent));
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
	cursor: grab;
}
.wcsg-range-values {
	display: flex;
	justify-content: space-between;
	margin-top: 6px;
	font-size: 13px;
	color: #666;
}

/* rating + checkbox rows */
.wcsg-rate {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	font-size: 13px;
	color: #666;
	text-decoration: none;
	cursor: pointer;
}
.wcsg-rate:hover,
.wcsg-rate.is-active {
	color: var(--wcsg-accent);
	text-decoration: none;
}
.wcsg-rate.is-active .wcsg-rate-label {
	font-weight: 600;
}
.wcsg-check {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 6px;
	font-size: 13px;
	color: #666;
	cursor: pointer;
}
.wcsg-check input {
	margin: 0;
	accent-color: var(--wcsg-range-color, var(--wcsg-accent));
}
.wcsg-reset {
	font-size: 13px;
	color: var(--wcsg-accent);
	text-decoration: underline;
	cursor: pointer;
}
.wcsg-reset[hidden] {
	display: none;
}

/* ---------- Top bar ---------- */
.wcsg-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px 16px;
	margin-bottom: 20px;
}
.wcsg-count {
	font-size: 14px;
	color: var(--wcsg-muted);
}
.wcsg-sort {
	min-width: 170px;
	max-width: 100%;
	margin: 0 0 0 auto;
	padding: 9px 36px 9px 14px;
	border: 1px solid var(--wcsg-border);
	border-radius: 8px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23777' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	font-size: 13px;
	color: #555;
	line-height: 1.4;
	cursor: pointer;
	outline: 0;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}
.wcsg-sort:focus {
	border-color: var(--wcsg-accent);
}

/* ---------- Grid ---------- */
.wcsg-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	transition: opacity 0.2s ease;
	scroll-margin-top: 90px;
}
.wcsg.is-loading .wcsg-grid {
	opacity: 0.45;
	pointer-events: none;
}
.wcsg.is-loading .wcsg-pagination {
	opacity: 0.6;
	pointer-events: none;
}
.wcsg-empty {
	grid-column: 1 / -1;
	margin: 0;
	padding: 48px 12px;
	text-align: center;
	color: var(--wcsg-muted);
}

/* ---------- Card ---------- */
.wcsg-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #f6eef2;
	border-radius: 14px;
	background-color: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.wcsg-card:hover {
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}
.wcsg-media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background-color: #fdeef3;
}
.wcsg-media-link {
	display: block;
	width: 100%;
	height: 100%;
}
.wcsg-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	transition: transform 0.4s ease;
}
.wcsg-card.is-out-of-stock .wcsg-img {
	opacity: 0.6;
}

.wcsg-badge {
	position: absolute;
	z-index: 2;
	top: var(--wcsg-badge-y, 10px);
	right: var(--wcsg-badge-x, 10px);
	padding: 3px 10px;
	border-radius: 999px;
	background-color: var(--wcsg-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.5;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}
.wcsg-badge-left .wcsg-badge {
	right: auto;
	left: var(--wcsg-badge-x, 10px);
}
.wcsg-badge--soldout {
	background-color: #444;
}

.wcsg-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px 16px;
	text-align: left;
}
.wcsg-cat-label {
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wcsg-muted);
}
.wcsg-title {
	margin: 0;
	padding: 0;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--wcsg-text);
}
.wcsg-title a {
	color: inherit;
	text-decoration: none;
}
.wcsg-title a:hover {
	color: var(--wcsg-accent);
}

.wcsg-price {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wcsg-accent);
}
.wcsg-price .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.wcsg-price-sale,
.wcsg-price ins {
	background: none;
	color: var(--wcsg-accent);
	font-weight: inherit;
	text-decoration: none;
}
.wcsg-price-regular,
.wcsg-price del {
	margin-left: 6px;
	color: #9a9aa3;
	font-size: 0.9em;
	font-weight: 400;
	text-decoration: line-through;
	opacity: 1;
}

.wcsg-rating {
	line-height: 1;
}
.wcsg-stars {
	position: relative;
	display: inline-block;
	vertical-align: middle;
	font-size: 15px;
	line-height: 1;
	letter-spacing: 2px;
	white-space: nowrap;
	color: #eadfe4;
}
.wcsg-stars::before {
	content: "\2605\2605\2605\2605\2605";
}
.wcsg-stars-fill {
	position: absolute;
	top: 0;
	left: 0;
	width: var(--wcsg-rating, 0%);
	overflow: hidden;
	white-space: nowrap;
	color: var(--wcsg-accent);
}
.wcsg-stars-fill::before {
	content: "\2605\2605\2605\2605\2605";
}
.wcsg-rating-count {
	margin-left: 6px;
	font-size: 12px;
	vertical-align: middle;
	color: var(--wcsg-muted);
}

.wcsg-btn {
	display: block;
	width: 100%;
	margin-top: auto;
	padding: 11px 14px;
	border: 1px solid transparent;
	border-radius: 8px;
	background-color: var(--wcsg-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.wcsg-btn:hover {
	filter: brightness(0.94);
	text-decoration: none;
}
.wcsg-btn.loading {
	opacity: 0.7;
	pointer-events: none;
}
.wcsg-btn.added::after {
	content: " \2713";
}
.wcsg-card .added_to_cart {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	text-align: center;
	color: var(--wcsg-accent);
}

/* ---------- Pagination ---------- */
.wcsg-pagination {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}
.wcsg-pagination:empty {
	display: none;
}
.wcsg-pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.wcsg-page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid #eee;
	border-radius: 8px;
	background-color: #fff;
	color: #333;
	font-size: 14px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s ease;
}
a.wcsg-page:hover {
	border-color: var(--wcsg-accent);
	color: var(--wcsg-accent);
	text-decoration: none;
}
.wcsg-page.is-active {
	border-color: var(--wcsg-accent);
	background-color: var(--wcsg-accent);
	color: #fff;
	cursor: default;
}
.wcsg-page.is-dots {
	border-color: transparent;
	background: none;
	cursor: default;
}
.wcsg-load-more {
	display: inline-block;
	padding: 11px 28px;
	border: 1px solid var(--wcsg-accent);
	border-radius: 8px;
	background-color: #fff;
	color: var(--wcsg-accent);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s ease;
}
.wcsg-load-more:hover {
	background-color: var(--wcsg-accent);
	color: #fff;
	text-decoration: none;
}
.wcsg-sentinel {
	display: flex;
	justify-content: center;
	min-height: 30px;
}
.wcsg-spinner {
	width: 22px;
	height: 22px;
	border: 3px solid var(--wcsg-border);
	border-top-color: var(--wcsg-accent);
	border-radius: 50%;
	animation: wcsg-spin 0.8s linear infinite;
}
@keyframes wcsg-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.wcsg-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.wcsg,
	.wcsg--side-left,
	.wcsg--side-right {
		flex-direction: column !important;
		align-items: stretch;
		gap: 20px;
	}
	.wcsg-sidebar {
		flex: none !important;
		width: 100% !important;
		position: static !important;
	}
	.wcsg-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}
	/* categories become horizontally scrollable chips */
	.wcsg-cats {
		flex-direction: row;
		overflow-x: auto;
		gap: 8px;
		padding-bottom: 6px;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.wcsg-cats::-webkit-scrollbar {
		display: none;
	}
	.wcsg-cats li {
		flex: 0 0 auto;
		margin-left: 0 !important;
	}
	.wcsg-cat {
		white-space: nowrap;
		border: 1px solid var(--wcsg-border);
		border-radius: 999px;
	}
	.wcsg-card-body {
		padding: 12px;
	}
	.wcsg-title {
		font-size: 14px;
	}
	.wcsg-topbar {
		flex-direction: column;
		align-items: stretch;
	}
	.wcsg-sort {
		width: 100%;
		margin-left: 0;
	}
}
