/**
 * Cookie Consent - GDPR/CCPA compliant banner and modal styles
 * Clean, modern, responsive. Suitable for ecommerce.
 */

/* ---- Banner (fixed bottom) ---- */
.cookie-consent-banner {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 99999;
	background: #1a1a2e;
	color: #e8e8e8;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	transition: transform 0.35s ease, opacity 0.35s ease;
}

.cookie-consent-banner--hidden {
	transform: translateY(100%);
	opacity: 0;
	pointer-events: none;
}

.cookie-consent-banner-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px 24px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 20px;
}

.cookie-consent-content {
	flex: 1 1 280px;
	min-width: 0;
}

.cookie-consent-title {
	margin: 0 0 8px 0;
	font-size: 1.15rem;
	font-weight: 600;
	color: #fff;
}

.cookie-consent-text {
	margin: 0;
	color: #b8b8c4;
}

.cookie-consent-text a.cookie-consent-link {
	color: #7c9bf2;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cookie-consent-text a.cookie-consent-link:hover {
	color: #9db4f7;
}

.cookie-consent-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.cookie-consent-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.2;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, transform 0.1s;
}

.cookie-consent-btn:focus {
	outline: 2px solid #7c9bf2;
	outline-offset: 2px;
}

.cookie-consent-btn:active {
	transform: scale(0.98);
}

.cookie-consent-btn-primary {
	background: #4a6cf7;
	color: #fff;
}

.cookie-consent-btn-primary:hover {
	background: #3d5ce6;
}

.cookie-consent-btn-secondary {
	background: #2d2d44;
	color: #e8e8e8;
	border: 1px solid #444;
}

.cookie-consent-btn-secondary:hover {
	background: #383852;
	border-color: #555;
}

.cookie-consent-btn-ghost {
	background: transparent;
	color: #a0a0b8;
}

.cookie-consent-btn-ghost:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #e8e8e8;
}

/* ---- Modal ---- */
.cookie-consent-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	pointer-events: none;
	box-sizing: border-box;
}

.cookie-consent-modal[aria-hidden="true"],
.cookie-consent-modal[hidden] {
	display: none;
}

.cookie-consent-modal--open {
	pointer-events: auto;
}

.cookie-consent-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.cookie-consent-modal--open .cookie-consent-modal-backdrop {
	opacity: 1;
}

.cookie-consent-modal-dialog {
	position: relative;
	width: 100%;
	max-width: 400px;
	max-height: 90vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #fff;
	color: #1a1a2e;
	border-radius: 10px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	opacity: 0;
	transform: scale(0.98) translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	box-sizing: border-box;
}

.cookie-consent-modal--open .cookie-consent-modal-dialog {
	opacity: 1;
	transform: scale(1) translateY(0);
}

.cookie-consent-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	padding: 16px 20px;
	border-bottom: 1px solid #eee;
	gap: 12px;
}

.cookie-consent-modal-title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
	color: #1a1a2e;
	line-height: 1.3;
}

.cookie-consent-modal-close {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 6px;
	color: #666;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
	flex-shrink: 0;
}

.cookie-consent-modal-close:hover {
	background: #f0f0f0;
	color: #1a1a2e;
}

.cookie-consent-modal-close:focus {
	outline: 2px solid #4a6cf7;
	outline-offset: 2px;
}

.cookie-consent-modal-close::after {
	content: "\00d7";
	font-size: 20px;
	line-height: 1;
	font-weight: 300;
}

.cookie-consent-modal-body {
	padding: 16px 20px;
	overflow-y: auto;
	flex: 1 1 auto;
	min-height: 0;
}

.cookie-consent-modal-intro {
	margin: 0 0 14px 0;
	color: #555;
	font-size: 13px;
	line-height: 1.4;
}

