/**
 * Custom Bundle Builder Styles
 * Product ID: 950871 - Replacement Veneers
 *
 * Responsive, modern design with smooth animations
 */

/* ========================================
   Container & Layout
   ======================================== */

.ssv-bundle-builder {
	max-width: 900px;
	margin: 0 auto 3rem;
	padding: 2rem;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ssv-bundle-builder h3 {
	font-size: 1.75rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
	color: #1a1a1a;
}

.ssv-bundle-builder h4 {
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: #2c2c2c;
}

.ssv-bundle-builder p {
	color: #666;
	line-height: 1.6;
}

/* Product summary h4 styling */
.summary.entry-summary h4 {
	color: #e35aa7;
	font-size: 30px;
	font-weight: 700;
}

/* ========================================
   Bundle Size Selector
   ======================================== */

.bundle-size-selector {
	margin-bottom: 2.5rem;
}

.bundle-size-description {
	margin-bottom: 1.5rem;
	font-size: 1rem;
}

.bundle-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin-bottom: 0;
}

.bundle-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 1rem 1rem;
	border: 3px solid #e0e0e0;
	border-radius: 10px;
	background: #fafafa;
	cursor: pointer;
	transition: all 0.3s ease;
	text-align: center;
	min-height: 80px;
}

.bundle-card input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.bundle-card:hover {
	border-color: #0073aa;
	background: #f0f8ff;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
}

.bundle-card--selected,
.bundle-card:has(input:checked) {
	border-color: #0073aa;
	background: #e6f4ff;
	box-shadow: 0 4px 16px rgba(0, 115, 170, 0.2);
}

.bundle-card--selected::before,
.bundle-card:has(input:checked)::before {
	content: "✓";
	position: absolute;
	top: 10px;
	right: 10px;
	width: 24px;
	height: 24px;
	background: #0073aa;
	color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: bold;
}

.bundle-label {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	color: #2c2c2c;
}

.bundle-badge {
	display: block;
	margin-top: 0;
	font-size: 1.15rem;
	font-weight: 900;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

/* Badge color variants */
.bundle-card:nth-child(1) .bundle-badge {
	color: #1a1a1a; /* Black for "50% OFF" */
}

.bundle-card:nth-child(2) .bundle-badge {
	color: #e35aa7; /* Pink for "MOST POPULAR" */
}

.bundle-card:nth-child(3) .bundle-badge {
	color: #4fb44a; /* Green for "BEST VALUE" */
}

/* ========================================
   Set Configurators
   ======================================== */

.set-configurators {
	margin-bottom: 2rem;
}

.set-picker {
	padding: 1.75rem;
	background: #f9f9f9;
	border-radius: 10px;
	margin-bottom: 1.5rem;
	border: 2px solid #e35aa7;
	transition: all 0.3s ease;
}

.set-picker--error {
	border-color: #dc3545;
	background: #fff5f5;
	animation: shake 0.5s;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-10px); }
	75% { transform: translateX(10px); }
}

.set-picker-description {
	margin-bottom: 1rem;
	font-size: 0.9rem;
}

/* ========================================
   Arch Options
   ======================================== */

.arch-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1rem;
	margin-top: 1rem;
}

.arch-option {
	position: relative;
	display: block;
	padding: 1.25rem 1rem;
	border: 3px solid #e0e0e0;
	border-radius: 10px;
	background: white;
	cursor: pointer;
	transition: all 0.3s ease;
	text-align: center;
}

.arch-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.arch-option:hover {
	border-color: #0073aa;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
}

.arch-option--selected,
.arch-option:has(input:checked) {
	border-color: #0073aa;
	background: #e6f4ff;
	box-shadow: 0 4px 16px rgba(0, 115, 170, 0.2);
}

.arch-option-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
}

.arch-image-wrapper {
	width: 100%;
	max-width: 100%;
	height: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 6px;
}

.arch-image {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	transition: transform 0.3s ease;
}

.arch-option:hover .arch-image {
	transform: scale(1.05);
}

.arch-name {
	font-size: 0.95rem;
	font-weight: 600;
	color: #2c2c2c;
	line-height: 1.3;
}

.arch-pricing {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: 0.75rem;
	gap: 0.25rem;
}

.arch-was {
	font-size: 0.875rem;
	color: #616161;
	text-decoration: line-through;
}

