/* ==========================================================================
   WP Catalog 001 — Premium Minimal Product Catalog
   ========================================================================== */

.wpc-catalog {
	--wpc-font-heading: 'Poppins', sans-serif;
	--wpc-font-body: 'Inter', sans-serif;
	--wpc-bg: #ffffff;
	--wpc-surface: #ffffff;
	--wpc-text: #1a1a1a;
	--wpc-text-muted: #6b6b6b;
	--wpc-border: #ececec;
	--wpc-accent: #111111;
	--wpc-accent-contrast: #ffffff;
	--wpc-sale: #d0362b;
	--wpc-new: #1f8a4c;
	--wpc-star: #f5b942;
	--wpc-radius: 10px;
	--wpc-shadow: 0 2px 10px rgba(0,0,0,0.04);
	--wpc-shadow-hover: 0 12px 28px rgba(0,0,0,0.10);
	--wpc-transition: 260ms cubic-bezier(.22,.61,.36,1);

	font-family: var(--wpc-font-body);
	color: var(--wpc-text);
	background: var(--wpc-bg);
	max-width: 1440px;
	margin: 0 auto;
	padding: 32px 20px 64px;
	box-sizing: border-box;
}
.wpc-catalog *, .wpc-catalog *::before, .wpc-catalog *::after { box-sizing: border-box; }

.wpc-catalog[data-theme="dark"] {
	--wpc-bg: #0f0f10;
	--wpc-surface: #17181a;
	--wpc-text: #f2f2f2;
	--wpc-text-muted: #9c9c9c;
	--wpc-border: #2a2b2d;
	--wpc-accent: #ffffff;
	--wpc-accent-contrast: #111111;
	--wpc-shadow: 0 2px 10px rgba(0,0,0,0.4);
	--wpc-shadow-hover: 0 12px 28px rgba(0,0,0,0.5);
}

.wpc-catalog__title {
	font-family: var(--wpc-font-heading);
	font-weight: 600;
	font-size: 28px;
	margin: 0 0 24px;
	letter-spacing: -0.02em;
}

/* ---------------- Toolbar ---------------- */
.wpc-catalog__toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 24px;
}
.wpc-catalog__sort { margin-left: auto; }
.wpc-catalog__sort select {
	font-family: var(--wpc-font-body);
	border: 1px solid var(--wpc-border);
	border-radius: var(--wpc-radius);
	padding: 9px 14px;
	background: var(--wpc-surface);
	color: var(--wpc-text);
	font-size: 14px;
}
.wpc-dark-toggle {
	width: 38px; height: 38px;
	border-radius: 50%;
	border: 1px solid var(--wpc-border);
	background: var(--wpc-surface);
	display: flex; align-items: center; justify-content: center;
	cursor: pointer;
	transition: background var(--wpc-transition);
}
.wpc-dark-toggle svg { width: 18px; height: 18px; fill: none; stroke: var(--wpc-text); stroke-width: 1.6; }
.wpc-dark-toggle:hover { background: var(--wpc-border); }

/* ---------------- Buttons ---------------- */
.wpc-btn {
	font-family: var(--wpc-font-body);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.01em;
	background: var(--wpc-accent);
	color: var(--wpc-accent-contrast);
	border: 1px solid var(--wpc-accent);
	border-radius: var(--wpc-radius);
	padding: 11px 18px;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: transform var(--wpc-transition), opacity var(--wpc-transition);
}
.wpc-btn:hover { opacity: 0.85; }
.wpc-btn:active { transform: scale(0.98); }
.wpc-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.wpc-btn--outline {
	background: transparent;
	color: var(--wpc-text);
	border-color: var(--wpc-border);
}
.wpc-btn--outline:hover { background: var(--wpc-border); opacity: 1; }

