/* FotoVeikals Core — restyle of Product Catalog Simple (impleCode) listing.
   Uses only the plugin's own classes, so it does nothing on other pages. */

/* ---------- Page header + notice ---------- */
.entry-content > .wp-block-group:has(.product-list) > h2.wp-block-heading {
	margin-bottom: 12px;
	font-size: clamp(2rem, 4vw, 2.75rem);
	letter-spacing: -.02em;
	text-transform: none;
}
.entry-content > .wp-block-group:has(.product-list) > h4.wp-block-heading {
	max-width: 760px;
	margin: 0 auto 32px;
	padding: 14px 20px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--fv-accent, #e8452c) 8%, #fff);
	border: 1px solid color-mix(in srgb, var(--fv-accent, #e8452c) 22%, #fff);
	color: var(--fv-ink, #1c1b18) !important;
	font-size: .98rem;
	font-weight: 500;
	line-height: 1.5;
	text-align: center;
}
.entry-content > .wp-block-group:has(.product-list) > h4.wp-block-heading a { color: var(--fv-accent, #e8452c) !important; font-weight: 700; }

/* The white rounded box around sidebar + grid becomes a plain layout. */
.wp-block-columns:has(.product_category_filter) {
	background: transparent !important;
	padding: 0 !important;
	gap: 40px !important;
	align-items: flex-start !important;
}
.wp-block-columns:has(.product_category_filter) > .wp-block-column { padding: 0 !important; }

/* ---------- Category sidebar ---------- */
.wp-block-column:has(> .ic-block-product-category-filter),
.wp-block-column:has(.product_category_filter) {
	position: sticky;
	top: 24px;
	flex-basis: 250px !important;
	flex-grow: 0 !important;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	scrollbar-width: thin;
}
.product_category_filter .widgettitle {
	margin: 0 0 12px;
	font-size: .8rem !important;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--fv-muted, #6d685f);
}
.product-category-filter-container { display: flex; flex-direction: column; gap: 2px; }
.product-category-filter-container .filter-url {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 9px 12px;
	border-radius: 10px;
	color: var(--fv-ink, #1c1b18) !important;
	font-size: .95rem;
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none !important;
	transition: background-color .15s, color .15s;
}
.product-category-filter-container .filter-url:hover { background: var(--fv-soft, #f2eee7); }
.product-category-filter-container .filter-url.active,
.product-category-filter-container .filter-url[aria-current],
.product-category-filter-container .active > .filter-url {
	background: var(--fv-ink, #1c1b18);
	color: #fff !important;
}
.ic-catalog-category-count {
	flex: none;
	min-width: 30px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--fv-soft, #f2eee7);
	color: var(--fv-muted, #6d685f);
	font-size: .78rem;
	font-weight: 600;
	text-align: center;
	font-variant-numeric: tabular-nums;
}
.filter-url:hover .ic-catalog-category-count { background: #fff; }
.filter-url.active .ic-catalog-category-count { background: rgba(255, 255, 255, .18); color: #fff; }
/* Sale category (first item, "!Izpārdošana") stands out. */
.product-category-filter-container > .filter-url:first-child {
	margin-bottom: 8px;
	background: color-mix(in srgb, var(--fv-accent, #e8452c) 10%, #fff);
	color: var(--fv-accent, #e8452c) !important;
	font-weight: 700;
}
.product-category-filter-container > .filter-url:first-child .ic-catalog-category-count { background: var(--fv-accent, #e8452c); color: #fff; }

/* ---------- "Viss katalogs" heading ---------- */
.ic-catalog-container .catalog-header,
h2.catalog-header {
	margin: 0 0 20px;
	font-size: 1.5rem;
	letter-spacing: -.01em;
}

/* ---------- Product grid ---------- */
.product-list.grid {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	margin: 0 !important;
}
.product-list.grid::before, .product-list.grid::after { content: none !important; display: none !important; }
.product-list.grid .archive-listing {
	float: none !important;
	width: auto !important;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	clear: none !important;
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(28, 27, 24, .06), 0 8px 24px -12px rgba(28, 27, 24, .18);
	transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s;
}
.product-list.grid .archive-listing:hover {
	transform: translateY(-4px);
	box-shadow: 0 2px 4px rgba(28, 27, 24, .06), 0 18px 40px -16px rgba(28, 27, 24, .28);
}
.product-list.grid .archive-listing > a {
	display: flex !important;
	flex-direction: column;
	height: 100%;
	color: var(--fv-ink, #1c1b18) !important;
	text-decoration: none !important;
}
.product-list.grid .classic-grid-image-wrapper {
	position: relative;
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1 / 1;
	margin: 0 !important;
	background: #fff;
	overflow: hidden;
	border: 0 !important;
}
.product-list.grid .classic-grid-image-wrapper .pseudo { display: none !important; }
.product-list.grid .classic-grid-image-wrapper .image {
	position: absolute !important;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
}
.product-list.grid .classic-grid-image {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: contain;
	transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.product-list.grid .archive-listing:hover .classic-grid-image { transform: scale(1.05); }
.product-list.grid .classic-grid-image.default-image { width: 40% !important; height: 40% !important; opacity: .35; }
.product-list.grid .product-name {
	margin: 0 !important;
	padding: 12px 14px 14px !important;
	border-top: 1px solid var(--fv-line, #e8e3da);
	font-size: .95rem !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	text-align: left !important;
	color: var(--fv-ink, #1c1b18) !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- Pagination ---------- */
.product-archive-nav { margin: 36px 0 0 !important; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; }
.product-archive-nav ul { display: flex !important; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 !important; padding: 0 !important; list-style: none !important; }
.product-archive-nav li { margin: 0 !important; padding: 0 !important; float: none !important; background: none !important; border: 0 !important; }
.product-archive-nav li a,
.product-archive-nav li.nav-dots {
	display: inline-grid !important;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding: 0 14px !important;
	border-radius: 999px !important;
	border: 1px solid var(--fv-line, #e8e3da) !important;
	background: #fff !important;
	color: var(--fv-ink, #1c1b18) !important;
	font-weight: 600;
	font-size: .95rem;
	line-height: 1;
	text-decoration: none !important;
	box-shadow: none !important;
	font-variant-numeric: tabular-nums;
}
.product-archive-nav li.nav-dots { border: 0 !important; background: none !important; min-width: 24px; padding: 0 !important; }
.product-archive-nav li a:hover { border-color: var(--fv-ink, #1c1b18) !important; }
.product-archive-nav li.active a { background: var(--fv-ink, #1c1b18) !important; border-color: var(--fv-ink, #1c1b18) !important; color: #fff !important; }
.product-archive-nav li.next-page a,
.product-archive-nav li.previous-page a { background: var(--fv-accent, #e8452c) !important; border-color: var(--fv-accent, #e8452c) !important; color: #fff !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .product-list.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (max-width: 781px) {
	.wp-block-columns:has(.product_category_filter) { gap: 16px !important; }
	.wp-block-column:has(.product_category_filter) {
		position: sticky;
		top: 0;
		z-index: 20;
		flex-basis: 100% !important;
		max-height: none;
		overflow: visible;
		margin: 0 -16px;
		padding: 10px 16px !important;
		background: color-mix(in srgb, var(--fv-paper, #faf8f4) 92%, transparent);
		backdrop-filter: blur(8px);
	}
	.product_category_filter .widgettitle { display: none; }
	/* Categories become a horizontal row of chips. */
	.product-category-filter-container {
		flex-direction: row;
		gap: 8px;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 2px;
	}
	.product-category-filter-container::-webkit-scrollbar { display: none; }
	.product-category-filter-container .filter-url {
		flex: none;
		scroll-snap-align: start;
		padding: 8px 14px;
		border: 1px solid var(--fv-line, #e8e3da);
		border-radius: 999px;
		background: #fff;
		white-space: nowrap;
		font-size: .9rem;
	}
	.product-category-filter-container > .filter-url:first-child { margin-bottom: 0; border-color: transparent; }
	.ic-catalog-category-count { min-width: 0; padding: 1px 7px; font-size: .72rem; }

	.product-list.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.product-list.grid .product-name { font-size: .88rem !important; padding: 10px 12px 12px !important; }
	.entry-content > .wp-block-group:has(.product-list) > h4.wp-block-heading { font-size: .9rem; margin-bottom: 20px; }
}
