/**
 * Frontend styles for LilBro Variation Swatches
 * Scoped to product form so cart fragment updates don't break layout
 */

/* Keep variation value cell stable after cart/notice updates (prevent layout break) */
.single-product .variations_form .value {
	overflow: visible;
	min-height: 0;
	min-width: 0;
}

/* Swatch container – force our layout even if theme tries to override */
.single-product .variations_form .value .lilbro-vs-swatches,
.single-product .variations_form .lilbro-vs-swatches,
.variations_form .lilbro-vs-swatches {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 12px !important;
	margin-top: 10px !important;
	margin-bottom: 10px !important;
	position: relative !important;
	width: 100% !important;
	min-width: 0 !important;
}
	
/* Individual swatch – flex-shrink: 0 so cart update doesn't squash them */
.lilbro-vs-swatch {
	display: inline-flex !important;
	flex-direction: column !important;
	align-items: center !important;
	cursor: pointer !important;
	border: 2px solid transparent !important;
	transition: all 0.3s ease !important;
	position: relative !important;
	text-align: center !important;
	flex-shrink: 0 !important;
}

.lilbro-vs-swatch:hover {
	border-color: #333;
	transform: translateY(-2px);
}

.lilbro-vs-swatch.selected {
	border-color: #EC7A5C;
	box-shadow: 0 0 0 2px rgba(236, 122, 92, 1);
	transform: scale(1.1);
}

/* Color swatch */
.lilbro-vs-swatch-color {
	width: 50px !important;
	height: 50px !important;
	min-width: 50px !important;
	min-height: 50px !important;
	border-radius: 4px !important;
	border: 1px solid #ddd !important;
	position: relative !important;
	flex-shrink: 0 !important;
}
	
.lilbro-vs-swatch-color .lilbro-vs-swatch-label {
	display: none !important;
}

/* Image swatch – fixed size so layout doesn't collapse after fragment update */
.lilbro-vs-swatch-image {
	width: 80px !important;
	height: 80px !important;
	min-width: 80px !important;
	min-height: 80px !important;
	border-radius: 4px !important;
	overflow: visible !important;
	border: 1px solid #ddd !important;
	position: relative !important;
	flex-shrink: 0 !important;
}

.lilbro-vs-swatch-image img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block !important;
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	transition: opacity 0.3s ease !important;
}

.lilbro-vs-swatch-image .lilbro-vs-swatch-main-img {
	position: relative;
	z-index: 1;
}

.lilbro-vs-swatch-image .lilbro-vs-swatch-hover-img {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
}

/* Ensure zoom icon is above images */
.lilbro-vs-swatch-image .lilbro-vs-zoom-icon {
	z-index: 100 !important;
}

.lilbro-vs-swatch-image:hover .lilbro-vs-swatch-main-img {
	opacity: 0;
}

.lilbro-vs-swatch-image:hover .lilbro-vs-swatch-hover-img {
	display: block !important;
	opacity: 1;
}

.lilbro-vs-swatch-image .lilbro-vs-swatch-label {
	display: none !important;
}

