/**
 * WP Simple Consent
 *
 * Cookie 同意バナー、詳細設定モーダル、
 * カテゴリ設定 UI のスタイル。
 */

/* ----------------------------------------------------------
 * 共通
 * ---------------------------------------------------------- */

.wpsc-banner,
.wpsc-settings-overlay,
.wpsc-settings-dialog {
	box-sizing: border-box;
}

.wpsc-banner *,
.wpsc-settings-overlay *,
.wpsc-settings-dialog * {
	box-sizing: border-box;
}

html.wpsc-modal-open,
body.wpsc-modal-open {
	overflow: hidden !important;
	height: 100%;
}

.wpsc-page-blocker {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;

	z-index: 99980;

	background: rgba(0, 0, 0, 0.35);

	cursor: default;

	touch-action: none;
}

.wpsc-page-blocker[hidden] {
	display: none !important;
}

/*
 * hidden 属性を確実に非表示にする。
 */
.wpsc-banner[hidden],
.wpsc-settings-overlay[hidden] {
	display: none !important;
}

/* ----------------------------------------------------------
 * Cookie バナー
 * ---------------------------------------------------------- */

.wpsc-banner {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99990;

	width: 100%;

	margin: 0;
	padding: 0;

	background: #ffffff;
	border-top: 1px solid #dcdcde;
	box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);

	color: #1d2327;

	font-family:
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		"Helvetica Neue",
		Arial,
		"Hiragino Kaku Gothic ProN",
		"Hiragino Sans",
		Meiryo,
		sans-serif;

	font-size: 16px;
	line-height: 1.6;
}

.wpsc-banner__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;

	width: 100%;
	max-width: 1200px;

	margin: 0 auto;
	padding: 20px 24px;
}

.wpsc-banner__content {
	flex: 1 1 auto;
	min-width: 0;
}

.wpsc-banner__title {
	margin: 0 0 8px;
	padding: 0;

	color: #1d2327;

	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
}

.wpsc-banner__title::before,
.wpsc-banner__title::after {
	content: none !important;
	display: none !important;
}

.wpsc-banner__description {
	margin: 0;
	padding: 0;

	color: #3c434a;

	font-size: 14px;
	line-height: 1.7;
}

.wpsc-banner__description p {
	margin: 0;
	padding: 0;

	font-size: 14px;
	line-height: 1.7;
}

.wpsc-banner__description p + p {
	margin-top: 6px;
}

.wpsc-banner__privacy {
	margin: 8px 0 0;
	padding: 0;
}

.wpsc-banner__privacy-link {
	color: #2271b1;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wpsc-banner__privacy-link:hover,
.wpsc-banner__privacy-link:focus {
	color: #135e96;
}

.wpsc-banner__actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
}

/* ----------------------------------------------------------
 * ボタン共通
 * ---------------------------------------------------------- */

.wpsc-button,
.wpsc-open-settings-shortcode {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	min-height: 44px;

	margin: 0;
	padding: 9px 18px;

	border: 1px solid #646970;
	border-radius: 4px !important;

	background: #ffffff;
	color: #1d2327;

	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;

	text-align: center;
	text-decoration: none;

	cursor: pointer;

	transition:
		background-color 0.15s ease,
		border-color 0.15s ease,
		color 0.15s ease,
		box-shadow 0.15s ease;
}

.wpsc-button:hover,
.wpsc-open-settings-shortcode:hover {
	background: #f0f0f1;
	border-color: #50575e;
	border-radius: 4px !important;
	color: #1d2327;
}

.wpsc-button:focus,
.wpsc-open-settings-shortcode:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.3);
}

/*
 * 「すべて拒否」と「すべて許可」の視認性に
 * 大きな差を付けない。
 */
.wpsc-button--reject,
.wpsc-button--accept {
	min-width: 110px;

	background: #ffffff;
	border: 2px solid #2271b1;
	color: #135e96;
}

.wpsc-button--reject:hover,
.wpsc-button--accept:hover {
	background: #f0f6fc;
	border-color: #135e96;
	color: #0a4b78;
}

/*
 * 設定ボタン。
 */
.wpsc-button--settings {
	min-width: 80px;
}

