/**
 * WooCommerce Variation Display Customizer Frontend Stylesheet
 *
 * Clean, modern CSS leveraging flexible custom variables for brand coloring.
 */

:root {
	/* Standard color Fallbacks (if inline inject is missing) */
	--wc-vdc-cta-bg: #2563eb;
	--wc-vdc-cta-text: #ffffff;
	--wc-vdc-highlight: #3b82f6;
	--wc-vdc-checkmark: #10b981;
	--wc-vdc-popular-bg: #f59e0b;
	--wc-vdc-popular-text: #ffffff;
	
	/* Layout UI Specific Constants */
	--wc-vdc-bg-card: #ffffff;
	--wc-vdc-border: #e2e8f0;
	--wc-vdc-text-main: #1e293b;
	--wc-vdc-text-muted: #64748b;
	--wc-vdc-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
	--wc-vdc-shadow-active: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Hide native variations select table when custom layouts are active */
.wc-vdc-active-layout form.variations_form table.variations {
	display: none !important;
}

/* Global Container Styles */
.wc-vdc-container {
	margin: 24px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wc-vdc-section-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--wc-vdc-text-main);
	margin-bottom: 16px;
	border-bottom: 1px solid var(--wc-vdc-border);
	padding-bottom: 8px;
}

/* Custom Badges */
.wc-vdc-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	font-size: 0.7rem;
	font-weight: 600;
	border-radius: 9999px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-left: 8px;
}
.wc-vdc-badge-out {
	background-color: #fef2f2;
	color: #991b1b;
	border: 1px solid #fca5a5;
}
.wc-vdc-badge-popular {
	background-color: var(--wc-vdc-popular-bg);
	color: var(--wc-vdc-popular-text);
}