.arch-price {
	font-size: 1.75rem;
	font-weight: 700;
	color: #0073aa;
	line-height: 1;
}

.arch-save {
	font-size: 0.875rem;
	font-weight: 900;
	color: #4fb44a;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.arch-checkmark {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 28px;
	height: 28px;
	background: #0073aa;
	color: white;
	border-radius: 50%;
	display: none;
	align-items: center;
	justify-content: center;
}

.arch-option--selected .arch-checkmark,
.arch-option:has(input:checked) .arch-checkmark {
	display: flex;
}

/* ========================================
   Shade Selector (Compact)
   ======================================== */

.shade-selector {
	margin-top: 2rem;
}

.shade-selector h4 {
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: 1rem;
	color: #2c2c2c;
}

.shade-options-simple {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 1rem;
}

.shade-option-simple {
	display: flex;
	align-items: center;
	padding: 1rem 1.5rem;
	border: 3px solid #e0e0e0;
	border-radius: 10px;
	background: white;
	cursor: pointer;
	transition: all 0.3s ease;
}

.shade-option-simple:hover {
	border-color: #0073aa;
	background: #f0f8ff;
}

.shade-option-simple:has(input:checked) {
	border-color: #0073aa;
	background: #e6f4ff;
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
}

.shade-option-simple input[type="radio"] {
	width: 24px;
	height: 24px;
	margin: 0;
	margin-right: 1rem;
	cursor: pointer;
	flex-shrink: 0;
}

.shade-name-simple {
	font-size: 1rem;
	font-weight: 600;
	color: #0073aa;
	line-height: 1.4;
}

.shade-colors-btn {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	background: transparent;
	color: #0073aa;
	border: 2px solid #0073aa;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
}

.shade-colors-btn:hover {
	background: #0073aa;
	color: white;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.2);
}

/* ========================================
   Shade Modal
   ======================================== */

.shade-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
}

.shade-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
}

.shade-modal-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: white;
	border-radius: 12px;
	padding: 2rem;
	max-width: 900px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.shade-modal-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 40px;
	height: 40px;
	background: #f0f0f0;
	border: none;
	border-radius: 50%;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #666;
}

.shade-modal-close:hover {
	background: #0073aa;
	color: white;
	transform: rotate(90deg);
}

.shade-modal-content h3 {
	font-size: 1.75rem;
	font-weight: 700;
	margin-bottom: 1.5rem;
	color: #1a1a1a;
	text-align: center;
}

.shade-modal-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 2rem;
}

.shade-modal-item {
	text-align: center;
}

.shade-modal-image-wrapper {
	width: 100%;
	height: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 8px;
	padding: 1.5rem;
	margin-bottom: 1rem;
}

.shade-modal-image {
	max-width: 100%;
	height: auto;
	object-fit: contain;
}

.shade-modal-name {
	font-size: 1.25rem;
	font-weight: 600;
	color: #0073aa;
	display: block;
}

/* ========================================
   Bundle Summary & Pricing
   ======================================== */

.bundle-summary {
	background: #f0f8ff;
	border: 2px solid #0073aa;
	border-radius: 10px;
	padding: 1.5rem;
	margin-bottom: 2rem;
	text-align: center;
}

.bundle-total {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin-bottom: 0.5rem;
}

.bundle-total-label {
	font-size: 1.25rem;
	font-weight: 600;
	color: #2c2c2c;
}

