/**
 * Frontend styles for Webinar Purchase Options card.
 *
 * Premium card design with responsive layout, animations,
 * badges, sale pricing, quantity controls, and mobile-first approach.
 *
 * @package WooCommerce_Webinar_Purchase
 * @since   1.0.0
 */

/* ===== Card Container ===== */

.wwp-purchase-card {
	max-width: 560px;
	margin: 32px 0;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	background: #ffffff;
	box-shadow:
		0 1px 3px rgba(0, 0, 0, 0.06),
		0 4px 16px rgba(0, 0, 0, 0.04);
	overflow: hidden;
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI",
		Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

.wwp-card-header {
	padding: 20px 24px 16px;
	border-bottom: 1px solid #f1f5f9;
}

.wwp-card-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #1e293b;
	letter-spacing: -0.01em;
}

/* ===== Options List ===== */

.wwp-options-list {
	padding: 0;
}

/* ===== Single Option ===== */

.wwp-option {
	position: relative;
	padding: 18px 24px;
	border-bottom: 1px solid #f1f5f9;
	transition: background-color 0.2s ease;
	cursor: pointer;
}

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

.wwp-option:hover {
	background-color: #f8fafc;
}

.wwp-option--selected {
	background-color: #f0fdf4;
	border-left: 3px solid var(--wwp-accent, #22c55e);
}

.wwp-option--selected:hover {
	background-color: #ecfdf5;
}

/* ===== Badges ===== */

.wwp-badge {
	position: absolute;
	top: 12px;
	right: 16px;
	padding: 3px 10px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #ffffff;
	background: linear-gradient(135deg, #f59e0b, #f97316);
	border-radius: 12px;
	line-height: 1.4;
}

.wwp-sale-badge {
	position: absolute;
	top: 12px;
	right: 16px;
	padding: 3px 10px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #ffffff;
	background: linear-gradient(135deg, #ef4444, #dc2626);
	border-radius: 12px;
	line-height: 1.4;
}

.wwp-badge + .wwp-sale-badge {
	right: auto;
	left: 16px;
}

/* ===== Option Top Row ===== */

.wwp-option-top {
	display: flex;
	align-items: center;
	gap: 14px;
}

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

.wwp-checkbox-wrap {
	position: relative;
	display: flex;
	align-items: center;
	flex-shrink: 0;
	cursor: pointer;
}

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

.wwp-checkmark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: 2px solid #cbd5e1;
	border-radius: 6px;
	background: #ffffff;
	transition: all 0.2s ease;
}

.wwp-checkbox-wrap input:checked + .wwp-checkmark {
	background: var(--wwp-accent, #22c55e);
	border-color: var(--wwp-accent, #22c55e);
}

.wwp-checkbox-wrap input:checked + .wwp-checkmark::after {
	content: "✓";
	color: #ffffff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
}

/* ===== Option Info ===== */

.wwp-option-info {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 auto;
	min-width: 0;
}

.wwp-option-icon {
	font-size: 20px;
	flex-shrink: 0;
}

.wwp-option-name {
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ===== Pricing ===== */

.wwp-option-pricing {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.wwp-price-regular {
	font-size: 13px;
	color: #94a3b8;
	text-decoration: line-through;
}

.wwp-price-active {
	font-size: 16px;
	font-weight: 700;
	color: #1e293b;
}

/* ===== Option Description ===== */

.wwp-option-desc {
	margin: 6px 0 0 36px;
	font-size: 13px;
	color: #64748b;
	line-height: 1.5;
}

/* ===== Inventory Warning ===== */

.wwp-inventory-warning {
	margin: 6px 0 0 36px;
	font-size: 12px;
	font-weight: 600;
	color: #ef4444;
	animation: wwp-pulse 2s ease-in-out infinite;
}

@keyframes wwp-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}

/* ===== Quantity Controls ===== */

.wwp-qty-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 10px;
	padding-left: 36px;
}

.wwp-qty-label {
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
}

.wwp-qty-controls {
	display: flex;
	align-items: center;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
	background: #ffffff;
}

.wwp-qty-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: none;
	background: #f8fafc;
	color: #475569;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
	line-height: 1;
	padding: 0;
}

.wwp-qty-btn:hover {
	background: #e2e8f0;
	color: #1e293b;
}

.wwp-qty-btn:active {
	transform: scale(0.92);
}

.wwp-qty-input {
	width: 44px;
	height: 34px;
	border: none;
	border-left: 1px solid #e2e8f0;
	border-right: 1px solid #e2e8f0;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
	background: #ffffff;
	-moz-appearance: textfield;
	appearance: textfield;
}

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

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

.wwp-card-footer {
	padding: 20px 24px;
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
}

.wwp-total-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

.wwp-total-label {
	font-size: 15px;
	font-weight: 600;
	color: #475569;
}

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

.wwp-total-price.wwp-total-updated {
	transform: scale(1.1);
}

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

.wwp-add-to-cart-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px 24px;
	border: none;
	border-radius: 12px;
	background: linear-gradient(135deg, #22c55e, #16a34a);
	color: #ffffff;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: all 0.25s ease;
	box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.wwp-add-to-cart-btn:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
}

.wwp-add-to-cart-btn:active:not(:disabled) {
	transform: translateY(0);
}

.wwp-add-to-cart-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.wwp-add-to-cart-btn.wwp-btn-loading {
	pointer-events: none;
	opacity: 0.8;
}

.wwp-btn-spinner {
	animation: wwp-spin 1s linear infinite;
}

@keyframes wwp-spin {
	to { transform: rotate(360deg); }
}

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

.wwp-notice {
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	animation: wwp-slide-in 0.3s ease;
}

.wwp-notice--success {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

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

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

@keyframes wwp-slide-in {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

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

@media (max-width: 600px) {

	.wwp-purchase-card {
		margin: 20px 0;
		border-radius: 12px;
	}

	.wwp-card-header {
		padding: 16px 18px 12px;
	}

	.wwp-option {
		padding: 14px 18px;
	}

	.wwp-option-top {
		flex-wrap: wrap;
		gap: 10px;
	}

	.wwp-option-pricing {
		width: 100%;
		padding-left: 36px;
		margin-top: 4px;
	}

	.wwp-option-desc,
	.wwp-qty-wrap,
	.wwp-inventory-warning {
		padding-left: 36px;
		margin-left: 0;
	}

	.wwp-card-footer {
		padding: 16px 18px;
	}

	.wwp-total-price {
		font-size: 20px;
	}

	.wwp-add-to-cart-btn {
		padding: 12px 20px;
		font-size: 14px;
		border-radius: 10px;
	}
}