/* Text swatch (for attributes without color/image - e.g. size) */
.lilbro-vs-swatch-text {
	min-width: 64px !important;
	min-height: 40px !important;
	padding: 8px 16px !important;
	border-radius: 999px !important; /* pill style */
	border: 1px solid #ddd !important;
	background: #f8f8f8 !important;
	justify-content: center !important;
	align-items: center !important;
	flex-shrink: 0 !important;
	box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
	
.lilbro-vs-swatch-text .lilbro-vs-swatch-text-label {
	font-size: 13px !important;
	color: #333 !important;
	white-space: nowrap !important;
	font-weight: 500 !important;
	letter-spacing: 0.02em;
}
	
.lilbro-vs-swatch-text:hover {
	background: #ffffff !important;
	border-color: #EC7A5C !important;
	box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
	
.lilbro-vs-swatch-text.selected {
	background: #EC7A5C !important;
	border-color: #EC7A5C !important;
	box-shadow: 0 3px 8px rgba(236,122,92,0.4);
}
	
.lilbro-vs-swatch-text.selected .lilbro-vs-swatch-text-label {
	color: #ffffff !important;
	font-weight: 600 !important;
}

/* Zoom icon button */
.lilbro-vs-zoom-icon {
	position: absolute !important;
	top: -3px !important;
	right: -3px !important;
	width: auto !important;
	height: auto !important;
	background: rgba(0, 0, 0, 0.47) !important;
	border: none !important;
	border-radius: 50% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	z-index: 1000 !important;
	opacity: 0.9 !important;
	transition: all 0.2s ease;
	padding: 4px !important;
	margin: 0 !important;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
	visibility: visible !important;
}

.lilbro-vs-swatch-image:hover .lilbro-vs-zoom-icon {
	opacity: 1;
}

.lilbro-vs-zoom-icon:hover {
	background: rgba(0, 0, 0, 0.7) !important;
	transform: scale(1.1);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.lilbro-vs-zoom-icon:active {
	transform: scale(0.95);
}

.lilbro-vs-zoom-icon svg {
	color: #fff !important;
	transition: color 0.2s ease;
	width: 18px !important;
	height: 18px !important;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: relative !important;
	z-index: 1001 !important;
}

.lilbro-vs-zoom-icon:hover svg {
	color: #fff !important;
}

.lilbro-vs-swatch.selected .lilbro-vs-swatch-label {
	color: #EC7A5C;
	font-weight: bold;
}

/* Hide select when swatches are shown */
.variations .value .lilbro-vs-swatches ~ select {
	display: none !important;
}

/* Show zoom icon always on image swatches (not just on hover for better UX) */
.lilbro-vs-swatch-image .lilbro-vs-zoom-icon {
	opacity: 0.95 !important;
	visibility: visible !important;
}

.lilbro-vs-swatch-image:hover .lilbro-vs-zoom-icon,
.lilbro-vs-swatch-image.selected .lilbro-vs-zoom-icon {
	opacity: 1 !important;
	visibility: visible !important;
}

/* Lightbox */
.lilbro-vs-lightbox {
	display: flex !important;
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	background: rgba(0, 0, 0, 0.95) !important;
	z-index: 999999 !important;
	cursor: pointer;
	transition: opacity 0.3s ease;
	align-items: center !important;
	justify-content: center !important;
	margin: 0 !important;
	padding: 80px !important;
	box-sizing: border-box !important;
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.lilbro-vs-lightbox-content {
	position: relative !important;
	max-width: 90vw !important;
	max-height: 90vh !important;
	cursor: default;
	text-align: center;
	z-index: 1000000 !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex-direction: column !important;
}

.lilbro-vs-lightbox-content img {
	max-width: 100% !important;
	max-height: 90vh !important;
	width: auto !important;
	height: auto !important;
	display: block !important;
	margin: 0 auto !important;
	border-radius: 8px;
	box-shadow: 0 4px 30px rgba(0,0,0,0.5);
	object-fit: contain !important;
}

.lilbro-vs-lightbox-close {
	position: fixed !important;
	top: 20px !important;
	right: 20px !important;
	background: rgba(255, 255, 255, 0.9) !important;
	border: 2px solid #fff !important;
	border-radius: 50% !important;
	width: 50px !important;
	height: 50px !important;
	font-size: 32px !important;
	line-height: 1 !important;
	cursor: pointer !important;
	color: #333 !important;
	transition: all 0.3s ease;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	z-index: 1000001 !important;
	margin: 0 !important;
	padding: 0 !important;
}

.lilbro-vs-lightbox-close:hover {
	background: #EC7A5C;
	color: #fff;
	border-color: #EC7A5C;
	transform: rotate(90deg) scale(1.1);
}

/* Price on button (above "Adaugă în coș" text) – only inside variable product form to avoid breaking cart */
.variations_form.cart .single_add_to_cart_button {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

.variations_form.cart .price-on-button {
	font-size: 0.9em;
	margin: 0;
	color: #666;
	line-height: 1.2;
	order: -1;
}

.variations_form.cart .price-on-button del {
	opacity: 0.7;
}

.variations_form.cart .price-on-button ins {
	text-decoration: none;
	font-weight: 600;
}

/* Hide built-in variation price block – we render price on the button instead */
.single-product .variations_form.cart .single_variation .woocommerce-variation-price {
	display: none !important;
}
