/**
 * Cortina Consent Overlay Styles
 *
 * Styles for client-side consent overlay and content restrictions.
 * Content is hidden visually but remains in the DOM for SEO purposes.
 *
 * @package Cortina
 */

/**
 * Content Restrictions
 * 
 * When body has cortina-content-restricted class, hide/blur sensitive content.
 * Content remains in HTML for SEO but is not visible to users.
 */
/* Increase specificity to avoid !important - using body class provides enough specificity */
body.cortina-content-restricted .woocommerce-product-gallery img,
body.cortina-content-restricted .product-images img,
body.cortina-content-restricted .single-product-main-image img,
body.cortina-content-restricted .woocommerce-product-gallery__wrapper img,
body.cortina-content-restricted .product_images img,
body.cortina-content-restricted img.wp-post-image,
body.cortina-content-restricted .product-image-wrapper img {
	/* Hide images completely - they remain in DOM for search engines */
	visibility: hidden;
	opacity: 0;
	/* Maintain layout by keeping space */
	max-height: 400px;
}

/* Add a placeholder background where images would be */
body.cortina-content-restricted .woocommerce-product-gallery,
body.cortina-content-restricted .product-images,
body.cortina-content-restricted .product_images {
	background: #f0f0f0;
	min-height: 400px;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

/* Add icon or text to indicate restricted content */
body.cortina-content-restricted .woocommerce-product-gallery::before,
body.cortina-content-restricted .product-images::before,
body.cortina-content-restricted .product_images::before {
	/* Using text "LOCKED" for better screen reader accessibility than emoji */
	content: 'LOCKED';
	font-size: 24px;
	font-weight: bold;
	letter-spacing: 3px;
	color: #999;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1;
	opacity: 0.5;
}

/* Text blur removed - no longer needed per requirements */

/**
 * Consent Overlay Modal
 * 
 * Modal overlay that appears above content to request consent.
 */
.cortina-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cortina-overlay-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.75);
	z-index: 999999;
}

.cortina-overlay-modal {
	position: relative;
	z-index: 1000000;
	max-width: 600px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	animation: cortina-modal-slide-in 0.3s ease-out;
}

@keyframes cortina-modal-slide-in {
	from {
		opacity: 0;
		transform: translateY(-50px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.cortina-overlay-content {
	padding: 40px 30px;
}

.cortina-overlay-content h2 {
	margin: 0 0 20px 0;
	font-size: 28px;
	color: #333;
	text-align: center;
}

.cortina-overlay-message {
	margin-bottom: 30px;
	text-align: center;
}

.cortina-overlay-message p {
	font-size: 16px;
	line-height: 1.6;
	color: #555;
	margin: 0;
}

.cortina-overlay-checkbox {
	margin-bottom: 20px;
	padding: 15px;
	background: #f8f9fa;
	border-radius: 6px;
}

.cortina-overlay-checkbox label {
	display: flex;
	align-items: center;
	font-size: 16px;
	cursor: pointer;
	margin: 0;
}

.cortina-overlay-checkbox input[type="checkbox"] {
	margin: 0 10px 0 0;
	width: 20px;
	height: 20px;
	cursor: pointer;
	flex-shrink: 0;
}

.cortina-overlay-notice {
	margin-bottom: 30px;
	padding: 12px 15px;
	background: #e7f3ff;
	border-left: 4px solid #0073aa;
	border-radius: 4px;
}

.cortina-overlay-notice p {
	margin: 0;
	color: #555;
	font-size: 14px;
	line-height: 1.5;
}

.cortina-overlay-buttons {
	display: flex;
	gap: 15px;
	justify-content: center;
	flex-wrap: wrap;
}

.cortina-btn {
	padding: 14px 32px;
	font-size: 16px;
	font-weight: 600;
	border-radius: 6px;
	border: none;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	display: inline-block;
	min-width: 140px;
	text-align: center;
}

.cortina-btn-accept {
	background: #0073aa;
	color: #fff;
}

.cortina-btn-accept:hover {
	background: #005a87;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
}

.cortina-btn-decline {
	background: transparent;
	color: #0073aa;
	border: 2px solid #0073aa;
}

.cortina-btn-decline:hover {
	background: rgba(0, 115, 170, 0.1);
	color: #005a87;
	border-color: #005a87;
}

/* Focus styles for accessibility - WCAG 2.1 AA compliant */
.cortina-btn:focus,
.cortina-btn:focus-visible {
	outline: 3px solid #0073aa;
	outline-offset: 3px;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

/* Remove outline for mouse users but keep for keyboard users */
.cortina-btn:focus:not(:focus-visible) {
	outline: none;
	box-shadow: none;
}

.cortina-overlay-checkbox input[type="checkbox"]:focus,
.cortina-overlay-checkbox input[type="checkbox"]:focus-visible {
	outline: 3px solid #0073aa;
	outline-offset: 3px;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

.cortina-overlay-checkbox input[type="checkbox"]:focus:not(:focus-visible) {
	outline: none;
	box-shadow: none;
}

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

/* Responsive styles */
@media (max-width: 768px) {
	.cortina-overlay-content {
		padding: 30px 20px;
	}

	.cortina-overlay-content h2 {
		font-size: 24px;
	}

	.cortina-overlay-buttons {
		flex-direction: column;
	}

	.cortina-btn {
		width: 100%;
		min-width: auto;
	}

	.cortina-overlay-modal {
		width: 95%;
	}
}

/* Print styles - hide overlay when printing */
@media print {
	.cortina-overlay {
		display: none !important;
	}

	/* Remove content restrictions for printing */
	body.cortina-content-restricted .woocommerce-product-gallery,
	body.cortina-content-restricted .product-images,
	body.cortina-content-restricted .product_images {
		filter: none !important;
		visibility: visible !important;
		opacity: 1 !important;
	}
}

/* Ensure overlay works with common WordPress themes */
.cortina-overlay {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Override theme styles that might interfere */
.cortina-overlay * {
	box-sizing: border-box;
}

.cortina-overlay-modal {
	color: #333;
	text-align: left;
}
