/**
 * WooCommerce Variation Plans - Frontend stylesheet.
 *
 * Designed with modern responsive systems and premium custom variables.
 */

:root {
	--wc-vp-primary: #4f46e5;
	--wc-vp-secondary: #10b981;
	--wc-vp-card-radius: 8px;
	--wc-vp-btn-radius: 4px;
	--wc-vp-card-gap: 20px;
	--wc-vp-gray-light: #f9fafb;
	--wc-vp-gray-border: #e5e7eb;
	--wc-vp-text-main: #1f2937;
	--wc-vp-text-muted: #6b7280;
}

/* 1. Grid layouts & Responsive alignments */
.wc-vp-pricing-table-container {
	margin: 25px 0;
	position: relative;
	width: 100%;
}

.wc-vp-plans-grid {
	display: grid;
	gap: var(--wc-vp-card-gap);
	margin-bottom: 20px;
	width: 100%;
}

/* Columns variations */
@media (min-width: 1024px) {
	.wc-vp-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
	.wc-vp-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.wc-vp-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.wc-vp-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 640px) and (max-width: 1023px) {
	.wc-vp-plans-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 639px) {
	.wc-vp-plans-grid {
		grid-template-columns: 1fr !important;
	}
}

/* 2. Base Plan Card Styles */
.wc-vp-plan-card {
	background: #ffffff;
	border: 1px solid var(--wc-vp-gray-border);
	border-radius: var(--wc-vp-card-radius);
	padding: 30px;
	position: relative;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	box-sizing: border-box;
}

/* 3. Visual Style Presets */
/* Classic */
.wc-vp-preset-classic .wc-vp-plan-card {
	border-width: 1px;
}

/* Modern */
.wc-vp-preset-modern .wc-vp-plan-card {
	border-width: 2px;
	border-color: #374151;
}
.wc-vp-preset-modern .wc-vp-plan-card.wc-vp-highlighted-card {
	border-color: var(--wc-vp-primary);
}

/* Minimal */
.wc-vp-preset-minimal .wc-vp-plan-card {
	border: none !important;
	background: var(--wc-vp-gray-light);
}

/* Rounded */
.wc-vp-preset-rounded .wc-vp-plan-card {
	border-radius: 20px;
}

