/**
 * Stili Front-End HITA Privacy & Cookie Policy & Cookie Banner
 */

/* ==========================================================================
   1. Stili Pagine Privacy & Cookie Policy
   ========================================================================== */
.hita-policy-wrapper {
	max-width: 960px;
	margin: 30px auto;
	padding: 0 20px;
	font-family: inherit;
	color: #334155;
	line-height: 1.7;
	font-size: 16px;
}

.hita-policy-wrapper h2 {
	font-size: 1.6rem;
	font-weight: 700;
	color: #0f172a;
	margin: 36px 0 16px;
	padding-bottom: 8px;
	border-bottom: 2px solid #e2e8f0;
}

.hita-policy-wrapper h3 {
	font-size: 1.3rem;
	font-weight: 600;
	color: #1e293b;
	margin: 28px 0 12px;
}

.hita-policy-wrapper h4 {
	font-size: 1.1rem;
	font-weight: 600;
	color: #334155;
	margin: 20px 0 10px;
}

.hita-policy-wrapper h5 {
	font-size: 1.05rem;
	font-weight: 600;
	color: #0284c7;
	margin: 0 0 6px;
}

.hita-policy-wrapper p {
	margin: 0 0 16px;
}

.hita-policy-wrapper hr {
	border: 0;
	height: 1px;
	background: #e2e8f0;
	margin: 32px 0;
}

.hita-policy-wrapper ul {
	margin: 0 0 20px 24px;
	padding: 0;
}

.hita-policy-wrapper li {
	margin-bottom: 8px;
}

.hita-policy-wrapper a {
	color: #0284c7;
	text-decoration: underline;
	transition: color 0.15s ease;
}

.hita-policy-wrapper a:hover {
	color: #0369a1;
}

/* Accordion details/summary */
.hita-policy-wrapper details {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	margin: 0 0 12px;
	background: #ffffff;
	transition: all 0.2s ease;
	overflow: hidden;
}

.hita-policy-wrapper details[open] {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
	border-color: #cbd5e1;
}

.hita-policy-wrapper summary {
	cursor: pointer;
	list-style: none;
	position: relative;
	padding: 16px 48px 16px 20px;
	font-weight: 600;
	font-size: 1.1rem;
	color: #0f172a;
	background: #f8fafc;
	user-select: none;
	transition: background 0.15s ease;
}

.hita-policy-wrapper summary:hover {
	background: #f1f5f9;
}

.hita-policy-wrapper summary::-webkit-details-marker {
	display: none;
}

.hita-policy-wrapper summary::after {
	content: "+";
	position: absolute;
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.4rem;
	font-weight: 400;
	color: #64748b;
	transition: transform 0.2s ease;
}

.hita-policy-wrapper details[open] > summary::after {
	content: "\2212";
}

.hita-policy-wrapper details[open] > summary {
	border-bottom: 1px solid #e2e8f0;
	background: #ffffff;
}

.hita-policy-wrapper summary:focus-visible {
	outline: 2px solid #0284c7;
	outline-offset: -2px;
}

.hita-policy-wrapper details > :not(summary) {
	padding: 16px 20px;
}

.hita-policy-wrapper .hita-policy-missing {
	background: #fef08a;
	color: #854d0e;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 0.9em;
}

/* Card Fornitore del catalogo */
.hita-provider-card {
	background: #f8fafc;
	border-left: 3px solid #0284c7;
	border-radius: 0 6px 6px 0;
	padding: 14px 18px;
	margin: 14px 0;
}

.hita-provider-card p {
	margin: 0 0 8px;
}

.hita-provider-card p:last-child {
	margin-bottom: 0;
}

.hita-provider-data,
.hita-provider-place {
	font-size: 0.95em;
	color: #475569;
}

.hita-provider-usa-notice {
	color: #64748b;
	font-style: italic;
}

/* Box Rivedi Consenso Cookie */
.hita-cookie-manage-box {
	background: #f0f9ff;
	border: 1px solid #bae6fd;
	border-radius: 8px;
	padding: 20px 24px;
	margin: 24px 0 32px;
	text-align: center;
}

.hita-cookie-manage-box h3 {
	margin-top: 0;
	color: #0369a1;
	font-size: 1.25rem;
}

.hita-cookie-manage-box p {
	color: #334155;
	font-size: 0.95rem;
	max-width: 600px;
	margin: 0 auto 16px;
}

.hita-btn-manage-cookies {
	background: #0284c7;
	color: #ffffff;
	border: none;
	border-radius: 6px;
	padding: 10px 22px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
	transition: background 0.15s ease, transform 0.1s ease;
}

.hita-btn-manage-cookies:hover {
	background: #0369a1;
	transform: translateY(-1px);
}