/* LAYOUT 1: RADIO ROWS */
.wc-vdc-radio-rows {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.wc-vdc-radio-row {
	background: var(--wc-vdc-bg-card);
	border: 1px solid var(--wc-vdc-border);
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.25s ease;
	cursor: pointer;
}
.wc-vdc-radio-row:hover:not(.wc-vdc-out-of-stock) {
	border-color: var(--wc-vdc-text-muted);
	transform: translateY(-1px);
	box-shadow: var(--wc-vdc-shadow);
}
.wc-vdc-radio-row.wc-vdc-selected {
	border-color: var(--wc-vdc-highlight);
	border-width: 2px;
	box-shadow: var(--wc-vdc-shadow-active);
}

/* Row Inner Layout */
.wc-vdc-row-main {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px;
	gap: 16px;
}
.wc-vdc-row-left {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
}

/* Custom Radio Circle */
.wc-vdc-row-left input[type="radio"] {
	position: absolute;
	opacity: 0;
	cursor: pointer;
}
.wc-vdc-radio-custom {
	width: 20px;
	height: 20px;
	border: 2px solid #cbd5e1;
	border-radius: 50%;
	display: inline-block;
	position: relative;
	transition: all 0.2s ease;
	flex-shrink: 0;
}
.wc-vdc-radio-row.wc-vdc-selected .wc-vdc-radio-custom {
	border-color: var(--wc-vdc-highlight);
}
.wc-vdc-radio-row.wc-vdc-selected .wc-vdc-radio-custom::after {
	content: "";
	position: absolute;
	width: 10px;
	height: 10px;
	top: 3px;
	left: 3px;
	background: var(--wc-vdc-highlight);
	border-radius: 50%;
}

.wc-vdc-row-title {
	display: flex;
	align-items: center;
	font-weight: 500;
	color: var(--wc-vdc-text-main);
	cursor: pointer;
	gap: 8px;
}

.wc-vdc-row-price {
	font-weight: 600;
	font-size: 1.1rem;
	color: var(--wc-vdc-text-main);
}
.wc-vdc-row-price del {
	color: var(--wc-vdc-text-muted);
	font-size: 0.9rem;
	font-weight: 400;
	margin-right: 4px;
}
.wc-vdc-row-price ins {
	text-decoration: none;
	color: var(--wc-vdc-highlight);
}

.wc-vdc-select-btn {
	padding: 8px 16px !important;
	font-size: 0.875rem !important;
	border-radius: 6px !important;
	font-weight: 500 !important;
	background-color: #f1f5f9 !important;
	color: var(--wc-vdc-text-main) !important;
	border: 1px solid var(--wc-vdc-border) !important;
	cursor: pointer;
	transition: all 0.2s ease;
}
.wc-vdc-radio-row.wc-vdc-selected .wc-vdc-select-btn {
	background-color: var(--wc-vdc-cta-bg) !important;
	color: var(--wc-vdc-cta-text) !important;
	border-color: var(--wc-vdc-cta-bg) !important;
}

/* Collapsible Row details */
.wc-vdc-row-details {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
	background-color: #f8fafc;
	border-top: 1px solid var(--wc-vdc-border);
}
.wc-vdc-radio-row.wc-vdc-selected .wc-vdc-row-details {
	max-height: 1000px;
	transition: max-height 0.4s ease-in-out;
}
.wc-vdc-row-details-content {
	padding: 16px;
}
.wc-vdc-row-description {
	font-size: 0.875rem;
	color: var(--wc-vdc-text-muted);
	line-height: 1.5;
	margin-bottom: 12px;
}
.wc-vdc-row-features {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}
.wc-vdc-row-features li {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.825rem;
	color: var(--wc-vdc-text-main);
	width: calc(50% - 6px);
}
.wc-vdc-check-icon {
	color: var(--wc-vdc-checkmark);
	flex-shrink: 0;
}

/* Out of Stock Styling */
.wc-vdc-out-of-stock {
	opacity: 0.6;
	cursor: not-allowed !important;
	position: relative;
}
.wc-vdc-out-of-stock label {
	cursor: not-allowed;
	text-decoration: line-through;
}
.wc-vdc-out-of-stock .wc-vdc-radio-custom {
	background-color: #f1f5f9;
}


/* LAYOUT 2: SAAS PRICING TABLE */
.wc-vdc-saas-container {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* Billing Cycle Toggle Switch */
.wc-vdc-billing-toggle-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-bottom: 12px;
}
.wc-vdc-toggle-label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--wc-vdc-text-muted);
	cursor: pointer;
	user-select: none;
	transition: color 0.2s ease;
	display: flex;
	align-items: center;
	gap: 6px;
}
.wc-vdc-toggle-label.active {
	color: var(--wc-vdc-text-main);
	font-weight: 600;
}
.wc-vdc-save-badge {
	background-color: #dcfce7;
	color: #15803d;
	font-size: 0.675rem;
	padding: 2px 6px;
	border-radius: 4px;
}
.wc-vdc-toggle-switch {
	position: relative;
	display: inline-block;
	width: 48px;
	height: 24px;
}
.wc-vdc-toggle-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}
.wc-vdc-toggle-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #cbd5e1;
	transition: .3s;
	border-radius: 24px;
}
.wc-vdc-toggle-slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: .3s;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.wc-vdc-toggle-switch input:checked + .wc-vdc-toggle-slider {
	background-color: var(--wc-vdc-highlight);
}
.wc-vdc-toggle-switch input:checked + .wc-vdc-toggle-slider:before {
	transform: translateX(24px);
}

/* SaaS Columns Grid */
.wc-vdc-saas-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
	align-items: stretch;
}

/* Card Styling */
.wc-vdc-saas-card {
	background: var(--wc-vdc-bg-card);
	border: 1px solid var(--wc-vdc-border);
	border-radius: 12px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	position: relative;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: var(--wc-vdc-shadow);
	cursor: pointer;
}
.wc-vdc-saas-card:hover:not(.wc-vdc-out-of-stock) {
	transform: translateY(-4px);
	box-shadow: var(--wc-vdc-shadow-active);
	border-color: var(--wc-vdc-text-muted);
}
.wc-vdc-saas-card.wc-vdc-selected {
	border-color: var(--wc-vdc-highlight);
	border-width: 2px;
	box-shadow: var(--wc-vdc-shadow-active);
}

