/**
 * Elegance Custom Forms — Shop Stylesheet
 * Shared design tokens + the archive/category grid, sidebar filters, and the
 * product-card component (reused by the archive grid, taxonomy grid, and the
 * single-product "related products" block). This is the base dependency for
 * frontend-product.css and form-frontend.css.
 */

/* ==========================================================================
   1. Design tokens (single source of truth for the whole plugin)
   ========================================================================== */
:root {
	--elegance-primary: #b8860b;
	--elegance-primary-rgb: 184, 134, 11;
	--elegance-primary-hover: #996e00;
	--elegance-dark: #1e1e24;
	--elegance-light: #f8fafc;
	--elegance-border: #e2e8f0;
	--elegance-border-focus: #b8860b;
	--elegance-text: #334155;
	--elegance-text-muted: #64748b;
	--elegance-radius: 8px;
	--elegance-shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
	--elegance-shadow-md: 0 4px 12px rgba(0,0,0,0.05);
	--elegance-shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.05), 0 4px 12px -2px rgba(0,0,0,0.03);
	--elegance-danger: #ef4444;
	--elegance-success: #22c55e;
	--elegance-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--elegance-font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
	.elegance-archive-outer *,
	.elegance-product-page-outer * {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}

/* ==========================================================================
   2. Breadcrumbs (shared: archive header + single-product summary card)
   ========================================================================== */
.elegance-breadcrumbs {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 13px;
	color: var(--elegance-text-muted);
	margin-bottom: 20px;
	font-weight: 500;
}
.elegance-breadcrumbs a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}
.elegance-breadcrumbs a:hover,
.elegance-breadcrumbs a:focus-visible {
	color: var(--elegance-primary);
}
.elegance-breadcrumbs .separator {
	color: #cbd5e1;
}
.elegance-breadcrumbs .current {
	color: var(--elegance-primary);
	font-weight: 600;
}

/* ==========================================================================
   3. Archive / taxonomy shell
   ========================================================================== */
.elegance-archive-outer {
	padding: 40px 0;
	background-color: var(--elegance-light);
	font-family: var(--elegance-font-family);
	color: var(--elegance-text);
}
.elegance-archive-outer,
.elegance-archive-outer * {
	box-sizing: border-box;
}
.elegance-archive-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

.elegance-archive-header {
	margin-bottom: 30px;
	background: #ffffff;
	border: 1px solid var(--elegance-border);
	border-radius: var(--elegance-radius);
	padding: 25px;
	box-shadow: var(--elegance-shadow-sm);
}
.elegance-archive-h1 {
	font-size: 42px !important;
	font-weight: 700 !important;
	color: var(--elegance-dark) !important;
	margin: 0 0 8px 0 !important;
	letter-spacing: 0.5px !important;
	text-transform: none !important;
}
.elegance-archive-desc {
	color: var(--elegance-text-muted) !important;
	font-size: 15px !important;
	line-height: 1.6 !important;
	margin: 0 !important;
}

/* ==========================================================================
   4. Layout grid + sidebar filters
   ========================================================================== */
.elegance-archive-layout {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 30px;
	align-items: start;
}

.elegance-archive-sidebar {
	background: #ffffff;
	border: 1px solid var(--elegance-border);
	border-radius: var(--elegance-radius);
	padding: 24px;
	box-shadow: var(--elegance-shadow-sm);
}

.elegance-sidebar-widget {
	margin-bottom: 30px;
	padding-bottom: 25px;
	border-bottom: 1px solid var(--elegance-border);
}
.elegance-sidebar-widget:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

/* !important below is deliberate: the active theme/Elementor global heading
   styles otherwise override font-size/weight on these elements — confirmed
   on the live site, not stylistic preference. */
.elegance-widget-title {
	font-family: 'Montserrat', sans-serif !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	color: var(--elegance-dark) !important;
	margin: 0 0 15px 0 !important;
	border-left: 3px solid var(--elegance-primary) !important;
	padding-left: 8px !important;
	text-transform: uppercase !important;
	letter-spacing: 0.5px !important;
}

/* Search */
.elegance-search-form {
	display: flex;
	gap: 6px;
}
.elegance-search-input {
	flex: 1;
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 13px;
	outline: none;
	transition: border-color 0.2s ease;
}
.elegance-search-input:focus {
	border-color: var(--elegance-primary);
}
.elegance-search-btn {
	background: var(--elegance-dark);
	color: #ffffff;
	border: none;
	padding: 8px 12px;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}
