/**
 * Cookie Consent – evästebanneri (Meriturva-tyyli, DigiSilta WP Helper)
 * Värit muokattavissa Työkalut → Verkkosivun työkalut → Evästebannerin värit.
 * Oletus: --dsh-cc-primary #418B8D, --dsh-cc-primary-hover #2b5e60
 */

#dsh-cookie-consent .dsh-cookie-consent__btn,
#dsh-cookie-modal .dsh-cookie-consent__btn {
	background-color: #fff !important;
	color: #333 !important;
	border-color: #ddd !important;
}
#dsh-cookie-consent .dsh-cookie-consent__btn--primary,
#dsh-cookie-modal .dsh-cookie-consent__btn--primary {
	background: var(--dsh-cc-primary, #418B8D) !important;
	color: #fff !important;
	border-color: var(--dsh-cc-primary, #418B8D) !important;
}
#dsh-cookie-consent .dsh-cookie-consent__btn--primary:hover,
#dsh-cookie-modal .dsh-cookie-consent__btn--primary:hover {
	background: var(--dsh-cc-primary-hover, #2b5e60) !important;
	color: #fff !important;
	border-color: var(--dsh-cc-primary-hover, #2b5e60) !important;
}
#dsh-cookie-consent .dsh-cookie-consent__btn--secondary:hover,
#dsh-cookie-modal .dsh-cookie-consent__btn--secondary:hover {
	border-color: var(--dsh-cc-primary, #418B8D) !important;
	color: var(--dsh-cc-primary, #418B8D) !important;
}

/* Banner (alaosa) */
.dsh-cookie-consent {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 999999;
	background: var(--dsh-cc-banner-bg, #fafafa);
	border-top: 2px solid var(--dsh-cc-banner-border, #418B8D);
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
	padding: 24px 28px;
	transform: translateY(100%);
	transition: transform 0.3s ease;
}

.dsh-cookie-consent.is-visible {
	transform: translateY(0);
}

.dsh-cookie-consent__banner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
	max-width: 1200px;
	margin: 0 auto;
}

.dsh-cookie-consent__content {
	flex: 1;
	min-width: 260px;
}

.dsh-cookie-consent__title {
	margin: 0 0 10px 0;
	font-size: 1.15rem;
	font-weight: 700;
	color: #1a1a1a;
	letter-spacing: -0.01em;
}

.dsh-cookie-consent__text {
	margin: 0;
	font-size: 0.925rem;
	line-height: 1.55;
	color: #444;
}

.dsh-cookie-consent__text a.dsh-cookie-consent__link {
	color: var(--dsh-cc-primary, #418B8D) !important;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
	font: inherit;
}

.dsh-cookie-consent__text a.dsh-cookie-consent__link:hover {
	color: var(--dsh-cc-primary-hover, #2b5e60) !important;
	text-decoration: none;
}

.dsh-cookie-consent__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: flex-end;
	flex-shrink: 0;
}

.dsh-cookie-consent__btn {
	padding: 11px 22px;
	border-radius: 6px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
	border-width: 1px;
}

.dsh-cookie-consent__btn--primary {
	background: var(--dsh-cc-primary, #418B8D) !important;
	color: #fff !important;
	border: 1px solid var(--dsh-cc-primary, #418B8D) !important;
}

.dsh-cookie-consent__btn--primary:hover {
	background: var(--dsh-cc-primary-hover, #2b5e60) !important;
	border-color: var(--dsh-cc-primary-hover, #2b5e60) !important;
	color: #fff !important;
}

.dsh-cookie-consent__btn--secondary {
	background: #fff !important;
	color: #333 !important;
	border: 1px solid #ddd !important;
}

.dsh-cookie-consent__btn--secondary:hover {
	border-color: var(--dsh-cc-primary, #418B8D) !important;
	color: var(--dsh-cc-primary, #418B8D) !important;
}

/* Modaali */
.dsh-cookie-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s, visibility 0.2s;
}

.dsh-cookie-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.dsh-cookie-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	cursor: pointer;
}

.dsh-cookie-modal__panel {
	max-width: 80vw;
	position: relative;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
	width: 100%;
	max-height: 90vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.dsh-cookie-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px;
	border-bottom: 1px solid #e8e8e8;
	flex-shrink: 0;
}

.dsh-cookie-modal__title {
	margin: 0;
	font-size: 1.25rem;
}

.dsh-cookie-modal__close {
	background: none;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: var(--dsh-cc-primary, #418B8D);
	padding: 0 0.25rem;
}

.dsh-cookie-modal__close:hover {
	color: var(--dsh-cc-primary-hover, #2b5e60);
}

.dsh-cookie-modal__body {
	padding: 24px 28px;
	overflow-y: auto;
	flex: 1;
}

.dsh-cookie-modal__section {
	display: block;
}

.dsh-cookie-modal__category {
	padding: 20px 0;
	border-bottom: 1px solid #eee;
}

.dsh-cookie-modal__category:first-child {
	padding-top: 0;
}

.dsh-cookie-modal__category:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.dsh-cookie-modal__category-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 8px;
	font-weight: 600;
	font-size: 1rem;
	color: #1a1a1a;
}

.dsh-cookie-modal__desc {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.55;
	color: #555;
	padding-right: 4px;
}

.dsh-cookie-modal__toggle {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

.dsh-cookie-modal__toggle input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.dsh-cookie-modal__toggle-slider {
	position: relative;
	width: 44px;
	height: 24px;
	background: #d0d0d0;
	border-radius: 24px;
	cursor: pointer;
	transition: background 0.2s;
}

.dsh-cookie-modal__toggle-slider::after {
	content: '';
	position: absolute;
	width: 18px;
	height: 18px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	transition: transform 0.2s;
}

.dsh-cookie-modal__toggle input:checked + .dsh-cookie-modal__toggle-slider {
	background: var(--dsh-cc-primary, #418B8D) !important;
}

.dsh-cookie-modal__toggle input:checked + .dsh-cookie-modal__toggle-slider::after {
	transform: translateX(20px);
}

.dsh-cookie-modal__toggle--disabled {
	font-size: 0.85rem;
	color: var(--dsh-cc-primary, #418B8D) !important;
	font-weight: 600;
}

.dsh-cookie-modal__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: flex-end;
	align-items: center;
	padding: 20px 28px;
	border-top: 1px solid #e8e8e8;
	background: #fafafa;
}

.dsh-cookie-modal__footer .dsh-cookie-consent__btn {
	min-width: 160px;
}

/* Tietosuojaseloste -popup sisältö */
.dsh-privacy-content {
	font-size: 14px;
	line-height: 1.6;
}

.dsh-privacy-content h2 {
	margin-top: 1em;
}
.dsh-privacy-content h2:first-child {
	margin-top: 0;
}

/* Evästeasetukset -linkki (shortcode) */
.dsh-cookie-settings-link {
	background: none;
	border: none;
	padding: 0;
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.dsh-cookie-settings-link:hover {
	text-decoration: underline;
	opacity: 0.85;
}

.dsh-privacy-policy-btn {
	background: none;
	border: 1px solid currentColor;
	padding: 0.35em 0.75em;
	cursor: pointer;
	font-size: inherit;
	border-radius: 4px;
}

.dsh-privacy-policy-btn:hover {
	opacity: 0.9;
}

/* Evästetaulukko (shortcode [cookie-list] / [evastetaulukko]) */
.dsh-cookie-list {
	margin: 1em 0;
	overflow-x: auto;
}
.dsh-cookie-list__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}
.dsh-cookie-list__table th,
.dsh-cookie-list__table td {
	padding: 10px 14px;
	text-align: left;
	border-bottom: 1px solid #e8e8e8;
}
.dsh-cookie-list__table th {
	font-weight: 600;
	background: #f5f5f5;
}
.dsh-cookie-list__table code {
	font-size: 0.9em;
	background: #f0f0f0;
	padding: 2px 6px;
	border-radius: 3px;
}
.dsh-cookie-list__updated {
	margin-top: 12px;
	font-size: 0.9rem;
	color: #666;
}
.dsh-cookie-list--empty p {
	margin: 0;
	color: #666;
}

@media (max-width: 640px) {
	.dsh-cookie-consent {
		padding: 20px 20px;
	}

	.dsh-cookie-consent__banner {
		flex-direction: column;
		align-items: stretch;
		gap: 20px;
	}

	.dsh-cookie-consent__actions {
		align-items: stretch;
		width: 100%;
		gap: 8px;
	}

	.dsh-cookie-consent__btn {
		width: 100%;
	}
}
