/**
 * Frontend styles for Purchase Options Widget block.
 *
 * Table layout with checkboxes, total row, and blue CTA button.
 *
 * @package WooCommerce_Webinar_Purchase
 * @since   1.1.0
 */

/* ===== Widget Container ===== */

.wwp-widget {
	max-width: 540px;
	margin: 32px auto;
	border: 1px solid #e2e4e7;
	border-radius: 12px;
	background: #ffffff;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
	overflow: hidden;
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI",
		Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ===== Header ===== */

.wwp-widget-header {
	text-align: center;
	padding: 24px 20px 16px;
}

.wwp-widget-title {
	display: inline-block;
	padding: 8px 32px;
	border: 2px solid #2d2b6b;
	border-radius: 28px;
	font-size: 15px;
	font-weight: 700;
	color: #2d2b6b;
	letter-spacing: 0.12em;
}

/* ===== Table ===== */

.wwp-widget-table {
	padding: 0 28px;
}

/* ===== Table Head ===== */

.wwp-widget-thead {
	display: grid;
	grid-template-columns: 36px 1fr 100px 80px;
	gap: 8px;
	align-items: center;
	padding: 12px 0;
	border-bottom: 2px solid #2d2b6b;
}

.wwp-widget-thead span {
	font-size: 12px;
	font-weight: 700;
	color: #1d2327;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* ===== Table Rows ===== */

.wwp-widget-row {
	display: grid;
	grid-template-columns: 36px 1fr 100px 80px;
	gap: 8px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px solid #ebebeb;
	transition: background 0.15s ease;
}

.wwp-widget-row:last-child {
	border-bottom: none;
}

.wwp-widget-row:hover {
	background: #fafbfc;
}

.wwp-widget-row.wwp-row-checked {
	background: #f0f4ff;
}

/* ===== Custom Checkbox ===== */

.wwp-widget-cb-wrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.wwp-widget-cb-wrap input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.wwp-widget-checkmark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border: 2px solid #c3c4c7;
	border-radius: 4px;
	background: #fff;
	transition: all 0.2s ease;
}

.wwp-widget-cb-wrap input:checked + .wwp-widget-checkmark {
	background: #3b39c4;
	border-color: #3b39c4;
}

.wwp-widget-cb-wrap input:checked + .wwp-widget-checkmark::after {
	content: "✓";
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}

/* ===== Addon Name ===== */

.wwp-widget-row .wwp-col-addon {
	font-size: 13px;
	font-weight: 500;
	color: #2c3338;
	letter-spacing: 0.02em;
}

/* ===== Price ===== */

.wwp-widget-row .wwp-col-price {
	font-size: 15px;
	font-weight: 700;
	color: #1d2327;
}

/* ===== Quantity Input ===== */

.wwp-widget-qty {
	width: 56px;
	height: 34px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	text-align: center;
	font-size: 14px;
	font-weight: 500;
	color: #1d2327;
	background: #fff;
	transition: border-color 0.2s ease, opacity 0.2s ease;
	-moz-appearance: textfield;
	appearance: textfield;
}

.wwp-widget-qty::-webkit-outer-spin-button,
.wwp-widget-qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.wwp-widget-qty:focus {
	border-color: #3b39c4;
	box-shadow: 0 0 0 2px rgba(59, 57, 196, 0.15);
	outline: none;
}

.wwp-widget-qty::placeholder {
	color: #a7aaad;
}

.wwp-widget-qty:disabled {
	opacity: 0.4;
	background: #f6f7f7;
	cursor: not-allowed;
}

/* ===== Footer ===== */

.wwp-widget-footer {
	padding: 16px 28px 24px;
}

/* ===== Total Row ===== */

.wwp-widget-total-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	margin-bottom: 14px;
	border-top: 2px solid #2d2b6b;
}

.wwp-widget-total-label {
	font-size: 14px;
	font-weight: 700;
	color: #1d2327;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.wwp-widget-total-price {
	font-size: 20px;
	font-weight: 800;
	color: #1d2327;
	transition: transform 0.2s ease;
}

.wwp-widget-total-price.wwp-total-bump {
	transform: scale(1.12);
}

/* ===== Add to Cart Button ===== */

.wwp-widget-cart-btn {
	display: block;
	width: 100%;
	padding: 14px 20px;
	border: none;
	border-radius: 28px;
	background: #3b39c4;
	color: #ffffff;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	transition: all 0.25s ease;
	box-shadow: 0 2px 8px rgba(59, 57, 196, 0.25);
}

.wwp-widget-cart-btn:hover {
	background: #2d2b9e;
	transform: translateY(-1px);
	box-shadow: 0 4px 16px rgba(59, 57, 196, 0.35);
}

.wwp-widget-cart-btn:active {
	transform: translateY(0);
}

.wwp-widget-cart-btn.wwp-widget-loading {
	opacity: 0.7;
	pointer-events: none;
}

/* ===== Notice ===== */

.wwp-widget-notice {
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
}

.wwp-widget-notice--success {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.wwp-widget-notice--error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.wwp-widget-notice a {
	color: inherit;
	text-decoration: underline;
	font-weight: 700;
}

/* ===== Responsive ===== */

@media (max-width: 480px) {

	.wwp-widget {
		margin: 20px 0;
		border-radius: 8px;
	}

	.wwp-widget-table {
		padding: 0 16px;
	}

	.wwp-widget-thead,
	.wwp-widget-row {
		grid-template-columns: 30px 1fr 80px 56px;
		gap: 6px;
	}

	.wwp-widget-row .wwp-col-addon {
		font-size: 11px;
	}

	.wwp-widget-row .wwp-col-price {
		font-size: 13px;
	}

	.wwp-widget-qty {
		width: 48px;
		height: 30px;
		font-size: 12px;
	}

	.wwp-widget-footer {
		padding: 12px 16px 20px;
	}

	.wwp-widget-cart-btn {
		padding: 12px 16px;
		font-size: 13px;
	}
}
