/**
 * YEG Product Archive
 */

.yeg-product-archive {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 0 60px;
	color: var(--ast-global-color-3, #222b12);
	font-family: inherit;
}

/* Override Astra's content container width so listing pages align to
   exactly 1280px instead of inheriting Astra's wider default. */
body.post-type-archive-quality-product .site-content .ast-container,
body.tax-product-type .site-content .ast-container,
body.tax-brand .site-content .ast-container,
body.tax-manufacturer .site-content .ast-container,
body.tax-pattern .site-content .ast-container,
body.tax-collection .site-content .ast-container,
body.tax-application .site-content .ast-container {
	max-width: 1280px;
	padding-left: 0;
	padding-right: 0;
}
@media (max-width: 1280px) {
	body.post-type-archive-quality-product .site-content .ast-container,
	body.tax-product-type .site-content .ast-container,
	body.tax-brand .site-content .ast-container,
	body.tax-manufacturer .site-content .ast-container,
	body.tax-pattern .site-content .ast-container,
	body.tax-collection .site-content .ast-container,
	body.tax-application .site-content .ast-container {
		padding-left: 16px;
		padding-right: 16px;
	}
}

/* Breadcrumb */
.yeg-breadcrumb {
	font-size: 14px;
	color: #6b6b6b;
	margin: 20px 0 40px;
}
.yeg-breadcrumb a { color: inherit; text-decoration: none; }
.yeg-breadcrumb a:hover { text-decoration: underline; }
.yeg-breadcrumb [aria-current="page"] { color: #111; font-weight: 500; }
.yeg-breadcrumb-sep { margin: 0 8px; color: #c0c0c0; }

/* Header block */
.yeg-archive-header { margin-bottom: 32px; }
.yeg-archive-title {
	margin: 0 0 20px;
}
.yeg-archive-intro {
	max-width: 80ch;
	color: #444;
	font-size: 16px;
	line-height: 1.55;
	margin: 0;
}
.yeg-archive-intro p { margin: 0 0 12px; }
.yeg-archive-intro p:last-child { margin-bottom: 0; }

/* Shop by Brand */
.yeg-shop-by-brand { margin: 0 0 40px; }
.yeg-shop-by-brand-title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #6b6b6b;
	margin: 0 0 16px;
}
.yeg-brand-circles {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 12px;
}
.yeg-brand-circle {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 50%;
	padding: 18px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.yeg-brand-circle:hover {
	border-color: #b8b8b8;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
	transform: translateY(-1px);
}
.yeg-brand-circle img { max-width: 100%; max-height: 70%; object-fit: contain; }
.yeg-brand-circle-label { font-size: 13px; font-weight: 600; text-align: center; color: #333; }

/* Two-column layout */
.yeg-archive-layout {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 32px;
	align-items: start;
}

/* Filter sidebar (desktop: inline column) */
.yeg-filter-sidebar {
	position: static;
}
.yeg-filter-sidebar-overlay { display: none; }
.yeg-filter-sidebar-panel { display: block; }
.yeg-filter-form { display: block; }
.yeg-filter-sidebar-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid #ececec;
	margin-bottom: 4px;
}
.yeg-filter-sidebar-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0;
	color: #111;
	flex: 1;
}
.yeg-filter-clear {
	font-size: 13px;
	color: #2d6cdf;
	text-decoration: underline;
}

/* Mobile drawer chrome — hidden on desktop */
.yeg-filter-drawer-close { display: none; }
.yeg-filter-sidebar-body { display: contents; }
.yeg-filter-sidebar-footer { display: none; }

/* Brand filter section — hidden on desktop (covered by the circles row),
   shown on mobile in the drawer. */
.yeg-filter-section.is-mobile-only { display: none; }

/* Filter Products trigger button — mobile-only */
.yeg-filter-trigger { display: none; }

.yeg-filter-section {
	border-bottom: 1px solid #ececec;
	padding: 4px 0;
}
.yeg-filter-section[open] { padding-bottom: 10px; }
.yeg-filter-section-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 0;
	font-size: 15px;
	font-weight: 600;
	color: #1a1a1a;
	cursor: pointer;
	list-style: none;
	user-select: none;
}
.yeg-filter-section-title::-webkit-details-marker { display: none; }
.yeg-filter-section-toggle {
	width: 16px;
	height: 16px;
	position: relative;
	flex-shrink: 0;
}
.yeg-filter-section-toggle::before,
.yeg-filter-section-toggle::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	background: #1a1a1a;
}
.yeg-filter-section-toggle::before { width: 12px; height: 2px; transform: translate(-50%, -50%); }
.yeg-filter-section-toggle::after  { width: 2px; height: 12px; transform: translate(-50%, -50%); transition: transform 0.15s ease; }
.yeg-filter-section[open] .yeg-filter-section-toggle::after { transform: translate(-50%, -50%) scaleY(0); }