/* ==========================================================================
   2. Stili Cookie Banner GDPR
   ========================================================================== */
#hita-cookie-banner {
	position: fixed;
	z-index: 999999;
	box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
	line-height: 1.5;
	display: none;
	animation: hitaBannerFadeIn 0.3s ease-out forwards;
}

#hita-cookie-banner * {
	box-sizing: border-box;
}

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

/* Posizioni del banner */
#hita-cookie-banner.hita-pos-bottom-bar {
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	padding: 20px 30px;
}

#hita-cookie-banner.hita-pos-bottom-left {
	left: 20px;
	bottom: 20px;
	max-width: 440px;
	border-radius: 12px;
	padding: 24px;
}

#hita-cookie-banner.hita-pos-bottom-right {
	right: 20px;
	bottom: 20px;
	max-width: 440px;
	border-radius: 12px;
	padding: 24px;
}

#hita-cookie-banner.hita-pos-modal {
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	max-width: 540px;
	width: 90%;
	border-radius: 12px;
	padding: 28px;
}

.hita-cb-header h3 {
	margin: 0 0 8px;
	font-size: 1.15rem;
	font-weight: 700;
	color: inherit;
}

.hita-cb-body p {
	margin: 0 0 16px;
	font-size: 0.9rem;
	opacity: 0.9;
}

.hita-cb-body a {
	color: inherit;
	text-decoration: underline;
	font-weight: 600;
}

.hita-cb-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.hita-cb-btn {
	border: none;
	border-radius: 6px;
	padding: 9px 18px;
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.1s ease;
}

.hita-cb-btn:hover {
	filter: brightness(1.1);
	transform: translateY(-1px);
}

.hita-cb-btn-accept {
	color: #ffffff;
}

.hita-cb-btn-reject {
	background: rgba(255, 255, 255, 0.15);
	color: inherit;
	border: 1px solid rgba(255, 255, 255, 0.25);
}

.hita-cb-btn-customize {
	background: transparent;
	color: inherit;
	border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Modal Personalizzazione */
#hita-cookie-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(4px);
	z-index: 1000000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

#hita-cookie-modal {
	background: #ffffff;
	color: #1e293b;
	width: 100%;
	max-width: 620px;
	max-height: 90vh;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
	animation: hitaModalScale 0.2s ease-out;
}

@keyframes hitaModalScale {
	from { opacity: 0; transform: scale(0.95); }
	to { opacity: 1; transform: scale(1); }
}

.hita-cm-header {
	padding: 20px 24px;
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.hita-cm-header h3 {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: #0f172a;
}

.hita-cm-close {
	background: transparent;
	border: none;
	font-size: 1.5rem;
	color: #64748b;
	cursor: pointer;
	padding: 0;
	line-height: 1;
}

.hita-cm-body {
	padding: 20px 24px;
	overflow-y: auto;
	flex: 1;
}

.hita-cm-category {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 14px 18px;
	margin-bottom: 14px;
	background: #f8fafc;
}

.hita-cm-cat-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
}

.hita-cm-cat-top h4 {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: #0f172a;
}

.hita-cm-category p {
	margin: 0;
	font-size: 0.88rem;
	color: #64748b;
}

/* Switch toggle */
.hita-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
}

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

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

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

input:checked + .hita-slider {
	background-color: #0284c7;
}

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

input:disabled + .hita-slider {
	background-color: #0284c7;
	opacity: 0.6;
	cursor: not-allowed;
}

.hita-cm-footer {
	padding: 16px 24px;
	border-top: 1px solid #e2e8f0;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	background: #f8fafc;
}

/* Floating Trigger Icon */
#hita-cookie-floating-trigger {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 999990;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #0284c7;
	color: #ffffff;
	border: 2px solid #ffffff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform 0.2s ease, background 0.15s ease;
}

#hita-cookie-floating-trigger:hover {
	transform: scale(1.1);
	background: #0369a1;
}

#hita-cookie-floating-trigger svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

@media (max-width: 640px) {
	#hita-cookie-banner.hita-pos-bottom-bar,
	#hita-cookie-banner.hita-pos-bottom-left,
	#hita-cookie-banner.hita-pos-bottom-right,
	#hita-cookie-banner.hita-pos-modal {
		left: 10px !important;
		right: 10px !important;
		bottom: 10px !important;
		top: auto !important;
		transform: none !important;
		max-width: none !important;
		width: calc(100% - 20px) !important;
		border-radius: 12px;
		padding: 18px;
	}

	.hita-cb-actions {
		flex-direction: column;
		width: 100%;
	}

	.hita-cb-btn {
		width: 100%;
		text-align: center;
	}
}
