/**
 * PK - Privacy & Cookie Consent Frontend CSS
 * Pure Vanilla CSS - Minimal, high-performance & responsive
 */

/* Banner Main Container - Container Query Context */
.pk-pcc-banner {
	container-type: inline-size;
	position: fixed;
	z-index: 999990;
	background-color: var(--pk-pcc-bg, #ffffff);
	color: var(--pk-pcc-text, #1e293b);
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: var(--pk-pcc-font-size, 12px);
	line-height: 1.5;
	box-sizing: border-box;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.pk-pcc-banner *, .pk-pcc-modal *, .pk-pcc-badge * {
	box-sizing: border-box;
}

.pk-pcc-banner-container {
	max-width: var(--pk-pcc-max-width, 600px);
	margin: 0 auto;
	padding: var(--pk-pcc-padding, 20px 24px);
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.pk-pcc-banner-title {
	margin: 0 0 8px 0;
	font-size: calc(var(--pk-pcc-font-size, 12px) * 1.35);
	font-weight: 700;
	color: var(--pk-pcc-text, #1e293b);
}

.pk-pcc-banner-text p {
	margin: 0;
	font-size: var(--pk-pcc-font-size, 12px);
}

.pk-pcc-privacy-link {
	color: inherit;
	text-decoration: underline;
	font-weight: 600;
	margin-left: 6px;
}

/* Banner Layout Presets */
.pk-pcc-layout-bottom_bar {
	bottom: 0;
	left: 0;
	right: 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 0 !important;
}

.pk-pcc-layout-top_bar {
	top: 0;
	left: 0;
	right: 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 0 !important;
}

.pk-pcc-layout-modal {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: calc(100% - 32px);
	max-width: min(var(--pk-pcc-max-width, 580px), calc(100% - 32px));
	border-radius: var(--pk-pcc-radius, 12px);
}

.pk-pcc-layout-popup_left {
	bottom: 20px;
	left: 20px;
	width: calc(100% - 40px);
	max-width: min(var(--pk-pcc-max-width, 440px), 480px);
	border-radius: var(--pk-pcc-radius, 12px);
}

.pk-pcc-layout-popup_right {
	bottom: 20px;
	right: 20px;
	width: calc(100% - 40px);
	max-width: min(var(--pk-pcc-max-width, 440px), 480px);
	border-radius: var(--pk-pcc-radius, 12px);
}

/* Modal, Popups, and S/M (375px, 600px) size presets ALWAYS use stacked column layout */
.pk-pcc-layout-modal .pk-pcc-banner-container,
.pk-pcc-layout-popup_left .pk-pcc-banner-container,
.pk-pcc-layout-popup_right .pk-pcc-banner-container,
.pk-pcc-banner[data-max-width="375px"] .pk-pcc-banner-container,
.pk-pcc-banner[data-max-width="600px"] .pk-pcc-banner-container {
	flex-direction: column !important;
	align-items: stretch !important;
}

.pk-pcc-layout-modal .pk-pcc-banner-actions,
.pk-pcc-layout-popup_left .pk-pcc-banner-actions,
.pk-pcc-layout-popup_right .pk-pcc-banner-actions,
.pk-pcc-banner[data-max-width="375px"] .pk-pcc-banner-actions,
.pk-pcc-banner[data-max-width="600px"] .pk-pcc-banner-actions {
	width: 100% !important;
	max-width: 100% !important;
	flex: 1 1 100% !important;
}

/* 2-Row Action Buttons Grid: Row 1 (Accetta, Rifiuta), Row 2 (Personalizza) */
.pk-pcc-banner-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	width: 100%;
	max-width: 100%;
	align-items: center;
}

/* For Bottom/Top Bar with Wide (950px) or Full (100%) width on Desktop viewports (>= 768px): Row layout */
@media (min-width: 768px) {
	.pk-pcc-layout-bottom_bar.pk-pcc-banner[data-max-width="950px"] .pk-pcc-banner-container,
	.pk-pcc-layout-bottom_bar.pk-pcc-banner[data-max-width="100%"] .pk-pcc-banner-container,
	.pk-pcc-layout-top_bar.pk-pcc-banner[data-max-width="950px"] .pk-pcc-banner-container,
	.pk-pcc-layout-top_bar.pk-pcc-banner[data-max-width="100%"] .pk-pcc-banner-container {
		flex-direction: row !important;
		align-items: center !important;
		justify-content: space-between !important;
	}

	.pk-pcc-layout-bottom_bar.pk-pcc-banner[data-max-width="950px"] .pk-pcc-banner-content,
	.pk-pcc-layout-bottom_bar.pk-pcc-banner[data-max-width="100%"] .pk-pcc-banner-content,
	.pk-pcc-layout-top_bar.pk-pcc-banner[data-max-width="950px"] .pk-pcc-banner-content,
	.pk-pcc-layout-top_bar.pk-pcc-banner[data-max-width="100%"] .pk-pcc-banner-content {
		flex: 1 1 0% !important;
		min-width: 0 !important;
		padding-right: 24px !important;
	}

	.pk-pcc-layout-bottom_bar.pk-pcc-banner[data-max-width="950px"] .pk-pcc-banner-actions,
	.pk-pcc-layout-bottom_bar.pk-pcc-banner[data-max-width="100%"] .pk-pcc-banner-actions,
	.pk-pcc-layout-top_bar.pk-pcc-banner[data-max-width="950px"] .pk-pcc-banner-actions,
	.pk-pcc-layout-top_bar.pk-pcc-banner[data-max-width="100%"] .pk-pcc-banner-actions {
		flex: 0 0 340px !important;
		width: 340px !important;
		max-width: 380px !important;
		justify-content: flex-end !important;
	}
}

/* Buttons High-Specificity Reset (Overrides Elementor & Theme Global Button Rules) */
.pk-pcc-banner button,
.pk-pcc-banner input[type="button"],
.pk-pcc-banner button[type="button"],
.pk-pcc-banner .pk-pcc-btn,
.pk-pcc-modal button,
.pk-pcc-modal input[type="button"],
.pk-pcc-modal button[type="button"],
.pk-pcc-modal .pk-pcc-btn,
button.pk-pcc-btn,
input[type="button"].pk-pcc-btn,
button[type="button"].pk-pcc-btn,
.pk-pcc-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 10px 16px !important;
	border-radius: var(--pk-pcc-radius, 6px) !important;
	font-size: var(--pk-pcc-font-size, 13px) !important;
	font-weight: 600 !important;
	font-family: inherit !important;
	cursor: pointer !important;
	border: none !important;
	text-align: center !important;
	transition: opacity 0.2s ease, transform 0.1s ease !important;
	line-height: 1.2 !important;
	box-sizing: border-box !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	box-shadow: none !important;
	outline: none !important;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	text-decoration: none !important;
	background-image: none !important;
}

.pk-pcc-banner button.pk-pcc-btn:hover,
.pk-pcc-modal button.pk-pcc-btn:hover,
button.pk-pcc-btn:hover,
.pk-pcc-btn:hover {
	opacity: 0.9 !important;
}

.pk-pcc-banner button.pk-pcc-btn:active,
.pk-pcc-modal button.pk-pcc-btn:active,
button.pk-pcc-btn:active,
.pk-pcc-btn:active {
	transform: scale(0.98) !important;
}

.pk-pcc-banner button.pk-pcc-btn-primary,
.pk-pcc-modal button.pk-pcc-btn-primary,
button.pk-pcc-btn-primary,
input[type="button"].pk-pcc-btn-primary,
.pk-pcc-btn-primary,
.pk-pcc-banner button.pk-pcc-btn-reject,
.pk-pcc-modal button.pk-pcc-btn-reject,
button.pk-pcc-btn-reject,
input[type="button"].pk-pcc-btn-reject,
.pk-pcc-btn-reject {
	flex: 1 1 calc(50% - 4px) !important;
	min-width: 100px !important;
}

.pk-pcc-banner button.pk-pcc-btn-sec,
.pk-pcc-modal button.pk-pcc-btn-sec,
button.pk-pcc-btn-sec,
input[type="button"].pk-pcc-btn-sec,
.pk-pcc-btn-sec {
	flex: 1 1 100% !important;
	width: 100% !important;
}

.pk-pcc-banner button.pk-pcc-btn-primary,
.pk-pcc-modal button.pk-pcc-btn-primary,
button.pk-pcc-btn-primary,
input[type="button"].pk-pcc-btn-primary,
.pk-pcc-btn-primary {
	background-color: var(--pk-pcc-btn-primary-bg, #0f172a) !important;
	color: var(--pk-pcc-btn-primary-text, #ffffff) !important;
	background-image: none !important;
}

.pk-pcc-banner button.pk-pcc-btn-reject,
.pk-pcc-modal button.pk-pcc-btn-reject,
button.pk-pcc-btn-reject,
input[type="button"].pk-pcc-btn-reject,
.pk-pcc-btn-reject {
	background-color: var(--pk-pcc-btn-reject-bg, #e2e8f0) !important;
	color: var(--pk-pcc-btn-reject-text, #475569) !important;
	background-image: none !important;
}

.pk-pcc-banner button.pk-pcc-btn-sec,
.pk-pcc-modal button.pk-pcc-btn-sec,
button.pk-pcc-btn-sec,
input[type="button"].pk-pcc-btn-sec,
.pk-pcc-btn-sec {
	background-color: var(--pk-pcc-btn-sec-bg, #f1f5f9) !important;
	color: var(--pk-pcc-btn-sec-text, #334155) !important;
	background-image: none !important;
}

/* Preferences Modal */
.pk-pcc-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999995;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	pointer-events: none;
}

.pk-pcc-modal[style*="display: flex"],
.pk-pcc-modal[style*="display:flex"] {
	pointer-events: auto !important;
}

.pk-pcc-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(2px);
}

.pk-pcc-modal-dialog {
	position: relative;
	background-color: var(--pk-pcc-bg, #ffffff);
	color: var(--pk-pcc-text, #1e293b);
	width: 100%;
	max-width: 600px;
	max-height: 90vh;
	border-radius: 12px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 2;
}

.pk-pcc-modal-header {
	padding: 18px 24px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}

.pk-pcc-modal-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	flex: 1;
}

.pk-pcc-modal button.pk-pcc-modal-close-btn,
button.pk-pcc-modal-close-btn,
button[type="button"].pk-pcc-modal-close-btn,
.pk-pcc-modal-close-btn {
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	font-size: 24px !important;
	cursor: pointer !important;
	color: inherit !important;
	line-height: 1 !important;
	flex-shrink: 0 !important;
	padding: 4px 8px !important;
	margin: -4px -8px -4px 0 !important;
	box-shadow: none !important;
	outline: none !important;
	height: auto !important;
	min-height: 0 !important;
	width: auto !important;
	text-transform: none !important;
	background-image: none !important;
}

.pk-pcc-modal-body {
	padding: 20px 24px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.pk-pcc-modal-desc {
	margin: 0 0 8px 0;
	font-size: 13px;
	opacity: 0.85;
}

.pk-pcc-categories-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.pk-pcc-category-item {
	padding: 14px;
	border-radius: 8px;
	background-color: rgba(0, 0, 0, 0.03);
	border: 1px solid rgba(0, 0, 0, 0.06);
}

.pk-pcc-cat-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
}

.pk-pcc-cat-name {
	font-weight: 600;
	font-size: 14px;
}

.pk-pcc-cat-desc {
	margin: 0;
	font-size: 12px;
	opacity: 0.8;
}

.pk-pcc-badge-locked {
	font-size: 11px;
	font-weight: 600;
	background: rgba(0, 0, 0, 0.08);
	color: var(--pk-pcc-text, #1e293b);
	padding: 4px 10px;
	border-radius: 6px;
	display: inline-block;
}

/* Pure CSS Toggle Switch */
.pk-pcc-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
}

.pk-pcc-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.pk-pcc-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #cbd5e1;
	transition: .2s;
	border-radius: 24px;
}

.pk-pcc-slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: .2s;
	border-radius: 50%;
}

.pk-pcc-switch input:checked + .pk-pcc-slider {
	background-color: #0284c7;
}

.pk-pcc-switch input:checked + .pk-pcc-slider:before {
	transform: translateX(20px);
}

.pk-pcc-switch input:disabled + .pk-pcc-slider {
	opacity: 0.6;
	cursor: not-allowed;
}

.pk-pcc-modal-footer {
	padding: 16px 24px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	display: flex;
	justify-content: flex-end;
}

button#pk-pcc-badge,
button.pk-pcc-badge,
input[type="button"].pk-pcc-badge,
#pk-pcc-badge,
.pk-pcc-badge {
	position: fixed !important;
	bottom: 20px !important;
	left: 20px !important;
	z-index: 999980 !important;
	background-color: var(--pk-pcc-badge-bg, var(--pk-pcc-btn-primary-bg, #0f172a)) !important;
	color: var(--pk-pcc-badge-text, var(--pk-pcc-btn-primary-text, #ffffff)) !important;
	border: 1px solid rgba(0, 0, 0, 0.08) !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
	border-radius: var(--pk-pcc-badge-radius, 20px) !important;
	padding: 8px 14px !important;
	line-height: initial !important;
	display: none;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	transition: transform 0.2s ease, box-shadow 0.2s ease !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	background-image: none !important;
	height: auto !important;
	min-height: 0 !important;
	width: auto !important;
}

button#pk-pcc-badge.pk-pcc-visible,
#pk-pcc-badge.pk-pcc-visible,
.pk-pcc-badge.pk-pcc-visible {
	display: inline-flex !important;
}

.pk-pcc-badge:hover, #pk-pcc-badge:hover {
	transform: translateY(-2px) !important;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Blocked Placeholder for Iframes */
.cookie-blocked-notice, .pk-pcc-blocked-notice {
	background: #f8fafc;
	border: 2px dashed #cbd5e1;
	border-radius: 8px;
	padding: 24px;
	text-align: center;
	color: #334155;
	margin: 0;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.cookie-blocked-notice p, .pk-pcc-blocked-notice p {
	margin: 0 0 14px 0;
	font-size: 14px;
	line-height: 1.4;
}

button.cookie-blocked-trigger,
button.pk-pcc-blocked-trigger,
input[type="button"].pk-pcc-blocked-trigger,
.cookie-blocked-trigger,
.pk-pcc-blocked-trigger {
	background-color: #0f172a !important;
	color: #ffffff !important;
	border: none !important;
	padding: 8px 16px !important;
	border-radius: var(--pk-pcc-radius, 6px) !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	line-height: 1.2 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	box-shadow: none !important;
	background-image: none !important;
	height: auto !important;
	min-height: 0 !important;
	width: auto !important;
}

.cookie-blocked-trigger:hover, .pk-pcc-blocked-trigger:hover {
	opacity: 0.9;
}

/* Cookie Table Shortcode Styling */
.pk-pcc-table-wrapper {
	overflow-x: auto;
	margin: 20px 0;
}

.pk-pcc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	text-align: left;
}

.pk-pcc-table th, .pk-pcc-table td {
	padding: 12px 14px;
	border-bottom: 1px solid #e2e8f0;
}

.pk-pcc-table th {
	background-color: #88888888;
	font-weight: 600;
}

.pk-pcc-col-name code {
	background: #88888888;
	padding: 2px 6px;
	border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.pk-pcc-badge-cat {
	display: inline-block;
	background: #88888888;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
}



/* Media Query Responsiveness for Mobile Viewports */
@media (max-width: 640px) {
	.pk-pcc-banner-container {
		padding: 16px;
		gap: 12px;
		flex-direction: column !important;
	}

	.pk-pcc-banner-title {
		font-size: 16px;
		margin-bottom: 6px;
	}

	.pk-pcc-banner-text p {
		font-size: 13px;
	}

	.pk-pcc-banner-actions {
		gap: 8px;
	}

	.pk-pcc-btn {
		padding: 9px 12px;
		font-size: 13px;
	}

	.pk-pcc-layout-modal {
		width: calc(100% - 24px);
		max-height: 85vh;
	}

	.pk-pcc-modal-dialog {
		max-height: 85vh;
	}
}

@media (max-width: 480px) {
	.pk-pcc-layout-popup_left,
	.pk-pcc-layout-popup_right {
		bottom: 12px;
		left: 12px;
		right: 12px;
		width: calc(100% - 24px);
		max-width: 100%;
	}

	.pk-pcc-btn {
		flex: 1 1 100%;
	}

	.pk-pcc-badge {
		bottom: 12px;
		left: 12px;
		padding: 6px 12px;
		font-size: 11px;
	}
}