/*
 * 詳細設定の保存ボタン。
 */
.wpsc-button--save {
	min-width: 150px;

	background: #ffffff;
	border: 2px solid #2271b1;
	color: #135e96;
}

.wpsc-button--save:hover {
	background: #f0f6fc;
	border-color: #135e96;
	color: #0a4b78;
}

/* ----------------------------------------------------------
 * モーダル背景
 * ---------------------------------------------------------- */

.wpsc-settings-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;

	z-index: 99999;

	display: flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	height: 100%;

	padding: 24px;

	background: rgba(0, 0, 0, 0.55);

	overflow-x: hidden;
	overflow-y: auto;
}

/* ----------------------------------------------------------
 * 詳細設定モーダル
 * ---------------------------------------------------------- */

.wpsc-settings-dialog {
	position: relative;

	width: 100%;
	max-width: 680px;
	max-height: calc(100vh - 48px);

	margin: auto;

	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);

	color: #1d2327;

	overflow: hidden;

	font-family:
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		"Helvetica Neue",
		Arial,
		"Hiragino Kaku Gothic ProN",
		"Hiragino Sans",
		Meiryo,
		sans-serif;
}

/* ----------------------------------------------------------
 * モーダルヘッダー
 * ---------------------------------------------------------- */

.wpsc-settings-dialog__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;

	padding: 20px 24px;

	border-bottom: 1px solid #dcdcde;
}

.wpsc-settings-dialog__title {
	margin: 0;
	padding: 0;

	color: #1d2327;

	font-size: 22px;
	font-weight: 700;
	line-height: 1.4;
}

.wpsc-settings-dialog__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	flex: 0 0 auto;

	width: 40px;
	height: 40px;

	margin: 0;
	padding: 0 0 2px 0;

	border: 1px solid transparent;
	border-radius: 4px !important;

	background: transparent;
	color: #50575e;

	font-family: Arial, sans-serif;
	font-size: 26px;
	font-weight: 400;
	line-height: 1;

	text-align: center;

	cursor: pointer;
}

.wpsc-settings-dialog__close:hover {
	background: #f0f0f1;
	color: #1d2327;
}

.wpsc-settings-dialog__close:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.3);
}

/* ----------------------------------------------------------
 * モーダル本文
 * ---------------------------------------------------------- */

.wpsc-settings-dialog__body {
	max-height: calc(100vh - 220px);

	padding: 0 24px;

	overflow-x: hidden;
	overflow-y: auto;
}

/* ----------------------------------------------------------
 * Cookie カテゴリ
 * ---------------------------------------------------------- */

.wpsc-category {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;

	padding: 20px 0;

	border-bottom: 1px solid #dcdcde;
}

.wpsc-category:last-child {
	border-bottom: 0;
}

.wpsc-category__text {
	flex: 1 1 auto;
	min-width: 0;
}

.wpsc-category__title {
	display: block;

	margin: 0 0 5px;

	color: #1d2327;

	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
}

.wpsc-category__description {
	margin: 0;
	padding: 0;

	color: #646970;

	font-size: 13px;
	line-height: 1.6;
}

.wpsc-category__control {
	flex: 0 0 auto;
}

/* ----------------------------------------------------------
 * Cookie ON/OFF スイッチ
 * ---------------------------------------------------------- */

.wpsc-switch {
	display: flex;
	align-items: center;
	gap: 10px;

	cursor: pointer;
}

.wpsc-switch input[type="checkbox"] {
	position: relative;

	width: 46px;
	height: 24px;

	margin: 0;

	border: 1px solid #8c8f94;
	border-radius: 999px;

	background: #8c8f94;

	-webkit-appearance: none;
	appearance: none;

	cursor: pointer;

	transition:
		background-color 0.15s ease,
		border-color 0.15s ease;
}

.wpsc-switch input[type="checkbox"]::before {
	content: "";

	position: absolute;
	top: 2px;
	left: 2px;

	width: 18px;
	height: 18px;

	margin: 0;

	border-radius: 50%;

	background: #ffffff;

	transition: transform 0.15s ease;
}