.elegance-search-btn:hover,
.elegance-search-btn:focus-visible {
	background: var(--elegance-primary);
	color: var(--elegance-dark);
}

/* Category tree */
.elegance-category-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.elegance-category-list li {
	margin-bottom: 6px;
}
.elegance-category-list li a {
	display: flex !important;
	justify-content: space-between !important;
	align-items: center !important;
	color: var(--elegance-text) !important;
	text-decoration: none !important;
	font-size: 13.5px !important;
	padding: 8px 10px !important;
	border-radius: 6px !important;
	transition: all 0.2s ease !important;
	font-family: 'Montserrat', sans-serif !important;
	text-transform: capitalize !important;
}
.elegance-category-list li a:hover,
.elegance-category-list li a:focus-visible {
	background: #f1f5f9;
	color: var(--elegance-primary);
	padding-left: 12px;
}
.elegance-category-list li.current-cat > a {
	background: rgba(var(--elegance-primary-rgb), 0.08);
	color: var(--elegance-primary);
	font-weight: 700;
	border-left: 3px solid var(--elegance-primary);
	border-radius: 0 6px 6px 0;
}
.elegance-category-list .children {
	list-style: none;
	padding-left: 15px;
	margin-top: 5px;
}
.elegance-cat-count {
	background: #f1f5f9;
	color: var(--elegance-text-muted);
	font-size: 11px;
	font-weight: 600;
	padding: 2px 6px;
	border-radius: 10px;
}

/* Price filter */
.elegance-filter-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.elegance-filter-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	color: var(--elegance-text);
	cursor: pointer;
	user-select: none;
}
.elegance-filter-input {
	cursor: pointer;
	accent-color: var(--elegance-primary);
	margin: 0;
}

/* ==========================================================================
   5. Toolbar (results count + sort)
   ========================================================================== */
.elegance-toolbar-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	background: #ffffff;
	border: 1px solid var(--elegance-border);
	border-radius: var(--elegance-radius);
	padding: 12px 20px;
	box-shadow: var(--elegance-shadow-sm);
	flex-wrap: wrap;
	gap: 15px;
}
.elegance-results-count {
	font-size: 14px;
	color: var(--elegance-text-muted);
	margin: 0;
	font-weight: 500;
}
.elegance-sort-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
}
.elegance-sort-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--elegance-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.elegance-sort-select {
	padding: 6px 12px;
	border-radius: 6px;
	border: 1px solid #cbd5e1;
	font-size: 13.5px;
	outline: none;
	cursor: pointer;
	transition: border-color 0.2s ease;
	background-color: #fff;
}
.elegance-sort-select:focus {
	border-color: var(--elegance-primary);
}

/* ==========================================================================
   6. Product grid + product card (shared component)
   ========================================================================== */
.elegance-products-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}

.elegance-product-card {
	background: #ffffff;
	border: 1px solid var(--elegance-border);
	border-radius: var(--elegance-radius);
	overflow: hidden;
	box-shadow: var(--elegance-shadow-sm);
	transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
	position: relative;
	text-decoration: none;
	color: inherit;
}
.elegance-product-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--elegance-shadow-lg);
}
.elegance-product-card:focus-visible {
	outline: 3px solid var(--elegance-primary);
	outline-offset: 2px;
}

.elegance-card-media {
	position: relative;
	padding-top: 75%; /* 4:3 ratio */
	background-color: #f1f5f9;
	overflow: hidden;
	border-bottom: 1px solid var(--elegance-border);
}
.elegance-card-img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}
.elegance-product-card:hover .elegance-card-img {
	transform: scale(1.05);
}
.elegance-card-placeholder-img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 36px;
	background: #f1f5f9;
	color: #94a3b8;
}

