/**
 * Product Selector Pro Block Styles
 */

.seecommerce-product-selector-pro {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 24px;
	margin-bottom: 24px;
}

.product-selector-header h3 {
	margin: 0 0 20px 0;
	font-size: 20px;
	font-weight: 600;
	color: #333;
}

.products-grid {
	display: grid;
	gap: 16px;
	margin-bottom: 16px;
}

.products-grid.columns-1 {
	grid-template-columns: 1fr;
}

.products-grid.columns-2 {
	grid-template-columns: repeat(2, 1fr);
}

.product-item {
	border: 2px solid #e0e0e0;
	border-radius: 6px;
	padding: 10px 14px;
	transition: all 0.2s;
	cursor: pointer;
	background: #fff;
	overflow: hidden;
}

.product-item:hover {
	border-color: #0073aa;
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.product-item.selected {
	border-color: #0073aa;
	background: #f0f8ff;
}

.product-selector {
	display: flex;
	flex-direction: column;
	gap: 8px;
	cursor: pointer;
	width: 100%;
}

.product-selector input[type='checkbox'],
.product-selector input[type='radio'] {
	width: 18px;
	height: 18px;
	cursor: pointer;
	flex-shrink: 0;
}

/* Row 1: Checkbox + Product Name + Quantity Controls */
.product-row-1 {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	flex-wrap: nowrap;
}

.product-left {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
	min-width: 0;
	overflow: hidden;
}

.product-right {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
	white-space: nowrap;
}

/* Row 2: Price + Total */
.product-row-2 {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-left: 28px;
	gap: 8px;
}

.product-total-compact {
	display: flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}

.product-name {
	font-size: 16px;
	font-weight: 600;
	color: #333;
}

.product-price {
	font-size: 18px;
	font-weight: 700;
	color: #0073aa;
}

.product-badge {
	display: inline-block;
	padding: 4px 8px;
	background: #f0f0f0;
	border-radius: 4px;
	font-size: 12px;
	color: #666;
	font-weight: 500;
}

.product-variations {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #e0e0e0;
}

.variation-group {
	margin-bottom: 12px;
}

.variation-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #555;
	margin-bottom: 6px;
}

.variation-select {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	background: #fff;
	cursor: pointer;
}

.variation-select:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 1px #0073aa;
}

.product-quantity {
	margin-top: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.quantity-label {
	font-size: 12px;
	font-weight: 500;
	color: #666;
	margin: 0;
}

/* Quantity Controls */
.product-quantity-controls {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #e0e0e0;
}

/* Quantity input container */
.product-selector .quantity-input {
	display: flex !important;
	align-items: center !important;
	gap: 3px !important;
	width: auto !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	text-align: left !important;
	font-size: inherit !important;
	background: transparent !important;
}

.quantity-btn {
	width: 22px;
	height: 22px;
	border: 1px solid #999;
	background: #f8f8f8;
	border-radius: 3px;
	font-size: 16px;
	font-weight: 700;
	color: #333;
	cursor: pointer;
	transition: all 0.2s;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 1;
	min-width: 22px;
	flex-shrink: 0;
}

.quantity-btn:hover {
	background: #0073aa;
	border-color: #0073aa;
	color: #fff;
}

.quantity-btn:active {
	background: #005a87;
	transform: scale(0.95);
}

.quantity-value {
	width: 35px !important;
	height: 22px !important;
	text-align: center !important;
	border: 1px solid #ccc !important;
	border-radius: 3px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	color: #333 !important;
	background: #fff !important;
	padding: 0 4px !important;
	box-sizing: border-box !important;
	line-height: 20px !important;
}

/* Remove spinner arrows */
.quantity-value::-webkit-outer-spin-button,
.quantity-value::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.quantity-value[type=number] {
	-moz-appearance: textfield;
}

.product-pricing {
	display: flex;
	align-items: center;
	gap: 8px;
}

.product-unit-price {
	font-size: 16px;
	font-weight: 700;
	color: #0073aa;
}

.product-total {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #e0e0e0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.total-label {
	font-size: 13px;
	color: #666;
	font-weight: 500;
}

.total-price {
	font-size: 18px;
	font-weight: 700;
	color: #0073aa;
}

.product-selector-footer {
	padding-top: 16px;
	border-top: 1px solid #e0e0e0;
}

.help-text {
	margin: 0;
	font-size: 14px;
	color: #666;
	font-style: italic;
}

.loading-state,
.no-products {
	text-align: center;
	padding: 40px 20px;
	color: #666;
}

/* Compact layout */
.layout-compact .product-item {
	padding: 10px 14px;
}

.layout-compact .product-name {
	font-size: 15px;
}

.layout-compact .product-unit-price {
	font-size: 15px;
}

/* Spacious layout */
.layout-spacious .product-item {
	padding: 16px 20px;
}

.layout-spacious .product-name {
	font-size: 17px;
}

.layout-spacious .product-unit-price {
	font-size: 18px;
}

/* Mobile responsive */
@media (max-width: 768px) {
	.seecommerce-product-selector-pro {
		padding: 16px;
	}

	.products-grid.columns-2 {
		grid-template-columns: 1fr;
	}

	.product-selector-header h3 {
		font-size: 18px;
	}

	.product-item {
		padding: 8px 10px;
	}

	.product-name {
		font-size: 13px;
	}

	.product-unit-price {
		font-size: 14px;
	}

	.product-row-1 {
		flex-wrap: wrap;
		gap: 6px;
	}

	.product-left {
		min-width: 0;
		flex: 1 1 100%;
	}

	.product-right {
		gap: 3px;
	}

	.product-row-2 {
		padding-left: 26px;
		flex-wrap: wrap;
		gap: 6px;
	}

	.quantity-label {
		font-size: 11px;
	}

	.quantity-btn {
		width: 20px;
		height: 20px;
		font-size: 14px;
	}

	.quantity-value {
		width: 32px !important;
		height: 20px !important;
		font-size: 12px !important;
		line-height: 18px !important;
	}

	.total-label {
		font-size: 12px;
	}

	.total-price {
		font-size: 15px;
	}
}