.wpsc-switch input[type="checkbox"]:checked {
	background: #2271b1;
	border-color: #2271b1;
}

.wpsc-switch input[type="checkbox"]:checked::before {
	transform: translateX(22px);
}

.wpsc-switch input[type="checkbox"]:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.3);
}

.wpsc-switch input[type="checkbox"]:disabled {
	background: #646970;
	border-color: #646970;

	cursor: not-allowed;
	opacity: 0.75;
}

.wpsc-switch input[type="checkbox"]:disabled + .wpsc-switch__label {
	color: #646970;
}

.wpsc-switch__label {
	color: #1d2327;

	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

/* ----------------------------------------------------------
 * モーダルフッター
 * ---------------------------------------------------------- */

.wpsc-settings-dialog__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;

	padding: 18px 24px;

	border-top: 1px solid #dcdcde;

	background: #ffffff;
}

.wpsc-settings-dialog__privacy-link {
	color: #2271b1;

	font-size: 13px;

	text-decoration: underline;
	text-underline-offset: 2px;
}

.wpsc-settings-dialog__privacy-link:hover,
.wpsc-settings-dialog__privacy-link:focus {
	color: #135e96;
}

/* ----------------------------------------------------------
 * ショートコード
 * ---------------------------------------------------------- */

.wpsc-open-settings-shortcode {
	min-width: 120px;
}

/* ----------------------------------------------------------
 * タブレット・スマートフォン
 * ---------------------------------------------------------- */

@media screen and (max-width: 782px) {

	.wpsc-banner__inner {
		flex-direction: column;
		align-items: stretch;

		gap: 16px;

		padding: 18px 16px;
	}

	.wpsc-banner__title {
		font-size: 18px;
	}

	.wpsc-banner__description {
		font-size: 14px;
	}

	.wpsc-banner__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;

		width: 100%;
	}

	.wpsc-button {
		width: 100%;
		min-width: 0;
	}

	/*
	 * 「設定」は2列分を使用。
	 * 拒否と許可は同じ幅にする。
	 */
	.wpsc-button--settings {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	.wpsc-button--reject {
		grid-column: 1;
		grid-row: 1;
	}

	.wpsc-button--accept {
		grid-column: 2;
		grid-row: 1;
	}

	.wpsc-settings-overlay {
		align-items: flex-end;

		padding: 12px;
	}

	.wpsc-settings-dialog {
		max-width: none;
		max-height: calc(100vh - 24px);

		border-radius: 8px 8px 0 0;
	}

	.wpsc-settings-dialog__header {
		padding: 16px;
	}

	.wpsc-settings-dialog__title {
		font-size: 20px;
	}

	.wpsc-settings-dialog__body {
		max-height: calc(100vh - 210px);

		padding: 0 16px;
	}

	.wpsc-category {
		gap: 16px;

		padding: 18px 0;
	}

	.wpsc-settings-dialog__footer {
		flex-direction: column;
		align-items: stretch;

		padding: 16px;
	}

	.wpsc-settings-dialog__privacy-link {
		text-align: center;
	}

	.wpsc-button--save {
		width: 100%;
	}
}

/* ----------------------------------------------------------
 * 小さいスマートフォン
 * ---------------------------------------------------------- */

@media screen and (max-width: 480px) {

	.wpsc-banner__actions {
		display: flex;
		flex-direction: column;
	}

	/*
	 * スマートフォンでも拒否だけ操作を増やさない。
	 * 3ボタンをすべて同じ幅で表示する。
	 */
	.wpsc-button--reject,
	.wpsc-button--settings,
	.wpsc-button--accept {
		width: 100%;
	}

	.wpsc-category {
		align-items: flex-start;
	}

	.wpsc-category__description {
		font-size: 12px;
	}

	.wpsc-switch {
		flex-direction: column;
		gap: 4px;
	}

	.wpsc-switch__label {
		font-size: 11px;
	}
}

/* ----------------------------------------------------------
 * 動きを抑制する設定への対応
 * ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

	.wpsc-button,
	.wpsc-open-settings-shortcode,
	.wpsc-switch input[type="checkbox"],
	.wpsc-switch input[type="checkbox"]::before {
		transition: none;
	}
}
