/**
 * Camzon Product Experience Pro - Frontend Stylesheet
 * 
 * Clean, lightweight CSS with no dependencies.
 * Designed to look modern and adapt to any standard WordPress or WooCommerce theme.
 */

:root {
	--czpep-primary: #2563eb;
	--czpep-primary-hover: #1d4ed8;
	--czpep-primary-light: #eff6ff;
	--czpep-border: #e2e8f0;
	--czpep-border-active: #2563eb;
	--czpep-text-dark: #1e293b;
	--czpep-text-light: #64748b;
	--czpep-bg-card: #ffffff;
	--czpep-bg-active: #f8fafc;
	--czpep-sale: #ef4444;
	--czpep-new: #10b981;
	--czpep-lowstock: #f97316;
	--czpep-rating: #f59e0b;
}

.czpep-switcher-container {
	margin: 1.5rem 0;
	padding: 1rem;
	border: 1px solid var(--czpep-border);
	border-radius: 8px;
	background-color: #f8fafc;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* B&H Style Dropdown Wrapper */
.czpep-dropdown-wrapper {
	margin-bottom: 0.75rem;
	width: 100%;
}

.czpep-switcher-label-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
}

.czpep-switcher-label {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #475569;
}

.czpep-family-name {
	font-size: 0.75rem;
	color: #64748b;
	font-weight: 500;
}

/* Custom Dropdown Select Container */
.czpep-dropdown-select {
	position: relative;
	width: 100%;
	font-family: inherit;
}

/* Trigger Button */
.czpep-dropdown-trigger {
	display: flex;
	align-items: center;
	width: 100%;
	padding: 0.5rem 0.75rem;
	background-color: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	cursor: pointer;
	text-align: left;
	transition: all 0.2s ease;
	gap: 0.75rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	box-sizing: border-box;
}