/* Shadow */
.wc-vp-preset-shadow .wc-vp-plan-card {
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}
.wc-vp-preset-shadow .wc-vp-plan-card:hover {
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Hover lift effect */
.wc-vp-pricing-table-container.wc-vp-equal-height .wc-vp-plans-grid {
	align-items: stretch;
}
.wc-vp-equal-height .wc-vp-plan-card {
	height: 100%;
}

/* Alignments */
.wc-vp-align-left .wc-vp-plan-card { text-align: left; align-items: flex-start; }
.wc-vp-align-center .wc-vp-plan-card { text-align: center; align-items: center; }
.wc-vp-align-right .wc-vp-plan-card { text-align: right; align-items: flex-end; }

/* 4. Active Card Selection styles */
.wc-vp-plan-card.wc-vp-active-plan {
	border-color: var(--wc-vp-primary) !important;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
	transform: scale(1.02);
	z-index: 2;
}

/* 5. Sub-elements Inside Card */
.wc-vp-card-header {
	width: 100%;
	margin-bottom: 20px;
}

.wc-vp-plan-title {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0 0 6px 0;
	color: var(--wc-vp-text-main);
	line-height: 1.2;
}

.wc-vp-plan-subtitle {
	font-size: 0.875rem;
	color: var(--wc-vp-text-muted);
	margin: 0;
	line-height: 1.4;
}

/* Price block */
.wc-vp-price-box {
	margin-bottom: 25px;
	width: 100%;
}

.wc-vp-current-price {
	font-size: 2.25rem;
	font-weight: 800;
	color: var(--wc-vp-text-main);
	letter-spacing: -0.05em;
	display: inline-block;
}

.wc-vp-original-price {
	font-size: 1.25rem;
	text-decoration: line-through;
	color: var(--wc-vp-text-muted);
	margin-right: 8px;
	display: inline-block;
}

.wc-vp-current-price.wc-vp-sale-active {
	color: var(--wc-vp-secondary);
}

.wc-vp-savings-badge {
	display: inline-block;
	background-color: #fef3c7;
	color: #d97706;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 9999px;
	margin-left: 8px;
	vertical-align: middle;
}

.wc-vp-subscription-period {
	font-size: 0.875rem;
	color: var(--wc-vp-text-muted);
	font-weight: 500;
	margin-left: 4px;
}

/* Badges (Popular, Best Value, Recommended etc) */
.wc-vp-badge {
	position: absolute;
	top: -12px;
	right: 15px;
	padding: 4px 12px;
	font-size: 0.75rem;
	font-weight: 700;
	border-radius: 9999px;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	z-index: 3;
}

.wc-vp-badge-popular { background: var(--wc-vp-primary); }
.wc-vp-badge-best_value { background: var(--wc-vp-secondary); }
.wc-vp-badge-recommended { background: #3b82f6; }
.wc-vp-badge-custom { background: #f43f5e; }

/* Description */
.wc-vp-description {
	font-size: 0.875rem;
	color: var(--wc-vp-text-muted);
	margin-bottom: 25px;
	line-height: 1.5;
	width: 100%;
}

.wc-vp-description ul {
	padding-left: 1.25rem;
	margin: 0;
}

/* Features List Bulletpoints */
.wc-vp-features-list {
	width: 100%;
	margin-bottom: 30px;
	flex-grow: 1;
}

.wc-vp-features-list ul {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	text-align: left !important;
}

.wc-vp-features-list li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.875rem;
	margin-bottom: 12px !important;
	line-height: 1.4;
	color: var(--wc-vp-text-main);
}

.wc-vp-features-list li.wc-vp-feat-excluded {
	color: var(--wc-vp-text-muted);
	opacity: 0.6;
}

.wc-vp-features-list li.wc-vp-feat-excluded .wc-vp-feat-icon {
	color: #ef4444;
}

.wc-vp-feat-icon {
	color: var(--wc-vp-secondary);
	font-weight: bold;
	flex-shrink: 0;
	font-size: 1rem;
	line-height: 1;
}

/* Stock Status styling */
.wc-vp-stock-status {
	width: 100%;
	margin-bottom: 15px;
	font-size: 0.775rem;
	font-weight: 600;
}
.wc-vp-out-of-stock { color: #dc2626; }
.wc-vp-backorder { color: #d97706; }

/* 6. Action Button Area */
.wc-vp-action-area {
	width: 100%;
	margin-top: auto;
}

.wc-vp-select-plan-btn {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	text-align: center;
	padding: 12px 24px !important;
	border-radius: var(--wc-vp-btn-radius) !important;
	font-size: 0.95rem !important;
	font-weight: 700 !important;
	transition: all 0.2s ease !important;
	cursor: pointer;
	border: 2px solid var(--wc-vp-primary);
	background-color: transparent;
	color: var(--wc-vp-primary);
	text-decoration: none !important;
}
.wc-vp-select-plan-btn:hover {
	background-color: var(--wc-vp-primary);
	color: #fff;
}

.wc-vp-active-plan .wc-vp-select-plan-btn {
	background-color: var(--wc-vp-primary);
	color: #fff;
}

/* Qty Selector styles inside Card */
.wc-vp-quantity-selector {
	margin-bottom: 15px;
	width: 100%;
}
.wc-vp-qty-control {
	display: flex;
	border: 1px solid var(--wc-vp-gray-border);
	border-radius: var(--wc-vp-btn-radius);
	overflow: hidden;
	width: max-content;
	margin: 0 auto;
}
.wc-vp-qty-decrement, .wc-vp-qty-decrease, .wc-vp-qty-increase {
	background: var(--wc-vp-gray-light);
	border: none;
	width: 32px;
	height: 32px;
	cursor: pointer;
	font-weight: bold;
	font-size: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}
.wc-vp-qty-decrease:hover, .wc-vp-qty-increase:hover {
	background: #e5e7eb;
}
.wc-vp-qty-input {
	border: none !important;
	border-left: 1px solid var(--wc-vp-gray-border) !important;
	border-right: 1px solid var(--wc-vp-gray-border) !important;
	width: 48px !important;
	height: 32px !important;
	text-align: center !important;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 0.875rem !important;
	-moz-appearance: textfield;
}
.wc-vp-qty-input::-webkit-outer-spin-button,
.wc-vp-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Spinner loader details */
.wc-vp-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #fff;
	animation: wc-vp-spin 0.6s linear infinite;
	margin-left: 8px;
}

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

/* CSS Only Entrance Animation options */
.wc-vp-pricing-table-container.wc-vp-animate-fade .wc-vp-plan-card {
	animation: wcVpFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.wc-vp-pricing-table-container.wc-vp-animate-fade .wc-vp-plan-card:nth-child(2) { animation-delay: 0.15s; }
.wc-vp-pricing-table-container.wc-vp-animate-fade .wc-vp-plan-card:nth-child(3) { animation-delay: 0.3s; }
.wc-vp-pricing-table-container.wc-vp-animate-fade .wc-vp-plan-card:nth-child(4) { animation-delay: 0.45s; }

@keyframes wcVpFadeIn {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: translateY(0); }
}