/* ---------------- Layout: sidebar + grid ---------------- */
.wpc-catalog__layout {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 32px;
	align-items: start;
}
.wpc-filters {
	position: sticky;
	top: 24px;
	background: var(--wpc-surface, #ffffff);
	border: 1px solid var(--wpc-border, #ececec);
	border-radius: var(--wpc-radius, 10px);
	padding: 20px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
}
.wpc-filter-group { margin-bottom: 22px; }
.wpc-filter-group:last-of-type { margin-bottom: 12px; }
.wpc-filter-group__title {
	font-family: var(--wpc-font-heading);
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin: 0 0 12px;
	color: var(--wpc-text);
}
.wpc-filter-list { list-style: none; margin: 0; padding: 0; }
.wpc-filter-list li { margin-bottom: 9px; }
.wpc-filter-list label {
	display: flex; align-items: center; gap: 8px;
	font-size: 14px; color: var(--wpc-text-muted); cursor: pointer;
}
.wpc-filter-list input { accent-color: var(--wpc-accent); }
.wpc-count { color: var(--wpc-text-muted); font-size: 12px; }

.wpc-swatch-list { display: flex; flex-wrap: wrap; gap: 8px; }
.wpc-swatch-btn {
	width: 26px; height: 26px; border-radius: 50%;
	border: 2px solid var(--wpc-border); cursor: pointer;
	transition: border-color var(--wpc-transition), transform var(--wpc-transition);
}
.wpc-swatch-btn.is-active, .wpc-swatch-btn:hover { border-color: var(--wpc-accent); transform: scale(1.08); }

.wpc-size-list { display: flex; flex-wrap: wrap; gap: 8px; }
.wpc-size-btn {
	min-width: 36px; padding: 6px 10px;
	border: 1px solid var(--wpc-border); border-radius: 6px;
	background: transparent; color: var(--wpc-text); font-size: 13px; cursor: pointer;
	transition: all var(--wpc-transition);
}
.wpc-size-btn.is-active, .wpc-size-btn:hover { background: var(--wpc-accent); color: var(--wpc-accent-contrast); border-color: var(--wpc-accent); }

.wpc-price-range { position: relative; padding-top: 6px; }
.wpc-price-range input[type="range"] {
	width: 100%; position: absolute; top: 0; left: 0;
	pointer-events: none; -webkit-appearance: none; background: transparent;
	height: 4px;
}
.wpc-price-range input[type="range"]::-webkit-slider-thumb {
	pointer-events: auto; -webkit-appearance: none;
	width: 15px; height: 15px; border-radius: 50%;
	background: var(--wpc-accent); cursor: pointer; margin-top: -6px;
}
.wpc-price-range input[type="range"]::-moz-range-thumb {
	pointer-events: auto; width: 15px; height: 15px; border-radius: 50%;
	background: var(--wpc-accent); cursor: pointer; border: none;
}
.wpc-price-range { height: 30px; }
.wpc-price-range::before {
	content: ''; position: absolute; top: 3px; left: 0; right: 0; height: 3px;
	background: var(--wpc-border); border-radius: 2px;
}
.wpc-price-range__values {
	margin-top: 22px; font-size: 13px; color: var(--wpc-text-muted);
}

.wpc-filters-clear { width: 100%; }
.wpc-filters-toggle { display: none; }

.wpc-filters__header { display: none; }
.wpc-filters__close {
	display: none;
	border: none;
	background: transparent;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--wpc-text);
	padding: 4px 6px;
}

.wpc-filters-backdrop { display: none; }

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

/* ---------------- Grid ---------------- */
.wpc-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}
.wpc-grid[data-columns="1"] { grid-template-columns: repeat(1, 1fr); }
.wpc-grid[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.wpc-grid[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.wpc-grid[data-columns="5"] { grid-template-columns: repeat(5, 1fr); }
.wpc-grid[data-columns="6"] { grid-template-columns: repeat(6, 1fr); }

.wpc-no-products { grid-column: 1 / -1; text-align: center; color: var(--wpc-text-muted); padding: 60px 0; }

/* ---------------- Product Card ---------------- */
.wpc-card {
	background: var(--wpc-surface);
	border-radius: var(--wpc-radius);
	overflow: hidden;
	box-shadow: var(--wpc-shadow);
	transition: box-shadow var(--wpc-transition), transform var(--wpc-transition);
	display: flex;
	flex-direction: column;
}
.wpc-card:hover { box-shadow: var(--wpc-shadow-hover); transform: translateY(-3px); }

.wpc-card__media { position: relative; overflow: hidden; aspect-ratio: 1 / 1.15; background: #f7f7f7; }
.wpc-card__image-link { display: block; width: 100%; height: 100%; }
.wpc-card__image {
	position: absolute; inset: 0; width: 100%; height: 100%;
	object-fit: cover;
	transition: opacity var(--wpc-transition), transform 600ms cubic-bezier(.22,.61,.36,1);
}
.wpc-card__image--main { opacity: 1; }
.wpc-card__image--hover { opacity: 0; }
.wpc-card:hover .wpc-card__image--main { transform: scale(1.06); }
.wpc-card:hover .wpc-card__image--hover { opacity: 1; transform: scale(1.06); }

.wpc-card__badges { position: absolute; top: 12px; left: 12px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.wpc-badge {
	font-family: var(--wpc-font-heading);
	font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
	padding: 5px 10px; border-radius: 20px; color: #fff; text-transform: uppercase;
}
.wpc-badge--sale { background: var(--wpc-sale); }
.wpc-badge--new { background: var(--wpc-new); }

.wpc-card__actions {
	position: absolute; top: 12px; right: 12px; z-index: 3;
	display: flex; flex-direction: column; gap: 8px;
	opacity: 0; transform: translateX(6px);
	transition: opacity var(--wpc-transition), transform var(--wpc-transition);
}
.wpc-card:hover .wpc-card__actions { opacity: 1; transform: translateX(0); }
.wpc-icon-btn {
	width: 36px; height: 36px; border-radius: 50%;
	background: #fff; border: none; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 2px 8px rgba(0,0,0,0.12);
	transition: background var(--wpc-transition), transform var(--wpc-transition);
}
.wpc-icon-btn:hover { transform: scale(1.08); }
.wpc-icon-btn svg { width: 17px; height: 17px; fill: none; stroke: #222; stroke-width: 1.7; }
.wpc-icon-btn.is-active { background: #111; }
.wpc-icon-btn.is-active svg { stroke: #fff; fill: #fff; }

.wpc-card__overlay {
	position: absolute; inset: 0; background: rgba(255,255,255,0.7);
	display: flex; align-items: center; justify-content: center; z-index: 4;
}
.wpc-card__overlay span {
	font-family: var(--wpc-font-heading); font-weight: 600; font-size: 13px;
	background: #111; color: #fff; padding: 6px 14px; border-radius: 20px;
}

.wpc-card__body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

.wpc-card__colors { display: flex; gap: 6px; margin-bottom: 2px; }
.wpc-color-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--wpc-border); display: inline-block; }

.wpc-card__title-link { text-decoration: none; color: inherit; }
.wpc-card__title {
	font-family: var(--wpc-font-heading);
	font-size: 15px; font-weight: 600; margin: 0; line-height: 1.35;
	color: var(--wpc-text);
}
.wpc-card__desc { font-size: 13px; color: var(--wpc-text-muted); margin: 0; line-height: 1.5; }

.wpc-card__rating { display: flex; align-items: center; gap: 3px; }
.wpc-star { color: var(--wpc-border); font-size: 13px; }
.wpc-star.is-filled { color: var(--wpc-star); }
.wpc-card__review-count { font-size: 12px; color: var(--wpc-text-muted); margin-left: 4px; }

.wpc-card__price { font-family: var(--wpc-font-heading); font-size: 16px; font-weight: 600; }
.wpc-card__price ins { text-decoration: none; color: var(--wpc-sale); margin-left: 6px; }
.wpc-card__price del { color: var(--wpc-text-muted); font-weight: 400; font-size: 13px; }

.wpc-card__meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--wpc-text-muted); margin-top: 2px; }
.wpc-stock--instock { color: var(--wpc-new); }
.wpc-stock--outofstock { color: var(--wpc-sale); }
.wpc-stock--onbackorder { color: #b8862a; }

.wpc-card__tags { font-size: 11px; color: var(--wpc-text-muted); }
.wpc-card__tags a { color: inherit; text-decoration: none; }
.wpc-card__tags a:hover { text-decoration: underline; }

.wpc-add-to-cart-btn { width: 100%; margin-top: 8px; }

/* ---------------- Load more / loader ---------------- */
.wpc-catalog__load-more { text-align: center; margin-top: 40px; }
.wpc-loader {
	width: 22px; height: 22px; margin: 16px auto 0;
	border: 2px solid var(--wpc-border); border-top-color: var(--wpc-accent);
	border-radius: 50%; animation: wpc-spin 0.7s linear infinite;
}
@keyframes wpc-spin { to { transform: rotate(360deg); } }

/* ---------------- Toast ---------------- */
.wpc-toast {
	position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
	background: #111; color: #fff; font-family: var(--wpc-font-body); font-size: 14px;
	padding: 12px 20px; border-radius: 30px; z-index: 9999;
	opacity: 0; pointer-events: none;
	transition: opacity var(--wpc-transition), transform var(--wpc-transition);
	box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.wpc-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- Quick View Modal ---------------- */
.wpc-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.wpc-modal[hidden] { display: none; }
.wpc-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.wpc-modal__panel {
	position: relative; background: var(--wpc-surface, #fff); color: var(--wpc-text, #111);
	border-radius: 14px; max-width: 780px; width: 92%; max-height: 86vh; overflow-y: auto;
	padding: 32px; z-index: 1;
	animation: wpc-modal-in 220ms ease;
}
@keyframes wpc-modal-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.wpc-modal__close {
	position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%;
	border: 1px solid var(--wpc-border, #eee); background: transparent; font-size: 20px; cursor: pointer; line-height: 1;
}
.wpc-quickview { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.wpc-quickview__gallery img { width: 100%; border-radius: 10px; object-fit: cover; }
.wpc-quickview__info h2 { font-family: var(--wpc-font-heading); margin: 0 0 10px; font-size: 22px; }
.wpc-quickview__info .wpc-btn { margin-top: 8px; margin-right: 8px; }

/* ---------------- Compare Drawer ---------------- */
.wpc-compare-drawer {
	position: fixed; bottom: 0; left: 0; right: 0; z-index: 9998;
	background: var(--wpc-surface, #fff); border-top: 1px solid var(--wpc-border, #eee);
	box-shadow: 0 -8px 24px rgba(0,0,0,0.1);
	max-height: 60vh; overflow-y: auto;
	transform: translateY(100%); transition: transform var(--wpc-transition);
}
.wpc-compare-drawer:not([hidden]) { transform: translateY(0); }
.wpc-compare-drawer__header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--wpc-border, #eee); }
.wpc-compare-drawer__header h4 { font-family: var(--wpc-font-heading); margin: 0; }
.wpc-compare-drawer__close { border: none; background: transparent; font-size: 22px; cursor: pointer; }
.wpc-compare-drawer__table { padding: 16px 24px; }
.wpc-compare-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wpc-compare-table th, .wpc-compare-table td { padding: 10px; border-bottom: 1px solid var(--wpc-border, #eee); text-align: left; vertical-align: top; }
.wpc-compare-table img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.wpc-compare-remove { display: block; margin-top: 4px; border: none; background: transparent; cursor: pointer; color: var(--wpc-sale); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
	.wpc-grid,
	.wpc-grid[data-columns="3"],
	.wpc-grid[data-columns="4"],
	.wpc-grid[data-columns="5"] { grid-template-columns: repeat(2, 1fr); }

	.wpc-catalog__layout { grid-template-columns: 1fr; }
	.wpc-filters-toggle { display: inline-flex; }
	.wpc-filters {
		position: fixed; top: 0; right: 0; bottom: 0; width: 300px; max-width: 86vw;
		max-height: none; border-radius: 0; z-index: 999999;
		transform: translateX(100%); transition: transform var(--wpc-transition);
	}
	.wpc-filters.is-open { transform: translateX(0); }
	.wpc-filters__header {
		display: flex; align-items: center; justify-content: space-between;
		margin: -20px -20px 18px; padding: 16px 16px 16px 20px;
		border-bottom: 1px solid var(--wpc-border, #ececec);
		position: sticky; top: -20px; background: var(--wpc-surface, #ffffff); z-index: 1;
	}
	.wpc-filters__title { margin: 0; font-family: var(--wpc-font-heading); font-size: 16px; font-weight: 600; }
	.wpc-filters__close { display: inline-flex; }

	.wpc-filters-backdrop {
		display: block; position: fixed; inset: 0; z-index: 999998;
		background: rgba(0,0,0,0.45);
		opacity: 0; visibility: hidden;
		transition: opacity var(--wpc-transition), visibility var(--wpc-transition);
	}
	.wpc-filters-backdrop.is-open { opacity: 1; visibility: visible; }
}

@media (max-width: 600px) {
	.wpc-catalog { padding: 20px 14px 48px; }
	.wpc-grid,
	.wpc-grid[data-columns="3"],
	.wpc-grid[data-columns="4"],
	.wpc-grid[data-columns="5"] { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.wpc-card__title { font-size: 13px; }
	.wpc-card__body { padding: 12px; gap: 4px; }
	.wpc-quickview { grid-template-columns: 1fr; }
	.wpc-catalog__title { font-size: 22px; }
}

/* Respect OS-level dark mode when the widget is set to 'auto' and no
   explicit toggle has been made (handled via JS adding data-theme). */
