/**
 * Frontend styles for WC Conditional Product Bundler.
 *
 * These are base/fallback values. The CPB Settings page generates inline CSS
 * (via wp_add_inline_style) that overrides these defaults with the values
 * saved by the shop admin.
 *
 * @package WC_Conditional_Product
 * @since   2.0.0
 */

/* ── Outer wrapper ────────────────────────────────────────────────────────── */

.wc-conditional-products {
	margin-bottom: 20px;
}

/* ── Section heading (hidden by default; shown via settings) ──────────────── */

.wc-conditional-products-title {
	display: none;
	font-size: 1em;
	font-weight: 600;
	margin-bottom: 12px;
}

/* ── Grid container ───────────────────────────────────────────────────────── */

.wc-conditional-products-list {
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 5px;
}

/* ── Individual product card ──────────────────────────────────────────────── */

.wc-conditional-product-item {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px;
	background-color: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	transition: box-shadow 0.15s ease;
}

.wc-conditional-product-item:hover {
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.08 );
}

/* ── Product info ─────────────────────────────────────────────────────────── */

.wc-conditional-product-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.wc-conditional-product-name {
	font-size: 13px;
	color: #1d2327;
	font-weight: 500;
	text-align: center;
	line-height: 1.3;
}

.wc-conditional-product-price {
	font-size: 13px;
	color: #2271b1;
	text-align: center;
}

/* ── Quantity controls ────────────────────────────────────────────────────── */

.wc-conditional-product-quantity {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

.wc-conditional-qty-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	padding: 0;
	background-color: #ffffff;
	color: #2271b1;
	border: 1px solid #2271b1;
	border-radius: 50%;
	font-size: 18px;
	font-weight: bold;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wc-conditional-qty-btn:hover,
.wc-conditional-qty-btn:focus {
	background-color: #2271b1;
	color: #ffffff;
	outline: none;
}

.wc-conditional-qty-input {
	width: 50px;
	height: 28px;
	text-align: center;
	border: 1px solid #8c8f94;
	border-radius: 3px;
	padding: 2px 4px;
	font-size: 14px;
	-moz-appearance: textfield;
}

.wc-conditional-qty-input::-webkit-inner-spin-button,
.wc-conditional-qty-input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ── Responsive – tablet ──────────────────────────────────────────────────── */

@media ( max-width: 900px ) {
	.wc-conditional-products-list {
		grid-template-columns: repeat( 3, 1fr );
	}
}

@media ( max-width: 640px ) {
	.wc-conditional-products-list {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 400px ) {
	.wc-conditional-products-list {
		grid-template-columns: 1fr;
	}

	.wc-conditional-product-item {
		padding: 12px;
	}
}