.bundle-total-price {
	font-size: 2rem;
	font-weight: 700;
	color: #0073aa;
	line-height: 1.2;
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.bundle-total-price span {
	font-size: 2rem;
	line-height: 1.2;
	font-weight: 700;
}

.bundle-total-note {
	font-size: 0.875rem;
	color: #666;
	margin: 0;
}

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

.bundle-actions {
	margin-bottom: 1rem;
}

.ssv-add-to-cart-button {
	width: 100%;
	padding: 1rem 2rem;
	font-size: 1.125rem;
	font-weight: 600;
	background: #0073aa;
	color: white;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.ssv-add-to-cart-button:hover:not(:disabled) {
	background: #005a87;
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(0, 115, 170, 0.3);
}

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

.ssv-add-to-cart-button:disabled {
	background: #ccc;
	cursor: not-allowed;
	opacity: 0.7;
}

.button-loading {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* Loading Spinner */
.spinner {
	animation: rotate 2s linear infinite;
}

.spinner .path {
	stroke: white;
	stroke-linecap: round;
	animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
	100% { transform: rotate(360deg); }
}

@keyframes dash {
	0% {
		stroke-dasharray: 1, 150;
		stroke-dashoffset: 0;
	}
	50% {
		stroke-dasharray: 90, 150;
		stroke-dashoffset: -35;
	}
	100% {
		stroke-dasharray: 90, 150;
		stroke-dashoffset: -124;
	}
}

/* ========================================
   Customer Verification
   ======================================== */

.customer-verification-section {
	padding: 2rem;
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border: 2px solid #e35aa7;
	border-radius: 12px;
	margin-bottom: 2rem;
	text-align: center;
}

.verification-header h3 {
	font-size: 1.5rem;
	color: #e35aa7;
	margin-bottom: 0.5rem;
}

.verification-description {
	font-size: 1rem;
	color: #555;
	max-width: 600px;
	margin: 0 auto 1.5rem;
	line-height: 1.6;
}

.verification-form {
	max-width: 500px;
	margin: 0 auto;
}

.verification-input-wrapper {
	display: flex;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.verification-input-wrapper input[type="text"] {
	flex: 1;
	padding: 0.875rem 1rem;
	font-size: 1rem;
	border: 2px solid #ddd;
	border-radius: 8px;
	transition: all 0.3s ease;
}

.verification-input-wrapper input[type="text"]:focus {
	outline: none;
	border-color: #e35aa7;
	box-shadow: 0 0 0 3px rgba(227, 90, 167, 0.15);
}

.verification-input-wrapper input[type="text"]::placeholder {
	color: #999;
}

.verification-button {
	padding: 0.875rem 1.5rem;
	font-size: 1rem;
	font-weight: 600;
	background: #e35aa7;
	color: white;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-width: 100px;
	white-space: nowrap;
}

.verification-button:hover:not(:disabled) {
	background: #c94993;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(227, 90, 167, 0.3);
}

.verification-button:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.verification-button .btn-loading {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.verification-button .spinner {
	animation: rotate 2s linear infinite;
}

.verification-button .spinner .path {
	stroke: white;
	stroke-linecap: round;
	animation: dash 1.5s ease-in-out infinite;
}

.verification-hint {
	font-size: 0.875rem;
	color: #777;
	margin: 0;
}

.verification-message {
	margin-top: 1rem;
}

.verification-message-content {
	padding: 1rem 1.5rem;
	border-radius: 8px;
	font-size: 0.95rem;
	line-height: 1.5;
}

.verification-message-content.verification-success {
	background: #d4edda;
	border: 2px solid #28a745;
	color: #155724;
}

.verification-message-content.verification-error {
	background: #f8d7da;
	border: 2px solid #dc3545;
	color: #721c24;
}

/* Hide bundle content until verified */
.bundle-content {
	overflow: hidden;
}

/* Hide ALL express payment buttons on bundle product pages until verified */
.product.term-spare-veneers .ppc-button-wrapper,
.product.term-spare-veneers div[id*="paypal"],
.product.term-spare-veneers div[id*="venmo"],
.product.term-spare-veneers div[id*="zoid-paypal"],
.product.term-spare-veneers .payment-method-ppcp-gateway {
	display: none !important;
}

/* Show payment buttons ONLY after customer verification */
body.customer-verified .ppc-button-wrapper,
body.customer-verified div[id*="paypal"],
body.customer-verified div[id*="venmo"],
body.customer-verified div[id*="zoid-paypal"],
body.customer-verified .payment-method-ppcp-gateway {
	display: block !important;
}

/* Screen reader only text */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ========================================
   Messages
   ======================================== */

.bundle-messages {
	margin-top: 1rem;
}

.bundle-message {
	padding: 1rem 1.25rem;
	border-radius: 8px;
	font-size: 0.95rem;
	line-height: 1.5;
}

.bundle-message--error {
	background: #fff5f5;
	border: 2px solid #dc3545;
	color: #721c24;
}

.bundle-message--success {
	background: #f0fff4;
	border: 2px solid #28a745;
	color: #155724;
}

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

@media (max-width: 768px) {
	.ssv-bundle-builder {
		padding: 1.5rem;
	}

	.ssv-bundle-builder h3 {
		font-size: 1.5rem;
	}

	.ssv-bundle-builder h4 {
		font-size: 1.125rem;
	}

	.bundle-options {
		grid-template-columns: 1fr;
	}

	.bundle-card {
		min-height: 70px;
		padding: 0.875rem 1rem;
	}

	.arch-options {
		grid-template-columns: 1fr;
	}

	.arch-image-wrapper {
		max-width: 100px;
		height: 80px;
	}

	.shade-options {
		grid-template-columns: 1fr;
	}

	.arch-price {
		font-size: 1.5rem;
	}

	.arch-was,
	.arch-save {
		font-size: 0.75rem;
	}

	.bundle-total-price {
		font-size: 1.5rem;
	}

	.bundle-total-price span {
		font-size: 1.5rem;
	}

	.ssv-add-to-cart-button {
		font-size: 1rem;
		padding: 0.875rem 1.5rem;
	}

	/* Customer Verification Responsive */
	.customer-verification-section {
		padding: 1.5rem;
	}

	.verification-header h3 {
		font-size: 1.25rem;
	}

	.verification-description {
		font-size: 0.9rem;
	}

	.verification-input-wrapper {
		flex-direction: column;
	}

	.verification-button {
		width: 100%;
	}
}

@media (max-width: 480px) {
	.ssv-bundle-builder {
		padding: 1rem;
	}

	.bundle-total {
		flex-direction: column;
		gap: 0.5rem;
	}

	.bundle-total-label {
		font-size: 1rem;
	}

	.bundle-total-price {
		font-size: 1.25rem;
		flex-wrap: wrap;
	}

	.bundle-total-price span {
		font-size: 1.25rem;
	}

	.bundle-badge {
		font-size: 0.75rem;
	}

	.arch-price {
		font-size: 1.25rem;
	}

	.arch-was,
	.arch-save {
		font-size: 0.7rem;
	}

	/* Customer Verification 480px */
	.customer-verification-section {
		padding: 1rem;
	}

	.verification-header h3 {
		font-size: 1.1rem;
	}

	.verification-description {
		font-size: 0.85rem;
		margin-bottom: 1rem;
	}

	.verification-input-wrapper input[type="text"] {
		padding: 0.75rem;
		font-size: 0.9rem;
	}

	.verification-button {
		padding: 0.75rem 1rem;
		font-size: 0.9rem;
	}

	.verification-hint {
		font-size: 0.8rem;
	}
}

/* ========================================
   Custom Product Addons Compatibility
   ======================================== */

/* Style Custom Product Addons within bundle builder */
.bundle-addons-section {
	margin-bottom: 2rem;
}

.bundle-cart-form .wcpa_form_outer {
	margin: 0;
	padding: 1.5rem;
	background: #f9f9f9;
	border-radius: 10px;
	border: 2px solid #e0e0e0;
}

/* Smooth price transitions to prevent flash */
.bundle-cart-form .wcpa_option_price,
.bundle-cart-form .wcpa_price,
.bundle-cart-form span[class*="price"] {
	transition: opacity 0.15s ease;
}

.bundle-cart-form .wcpa_option_price.updating {
	opacity: 0.3;
}

/* Override opacity fade for bundle products on checkout */
/* The main checkout CSS sets opacity: 0 for price animation, but we skip that JS for bundles */
.woocommerce-checkout .cart_item .product-total .woocommerce-Price-amount,
.woocommerce-checkout .cart-subtotal td .woocommerce-Price-amount,
.woocommerce-checkout .order-total td .woocommerce-Price-amount {
	opacity: 1 !important;
	transition: none !important;
}

.bundle-cart-form .wcpa_form_outer h4,
.bundle-cart-form .wcpa_form_outer .wcpa_title {
	font-size: 1.125rem;
	font-weight: 600;
	color: #2c2c2c;
	margin-bottom: 0.75rem;
}

.bundle-cart-form .wcpa_form_outer .wcpa_form_item {
	margin-bottom: 1.5rem;
}

.bundle-cart-form .wcpa_form_outer label {
	font-weight: 500;
	color: #2c2c2c;
}

.bundle-cart-form .wcpa_form_outer input[type="checkbox"] {
	margin-right: 0.5rem;
}

/* Ensure form doesn't interfere with bundle builder styles */
.bundle-cart-form {
	all: unset;
	display: block;
	width: 100%;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
	.ssv-bundle-builder {
		box-shadow: none;
		border: 1px solid #ddd;
	}

	.bundle-actions,
	.bundle-messages {
		display: none;
	}
}