.yeg-filter-option-list {
	list-style: none;
	margin: 0;
	padding: 0 0 4px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.yeg-filter-option label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #333;
	cursor: pointer;
	line-height: 1.3;
}
.yeg-filter-option input[type="checkbox"] {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: #1a1a1a;
	flex-shrink: 0;
}
.yeg-filter-option-label { flex: 1; }
.yeg-filter-option-count { color: #888; font-size: 13px; }
.yeg-filter-option label:hover .yeg-filter-option-label { color: #000; }

.yeg-filter-see-more {
	background: none;
	border: 0;
	padding: 6px 0 4px;
	font-size: 13px;
	font-weight: 600;
	color: #1a1a1a;
	cursor: pointer;
	text-decoration: underline;
}
.yeg-filter-apply {
	margin-top: 16px;
	background: #1a1a1a;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 10px 16px;
	font-weight: 600;
	cursor: pointer;
	width: 100%;
}

/* Toolbar above grid */
.yeg-archive-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}
.yeg-archive-meta { font-size: 14px; color: #555; }
.yeg-archive-meta strong { color: #111; }
.yeg-sort-form { display: flex; align-items: center; }
.yeg-sort-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #555; }
.yeg-sort-label select {
	appearance: none;
	-webkit-appearance: none;
	background: #fff;
	border: 1px solid #d6d6d6;
	border-radius: 6px;
	padding: 7px 28px 7px 12px;
	font-size: 14px;
	color: #222;
	cursor: pointer;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
	background-repeat: no-repeat;
	background-position: right 10px center;
}

/* Product grid */
.yeg-product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 24px 20px;
}

/* Product card */
.yeg-product-card {
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 10px;
	overflow: hidden;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.yeg-product-card:hover {
	border-color: #d6d6d6;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
	transform: translateY(-2px);
}
.yeg-product-card-link { display: block; color: inherit; text-decoration: none; }
.yeg-product-card-image {
	position: relative;
	aspect-ratio: 1;
	background: #f4f4f4;
	overflow: hidden;
}
.yeg-product-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.yeg-product-card-image-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #f0f0f0 0%, #e5e5e5 100%);
}

/* Brand badge — top right of image */
.yeg-product-card-brand-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(26, 26, 26, 0.9);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	padding: 5px 10px;
	border-radius: 999px;
	max-width: calc(100% - 20px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 1;
}

.yeg-product-card-body { padding: 14px 14px 18px; }
.yeg-product-card-collection {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #888;
	margin-bottom: 6px;
}
.yeg-product-card-title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	margin: 0 0 4px;
	color: #1a1a1a;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.yeg-product-card-subtitle {
	font-size: 13px;
	color: #666;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Skeleton loader */
.yeg-loader {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 24px 20px;
	margin-top: 24px;
}
.yeg-loader[hidden] { display: none; }
.yeg-card-skeleton {
	aspect-ratio: 0.78;
	background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: yeg-skeleton-shimmer 1.4s infinite;
	border-radius: 10px;
}
@keyframes yeg-skeleton-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

.yeg-empty {
	grid-column: 1 / -1;
	padding: 48px 16px;
	text-align: center;
	color: #666;
	font-size: 16px;
}

/* Below the 1280px breakpoint, add inner padding so content doesn't touch
   the viewport edges. */
@media (max-width: 1280px) {
	.yeg-product-archive { padding: 0 16px 60px; }
}

/* Tablet & mobile */
@media (max-width: 1024px) {
	.yeg-archive-layout { grid-template-columns: 220px 1fr; gap: 24px; }
}
@media (max-width: 768px) {
	.yeg-product-archive { padding: 0 16px 60px; }
	.yeg-archive-layout { display: block; }

	/* Hide the desktop brand circles on mobile — brand is in the drawer instead. */
	.yeg-shop-by-brand { display: none; }

	/* Show the brand filter section on mobile. */
	.yeg-filter-section.is-mobile-only { display: block; }

	/* Filter Products trigger button. */
	.yeg-filter-trigger {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		background: #1a1a1a;
		color: #fff;
		border: 0;
		border-radius: 999px;
		padding: 10px 16px;
		font-size: 14px;
		font-weight: 600;
		cursor: pointer;
		order: -1;
	}
	.yeg-archive-toolbar { gap: 12px; }

	/* Sidebar becomes an off-canvas drawer. */
	.yeg-filter-sidebar {
		position: fixed;
		inset: 0;
		top: 0; right: 0; bottom: 0; left: 0;
		z-index: 9999;
		pointer-events: none;
		visibility: hidden;
		transition: visibility 0s linear 0.3s;
	}
	.yeg-filter-sidebar[data-open="true"] {
		pointer-events: auto;
		visibility: visible;
		transition-delay: 0s;
	}
	.yeg-filter-sidebar-overlay {
		display: block;
		position: absolute;
		inset: 0;
		background: rgba(0, 0, 0, 0.45);
		opacity: 0;
		transition: opacity 0.25s ease;
	}
	.yeg-filter-sidebar[data-open="true"] .yeg-filter-sidebar-overlay {
		opacity: 1;
	}
	.yeg-filter-sidebar-panel {
		position: absolute;
		top: 0;
		left: 0;
		bottom: 0;
		width: min(85%, 360px);
		max-width: 360px;
		background: #fff;
		transform: translateX(-100%);
		transition: transform 0.3s ease;
		overflow-y: auto;
		display: flex;
		flex-direction: column;
		-webkit-overflow-scrolling: touch;
	}
	.yeg-filter-sidebar[data-open="true"] .yeg-filter-sidebar-panel {
		transform: translateX(0);
	}
	.yeg-filter-form {
		display: flex;
		flex-direction: column;
		min-height: 100%;
	}
	.yeg-filter-sidebar-header {
		padding: 14px 16px 10px;
		margin: 0;
		border-bottom: 1px solid #ececec;
		position: sticky;
		top: 0;
		background: #fff;
		z-index: 1;
	}
	.yeg-filter-drawer-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 32px;
		height: 32px;
		background: none;
		border: 0;
		border-radius: 50%;
		color: #1a1a1a;
		cursor: pointer;
	}
	.yeg-filter-drawer-close:hover { background: #f4f4f4; }
	.yeg-filter-sidebar-body {
		display: block;
		padding: 0 16px;
		flex: 1;
	}
	.yeg-filter-sidebar-footer {
		display: block;
		position: sticky;
		bottom: 0;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
		background: #fff;
		border-top: 1px solid #ececec;
	}
	.yeg-filter-apply {
		display: block;
		width: 100%;
		background: #1a1a1a;
		color: #fff;
		border: 0;
		border-radius: 8px;
		padding: 12px 16px;
		font-size: 15px;
		font-weight: 600;
		cursor: pointer;
	}

	/* Lock body scroll while drawer is open. */
	body.yeg-drawer-open { overflow: hidden; }

	.yeg-brand-circles { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
	.yeg-product-grid, .yeg-loader { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
}

/* Hide the noscript-only Apply button on the desktop default. */
.yeg-filter-apply { display: none; }
@media (max-width: 768px) {
	.yeg-filter-apply { display: block; }
}