.cookie-consent-categories {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.cookie-consent-category {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #f0f0f0;
}

.cookie-consent-category:last-child {
	border-bottom: none;
}

.cookie-consent-category-necessary {
	background: transparent;
}

.cookie-consent-category-row {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cookie-consent-category-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 28px;
}

.cookie-consent-category-name {
	font-size: 14px;
	font-weight: 600;
	color: #222;
	cursor: pointer;
	margin: 0;
	line-height: 1.3;
}

.cookie-consent-category-necessary .cookie-consent-category-name {
	cursor: default;
}

.cookie-consent-category-badge {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	color: #666;
	background: #e8e8e8;
	padding: 3px 8px;
	border-radius: 4px;
	flex-shrink: 0;
}

.cookie-consent-category-desc {
	margin: 0;
	font-size: 13px;
	color: #6b7280;
	line-height: 1.5;
	padding-left: 0;
}

/* Toggle - simple switch */
.cookie-consent-toggle {
	width: 40px;
	height: 22px;
	flex-shrink: 0;
	appearance: none;
	-webkit-appearance: none;
	background: #ccc;
	border: none;
	border-radius: 11px;
	cursor: pointer;
	position: relative;
	transition: background 0.2s;
}

.cookie-consent-toggle:focus {
	outline: 2px solid #4a6cf7;
	outline-offset: 2px;
}

.cookie-consent-toggle::after {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	top: 2px;
	left: 2px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
	transition: transform 0.2s;
}

.cookie-consent-toggle:checked {
	background: #4a6cf7;
}

.cookie-consent-toggle:checked::after {
	transform: translateX(18px);
}

.cookie-consent-modal-footer {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	justify-content: stretch;
	gap: 10px;
	padding: 16px 20px;
	border-top: 1px solid #eee;
	flex-shrink: 0;
	background: #fff;
	border-radius: 0 0 10px 10px;
	box-sizing: border-box;
}

.cookie-consent-modal-footer .cookie-consent-btn {
	flex: 1 1 0;
	min-width: 0;
	height: 42px;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 6px;
	text-transform: none;
	letter-spacing: 0;
}

.cookie-consent-modal-footer .cookie-consent-btn-primary {
	background: #4a6cf7;
	color: #fff;
}

.cookie-consent-modal-footer .cookie-consent-btn-secondary {
	background: #444;
	color: #fff;
	border: none;
}

.cookie-consent-modal-footer .cookie-consent-btn-secondary:hover {
	background: #555;
}

/* ---- Modal footer & buttons: ID-based so site CSS cannot override ---- */
#cookie-consent-modal .cookie-consent-modal-dialog {
	display: flex;
	flex-direction: column;
	max-width: 400px;
}

#cookie-consent-modal .cookie-consent-modal-footer {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 10px !important;
	padding: 16px 20px !important;
	margin: 0 !important;
	border-top: 1px solid #eee;
	background: #fff;
	border-radius: 0 0 10px 10px;
	box-sizing: border-box;
}

#cookie-consent-modal .cookie-consent-modal-footer button {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex: 1 1 0% !important;
	min-width: 0 !important;
	width: auto !important;
	height: 42px !important;
	padding: 10px 12px !important;
	margin: 0 !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	border: none !important;
	border-radius: 6px !important;
	cursor: pointer !important;
	box-sizing: border-box !important;
	transition: background-color 0.2s;
}

#cookie-consent-modal #cookie-consent-save {
	background: #4a6cf7 !important;
	color: #fff !important;
}

#cookie-consent-modal #cookie-consent-save:hover {
	background: #3d5ce6 !important;
}

#cookie-consent-modal #cookie-consent-accept-modal {
	background: #444 !important;
	color: #fff !important;
}

#cookie-consent-modal #cookie-consent-accept-modal:hover {
	background: #555 !important;
}

/* Responsive - Customize Settings modal */
@media (max-width: 640px) {
	.cookie-consent-banner-inner {
		padding: 16px;
	}

	.cookie-consent-actions {
		width: 100%;
		justify-content: flex-start;
	}

	.cookie-consent-modal {
		padding: 12px;
		align-items: flex-end;
	}

	.cookie-consent-modal-dialog {
		max-height: 85vh;
		border-radius: 10px 10px 0 0;
	}

	.cookie-consent-modal-header {
		padding: 14px 16px;
	}

	.cookie-consent-modal-title {
		font-size: 1rem;
	}

	.cookie-consent-modal-body {
		padding: 14px 16px;
	}

	.cookie-consent-modal-intro {
		font-size: 12px;
		margin-bottom: 12px;
	}

	.cookie-consent-category {
		padding: 10px 0;
	}

	.cookie-consent-category-name {
		font-size: 13px;
	}

	.cookie-consent-modal-footer {
		padding: 14px 16px;
		gap: 8px;
	}

	.cookie-consent-modal-footer .cookie-consent-btn {
		flex: 1 1 0;
		min-width: 0;
		height: 40px;
	}

	#cookie-consent-modal .cookie-consent-modal-footer {
		padding: 14px 16px !important;
		gap: 8px !important;
	}

	#cookie-consent-modal .cookie-consent-modal-footer button {
		height: 40px !important;
	}
}