.czpep-dropdown-trigger:hover,
.czpep-dropdown-trigger:focus {
	border-color: #94a3b8;
	outline: none;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.czpep-trigger-thumb-wrapper {
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	background-color: #ffffff;
	border: 1px solid #f1f5f9;
	border-radius: 4px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.czpep-trigger-thumb-wrapper img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.czpep-trigger-text-wrapper {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.czpep-trigger-title {
	font-size: 0.85rem;
	font-weight: 600;
	color: #1e293b;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.czpep-trigger-price {
	font-size: 0.8rem;
	font-weight: 700;
	color: #2563eb;
	margin-top: 0.1rem;
}

.czpep-trigger-chevron {
	flex-shrink: 0;
	color: #64748b;
	transition: transform 0.2s ease;
	display: flex;
	align-items: center;
}

.czpep-dropdown-trigger[aria-expanded="true"] .czpep-trigger-chevron {
	transform: rotate(180deg);
}

/* Dropdown list of options */
.czpep-dropdown-list {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 999;
	background-color: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	max-height: 280px;
	overflow-y: auto;
	display: none;
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.czpep-dropdown-list.czpep-open {
	display: block;
	opacity: 1;
	transform: translateY(0);
}

/* Individual Dropdown Item Option */
.czpep-dropdown-item {
	display: flex;
	align-items: center;
	padding: 0.5rem 0.75rem;
	text-decoration: none !important;
	border-bottom: 1px solid #f1f5f9;
	transition: background-color 0.15s ease;
	gap: 0.75rem;
	cursor: pointer;
	box-sizing: border-box;
}

.czpep-dropdown-item:last-child {
	border-bottom: none;
}

.czpep-dropdown-item:hover {
	background-color: #f8fafc;
}

.czpep-dropdown-item.czpep-active {
	background-color: #f0fdf4; /* Light emerald tint */
	border-left: 3px solid #10b981;
	padding-left: calc(0.75rem - 3px);
}

.czpep-dropdown-item.czpep-active:hover {
	background-color: #ecfdf5;
}

.czpep-item-thumb-wrapper {
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	background-color: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 4px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.czpep-item-thumb-wrapper img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.czpep-item-info {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.czpep-item-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.czpep-item-title {
	font-size: 0.85rem;
	font-weight: 500;
	color: #334155;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.czpep-dropdown-item.czpep-active .czpep-item-title {
	font-weight: 600;
	color: #0f172a;
}

.czpep-item-badge-active {
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	color: #10b981;
	background-color: #d1fae5;
	padding: 0.05rem 0.3rem;
	border-radius: 3px;
	flex-shrink: 0;
}

.czpep-item-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 0.15rem;
}

.czpep-item-price {
	font-size: 0.8rem;
	font-weight: 700;
	color: #1e293b;
}

.czpep-dropdown-item.czpep-active .czpep-item-price {
	color: #10b981;
}

.czpep-item-stock {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.7rem;
	font-weight: 500;
	color: #64748b;
}

.czpep-item-stock .czpep-dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
}

.czpep-item-stock.czpep-in-stock .czpep-dot {
	background-color: #10b981;
}

.czpep-item-stock.czpep-out-of-stock .czpep-dot {
	background-color: #94a3b8;
}

/* Simple Pill-Style CSS */
.czpep-pills-wrapper {
	margin-bottom: 0.75rem;
	width: 100%;
}

.czpep-pills-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.czpep-pill-item {
	display: inline-flex;
	flex-direction: column;
	padding: 0.4rem 0.75rem;
	background-color: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	text-decoration: none !important;
	transition: all 0.15s ease;
	cursor: pointer;
	box-sizing: border-box;
}

.czpep-pill-item:hover {
	border-color: #94a3b8;
	background-color: #f8fafc;
}

.czpep-pill-item.czpep-active {
	border-color: #10b981;
	background-color: #f0fdf4;
	box-shadow: 0 0 0 1px #10b981;
}

.czpep-pill-title {
	font-size: 0.8rem;
	font-weight: 600;
	color: #334155;
}

.czpep-pill-item.czpep-active .czpep-pill-title {
	color: #065f46;
}

.czpep-pill-price {
	font-size: 0.75rem;
	font-weight: 500;
	color: #64748b;
	margin-top: 0.05rem;
}

.czpep-pill-item.czpep-active .czpep-pill-price {
	color: #047857;
	font-weight: 600;
}

/* Compare Toggle Button */
.czpep-comparison-action {
	margin-top: 0.5rem;
	display: flex;
	justify-content: flex-start;
}

.czpep-toggle-comparison-btn {
	background: none;
	border: none;
	color: var(--czpep-primary);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	padding: 0.5rem 0;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	transition: color 0.15s ease;
}

.czpep-toggle-comparison-btn:hover {
	color: var(--czpep-primary-hover);
}

.czpep-toggle-comparison-btn .czpep-icon-table {
	transition: transform 0.2s ease;
}

.czpep-toggle-comparison-btn[aria-expanded="true"] .czpep-icon-table {
	transform: rotate(180deg);
}

/* Comparison Drawer Table */
.czpep-comparison-drawer-content {
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px dashed var(--czpep-border);
}

.czpep-comparison-table-wrapper {
	width: 100%;
	overflow-x: auto;
	border: 1px solid var(--czpep-border);
	border-radius: 8px;
	background-color: #ffffff;
	box-shadow: 0 1px 3px rgba(0,0,0,0.01);
}

.czpep-comparison-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
	font-size: 0.85rem;
}

.czpep-comparison-table th,
.czpep-comparison-table td {
	padding: 1rem;
	border-bottom: 1px solid var(--czpep-border);
	vertical-align: top;
	min-width: 150px;
}

.czpep-comparison-table th {
	background-color: #f8fafc;
	font-weight: 600;
	color: var(--czpep-text-dark);
}

.czpep-comparison-table .czpep-row-header-col {
	min-width: 120px;
	background-color: #f1f5f9;
	font-weight: 700;
	position: sticky;
	left: 0;
	z-index: 5;
}

.czpep-comparison-table td.czpep-active,
.czpep-comparison-table th.czpep-active {
	background-color: var(--czpep-bg-active);
}

.czpep-comp-thumb {
	width: 60px;
	height: 60px;
	margin-bottom: 0.5rem;
	background-color: #ffffff;
	border: 1px solid #f1f5f9;
	border-radius: 4px;
	overflow: hidden;
}

.czpep-comp-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.czpep-comp-title {
	font-weight: 600;
	color: var(--czpep-text-dark);
	margin-bottom: 0.4rem;
	line-height: 1.3;
}

.czpep-comp-active-badge {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--czpep-primary);
	background-color: var(--czpep-primary-light);
	padding: 0.15rem 0.4rem;
	border-radius: 4px;
	text-transform: uppercase;
}

.czpep-comp-link {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 600;
	color: #ffffff;
	background-color: var(--czpep-primary);
	padding: 0.25rem 0.6rem;
	border-radius: 4px;
	text-decoration: none !important;
	transition: background-color 0.15s ease;
}

.czpep-comp-link:hover {
	background-color: var(--czpep-primary-hover);
}

.czpep-comp-price {
	font-weight: 700;
	color: var(--czpep-text-dark);
}

.czpep-comp-sku {
	font-family: monospace;
	font-size: 0.8rem;
	background-color: #f1f5f9;
	padding: 0.15rem 0.3rem;
	border-radius: 3px;
}

.czpep-comp-stock-badge {
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.2rem 0.5rem;
	border-radius: 4px;
}

.czpep-comp-stock-badge.czpep-in-stock {
	color: var(--czpep-new);
	background-color: #ecfdf5;
}

.czpep-comp-stock-badge.czpep-out-of-stock {
	color: #64748b;
	background-color: #f1f5f9;
}

.czpep-comp-rating {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	color: var(--czpep-rating);
}

.czpep-comp-rating .star-rating {
	font-size: 0.85em;
	width: 5.4em;
	font-family: star;
	position: relative;
	overflow: hidden;
	height: 1em;
	line-height: 1;
}

.czpep-rating-count {
	font-size: 0.75rem;
	color: var(--czpep-text-light);
}

.czpep-no-rating {
	color: var(--czpep-text-light);
	font-style: italic;
}

/* Mobile responsive horizontal scrolling cards */
@media (max-width: 640px) {
	.czpep-cards-grid {
		display: flex !important;
		overflow-x: auto !important;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		gap: 0.75rem;
		padding-bottom: 0.5rem;
		scrollbar-width: thin;
	}

	.czpep-cards-grid::-webkit-scrollbar {
		height: 4px;
	}

	.czpep-cards-grid::-webkit-scrollbar-thumb {
		background-color: #cbd5e1;
		border-radius: 4px;
	}

	.czpep-card-item {
		scroll-snap-align: start;
		flex-shrink: 0;
	}

	.czpep-cards-grid.czpep-style-rich .czpep-card-item {
		width: 170px;
	}

	.czpep-cards-grid.czpep-style-simple .czpep-card-item {
		width: 140px;
	}

	.czpep-comparison-table th,
	.czpep-comparison-table td {
		padding: 0.75rem;
		min-width: 120px;
	}
}

/* AJAX loading overlay */
.czpep-loading-active {
	position: relative;
}

.czpep-loading-active::after {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background-color: rgba(255, 255, 255, 0.6);
	z-index: 100;
	cursor: wait;
	border-radius: 12px;
	display: flex;
	justify-content: center;
	align-items: center;
}