.elegance-card-badge-row {
	position: absolute;
	top: 10px;
	left: 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	/* No z-index here on purpose: this only needs to paint above the card's
	   own image (guaranteed by DOM order since it comes after it), and an
	   explicit z-index would create a stacking context that can end up
	   ranking above site-wide chrome like the mega menu. */
}
.elegance-card-badge {
	background: rgba(30, 30, 36, 0.85);
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	padding: 3px 6px;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.elegance-card-badge.gold-badge {
	background: var(--elegance-primary);
	color: #ffffff;
}

.elegance-card-content {
	padding: 18px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}
.elegance-card-meta-row {
	font-size: 11px;
	color: var(--elegance-text-muted);
	margin-bottom: 6px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	min-height: 14px;
}
.elegance-card-title {
	font-size: 18px !important;
	font-weight: 700 !important;
	color: var(--elegance-dark) !important;
	margin: 0 0 10px 0 !important;
	line-height: 1.3 !important;
	flex-grow: 1;
	text-transform: none !important;
	letter-spacing: normal !important;
}

.elegance-card-price-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-top: 1px solid #f1f5f9;
	padding-top: 12px;
	margin-top: auto;
}
.elegance-card-price-lbl {
	font-size: 11px;
	color: #94a3b8;
	text-transform: uppercase;
	font-weight: 600;
}
.elegance-card-price-val {
	font-size: 18px;
	font-weight: 800;
	color: var(--elegance-primary);
}
.elegance-card-btn-row {
	margin-top: 12px;
}
.elegance-card-order-btn {
	display: block;
	text-align: center;
	background: var(--elegance-dark);
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	padding: 9px;
	border-radius: 6px;
	transition: all 0.2s ease;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.elegance-product-card:hover .elegance-card-order-btn {
	background: var(--elegance-primary);
	color: #ffffff;
}

/* Related products (single-product page, reuses the grid + card above) */
.elegance-related-products-section {
	margin-top: 48px;
	border-top: 1px solid var(--elegance-border);
	padding-top: 40px;
}
.elegance-related-heading {
	font-size: 26px !important;
	font-weight: 700 !important;
	color: var(--elegance-dark) !important;
	margin: 0 0 24px 0 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.5px !important;
}

/* ==========================================================================
   7. Pagination / empty state
   ========================================================================== */
.elegance-pagination {
	margin-top: 35px;
	display: flex;
	justify-content: center;
	gap: 6px;
}
.elegance-pagination .page-numbers {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid var(--elegance-border);
	background: #ffffff;
	color: var(--elegance-text);
	text-decoration: none;
	border-radius: 6px;
	font-weight: 600;
	font-size: 13px;
	transition: all 0.2s ease;
}
.elegance-pagination .page-numbers:hover,
.elegance-pagination .page-numbers.current {
	background: var(--elegance-primary);
	border-color: var(--elegance-primary);
	color: #ffffff;
}

.elegance-no-results {
	text-align: center;
	padding: 50px 20px;
	background: #ffffff;
	border: 1px dashed #cbd5e1;
	border-radius: var(--elegance-radius);
	color: var(--elegance-text-muted);
}
.elegance-no-results-icon {
	font-size: 36px;
	margin-bottom: 12px;
	display: block;
}

/* ==========================================================================
   8. Mobile filter toggle + off-canvas sidebar drawer
   (single implementation — replaces the two conflicting mobile treatments
   that previously lived in two different files at two different breakpoints)
   ========================================================================== */
.elegance-filter-toggle-btn {
	display: none;
	background: var(--elegance-dark);
	color: #ffffff;
	border: 1px solid var(--elegance-border);
	padding: 12px 20px;
	border-radius: var(--elegance-radius);
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	align-items: center;
	gap: 8px;
	margin-bottom: 20px;
	width: fit-content;
	height: 44px;
}

.elegance-close-sidebar-btn {
	display: none;
	width: 100%;
	text-align: center;
	margin-bottom: 20px;
	font-weight: 700;
	height: 44px;
	background: var(--elegance-light);
	border: 1px solid var(--elegance-border);
	border-radius: 6px;
	cursor: pointer;
}

@media (max-width: 900px) {
	.elegance-filter-toggle-btn {
		display: flex;
	}
	.elegance-archive-layout {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	.elegance-archive-sidebar {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		width: min(300px, 85vw);
		height: 100%;
		background: #ffffff;
		z-index: 999999;
		overflow-y: auto;
		box-shadow: var(--elegance-shadow-lg);
		transition: transform 0.3s ease;
		transform: translateX(-100%);
		border-radius: 0;
		border: none;
		padding: 25px;
	}
	.elegance-archive-sidebar.active {
		display: block;
		transform: translateX(0);
	}
	.elegance-archive-sidebar.active .elegance-close-sidebar-btn {
		display: block;
	}
}

@media (max-width: 1024px) {
	.elegance-products-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 600px) {
	.elegance-products-grid {
		grid-template-columns: 1fr;
	}
	.elegance-archive-h1 {
		font-size: 26px !important;
	}
	.elegance-toolbar-row {
		flex-direction: column;
		align-items: stretch;
	}
	.elegance-sort-select {
		width: 100%;
	}
}