/* Most Popular card styling */
.wc-vdc-saas-card.wc-vdc-popular-card {
	border-color: var(--wc-vdc-popular-bg);
	border-width: 2px;
}
.wc-vdc-popular-ribbon {
	position: absolute;
	top: -12px;
	left: 50%;
	transform: translateX(-50%);
	background-color: var(--wc-vdc-popular-bg);
	color: var(--wc-vdc-popular-text);
	font-size: 0.725rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 4px 12px;
	border-radius: 9999px;
	white-space: nowrap;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Header & Typography */
.wc-vdc-card-header {
	margin-bottom: 12px;
}
.wc-vdc-card-title {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--wc-vdc-text-main);
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.wc-vdc-card-badge {
	font-size: 0.65rem;
	font-weight: 600;
	background-color: #fee2e2;
	color: #b91c1c;
	padding: 2px 6px;
	border-radius: 9999px;
	text-transform: uppercase;
}

/* Price block */
.wc-vdc-card-price {
	display: flex;
	align-items: baseline;
	gap: 4px;
	margin-bottom: 16px;
}
.wc-vdc-price-display {
	font-size: 1.625rem;
	font-weight: 800;
	color: var(--wc-vdc-text-main);
}
.wc-vdc-price-display del {
	color: var(--wc-vdc-text-muted);
	font-size: 1rem;
	font-weight: 400;
	margin-right: 4px;
}
.wc-vdc-price-display ins {
	text-decoration: none;
	color: var(--wc-vdc-highlight);
}
.wc-vdc-price-period {
	font-size: 0.825rem;
	color: var(--wc-vdc-text-muted);
	font-weight: 500;
}

/* Description text */
.wc-vdc-card-desc {
	font-size: 0.825rem;
	color: var(--wc-vdc-text-muted);
	line-height: 1.4;
	margin-bottom: 20px;
}

/* Feature checklist block */
.wc-vdc-card-features-wrapper {
	flex: 1;
	margin-bottom: 24px;
}
.wc-vdc-card-features {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.wc-vdc-card-features li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 0.825rem;
	color: var(--wc-vdc-text-main);
	line-height: 1.35;
}
.wc-vdc-card-features li span {
	padding-top: 1px;
}

/* Button action footer */
.wc-vdc-card-footer {
	margin-top: auto;
}
.wc-vdc-select-plan-btn {
	width: 100% !important;
	padding: 12px 18px !important;
	font-size: 0.875rem !important;
	font-weight: 600 !important;
	border-radius: 8px !important;
	background-color: #f1f5f9 !important;
	color: var(--wc-vdc-text-main) !important;
	border: 1px solid var(--wc-vdc-border) !important;
	transition: all 0.25s ease !important;
	cursor: pointer;
	text-align: center;
}
.wc-vdc-saas-card:hover:not(.wc-vdc-out-of-stock) .wc-vdc-select-plan-btn {
	background-color: #e2e8f0 !important;
}
.wc-vdc-saas-card.wc-vdc-selected .wc-vdc-select-plan-btn {
	background-color: var(--wc-vdc-cta-bg) !important;
	color: var(--wc-vdc-cta-text) !important;
	border-color: var(--wc-vdc-cta-bg) !important;
}

/* Filter rules for toggle billing cycles */
.wc-vdc-has-toggle .wc-vdc-saas-card.wc-vdc-cycle-monthly,
.wc-vdc-has-toggle .wc-vdc-saas-card.wc-vdc-cycle-annual {
	display: none !important;
}

/* Show correct items when toggle state is selected */
.wc-vdc-saas-grid[data-active-cycle="monthly"] .wc-vdc-saas-card.wc-vdc-cycle-monthly {
	display: flex !important;
}
.wc-vdc-saas-grid[data-active-cycle="annual"] .wc-vdc-saas-card.wc-vdc-cycle-annual {
	display: flex !important;
}

/* Out of Stock pricing table card style */
.wc-vdc-saas-card.wc-vdc-out-of-stock {
	border-style: dashed;
	background-color: #fafafa;
}
.wc-vdc-saas-card.wc-vdc-out-of-stock .wc-vdc-card-title,
.wc-vdc-saas-card.wc-vdc-out-of-stock .wc-vdc-price-display {
	color: var(--wc-vdc-text-muted);
}
.wc-vdc-saas-card.wc-vdc-out-of-stock .wc-vdc-check-icon {
	color: #94a3b8;
}

/* Mobile Responsive Adjustments */
@media screen and (max-width: 768px) {
	.wc-vdc-row-main {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
	.wc-vdc-row-middle {
		align-self: flex-start;
	}
	.wc-vdc-row-right {
		width: 100%;
	}
	.wc-vdc-select-btn {
		width: 100% !important;
		text-align: center;
	}
	.wc-vdc-row-features li {
		width: 100%;
	}
}

/* Hide default WooCommerce variation description as it's already integrated in the custom layouts */
.wc-vdc-active-layout .woocommerce-variation-description,
.wc-vdc-active-layout form.variations_form .woocommerce-variation-description {
	display: none !important;
}

