/* Montaha Cookie Consent - Frontend Styles */

:root {
	--mcc-primary: #000000;
	--mcc-bg: #ffffff;
	--mcc-text: #333333;
	--mcc-border: #e2e8f0;
}

#mcc-banner {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background-color: var(--mcc-bg);
	color: var(--mcc-text);
	box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
	padding: 1rem 2rem;
	z-index: 99999;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	font-family: system-ui, -apple-system, sans-serif;
	box-sizing: border-box;
}

#mcc-banner .mcc-content {
	flex: 1 1 300px;
}

#mcc-banner .mcc-content p {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.5;
}

#mcc-banner .mcc-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.mcc-btn {
	padding: 0.5rem 1rem;
	border-radius: 4px;
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	border: none;
	transition: opacity 0.2s;
}

.mcc-btn:hover {
	opacity: 0.8;
}

.mcc-btn-primary {
	background-color: var(--mcc-primary);
	color: #fff;
}

.mcc-btn-secondary {
	background-color: transparent;
	color: var(--mcc-text);
	border: 1px solid var(--mcc-border);
}

.mcc-btn-text {
	background-color: transparent;
	color: var(--mcc-primary);
	text-decoration: underline;
	padding: 0.5rem;
}

/* Modal */
#mcc-preferences-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.5);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: system-ui, -apple-system, sans-serif;
}

.mcc-modal-content {
	background: var(--mcc-bg);
	color: var(--mcc-text);
	padding: 2.5rem 3rem;
	border-radius: 4px;
	width: 92%;
	max-width: 880px;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
	box-sizing: border-box;
}

.mcc-modal-content h2 {
	font-family: "Playfair Display", Georgia, serif;
	font-weight: 400;
	font-size: 2rem;
	margin-top: 0;
	margin-bottom: 0.75rem;
	color: #4A2E35;
}

.mcc-modal-intro {
	margin: 0 0 1.75rem;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--mcc-text);
	opacity: 0.85;
}

.mcc-close-btn {
	position: absolute;
	top: 1.1rem;
	right: 1.1rem;
	background: none;
	border: none;
	cursor: pointer;
	background-color: var(--mcc-bg) !important;
	color: var(--mcc-primary) !important;
	border: 1px solid var(--mcc-border, #DCD3C4) !important;
	padding: 0;
	display: flex;
}

.mcc-close-btn:hover {
	background-color: transparent;
	opacity: 0.7;
}

.mcc-preference-category {
	border-bottom: 1px solid var(--mcc-border);
}

.mcc-preference-category:last-of-type {
	margin-bottom: 2rem;
}

.mcc-category-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 0;
}

.mcc-category-toggle {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	text-align: left;
	color: inherit;
	font: inherit;
}

.mcc-category-toggle:hover {
	background-color: transparent;
}

.mcc-category-toggle:hover .mcc-label-text {
	opacity: 0.75;
}

.mcc-chevron {
	flex-shrink: 0;
	stroke: var(--mcc-primary);
	transition: transform 0.2s ease;
}

.mcc-preference-category.is-open .mcc-chevron {
	transform: rotate(90deg);
}

.mcc-label-text {
	font-size: 1.1rem;
	font-weight: 500;
	color: var(--mcc-text);
}

.mcc-always-active {
	font-size: 0.85rem;
	font-weight: 600;
	color: #8FA382;
	white-space: nowrap;
}

/* Toggle switch (Analytics / Marketing) */
.mcc-toggle-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex-shrink: 0;
	cursor: pointer;
}

.mcc-toggle-switch input {
	position: absolute;
	opacity: 0;
	height: 0;
	width: 0;
}

.mcc-toggle-slider {
	position: absolute;
	inset: 0;
	background-color: #DCD3C4;
	border-radius: 999px;
	transition: background-color 0.2s;
}

.mcc-toggle-slider::before {
	content: "";
	position: absolute;
	height: 18px;
	width: 18px;
	left: 3px;
	top: 3px;
	background-color: #fff;
	border-radius: 50%;
	transition: transform 0.2s;
}

.mcc-toggle-switch input:checked ~ .mcc-toggle-slider {
	background-color: var(--mcc-primary);
}

.mcc-toggle-switch input:checked ~ .mcc-toggle-slider::before {
	transform: translateX(20px);
}

/* Accordion body: grid-rows trick animates height without JS measuring it */
.mcc-category-body-wrapper {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.25s ease;
}

.mcc-preference-category.is-open .mcc-category-body-wrapper {
	grid-template-rows: 1fr;
}

.mcc-category-body {
	overflow: hidden;
	min-height: 0;
}

.mcc-category-body p {
	margin: 0 0 0.75rem;
	font-size: 0.9rem;
	color: var(--mcc-text);
	opacity: 0.8;
}

.mcc-category-body {
	padding-bottom: 1.25rem;
}

.mcc-cookie-list-heading {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.85rem;
}

.mcc-cookie-table {
	width: 100%;
	text-align: left;
	border-collapse: collapse;
	font-size: 0.85rem;
}

.mcc-cookie-table th {
	padding-bottom: 5px;
	border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.mcc-cookie-table td {
	padding: 5px 0;
	border-bottom: 1px solid rgba(0, 0, 0, .05);
}

#mcc-save-prefs {
	background-color: var(--mcc-primary);
	color: var(--mcc-bg);
	font-weight: 600;
	padding: 1rem 1.5rem;
	font-size: 1rem;
	border-radius: 4px;
	border: 1px solid var(--mcc-primary);
	cursor: pointer;
	margin-top: 1.5rem;
}
#mcc-save-prefs:hover {
	opacity: 0.8;
}

@media screen and (max-width: 600px) {
	.mcc-modal-content {
		padding: 2rem 1.5rem;
		max-height: 85vh;
	}

	.mcc-modal-content h2 {
		font-size: 1.6rem;
	}
}

/* Revisit Button (Matches Back to Top Button) */
.mcc-revisit-btn {
	position: fixed !important;
	bottom: 25px !important;
	left: 25px !important;
	background-color: var(--mcc-bg) !important;
	color: var(--mcc-primary) !important;
	border: 1px solid var(--mcc-border, #DCD3C4) !important;
	border-radius: 50% !important;
	width: 44px !important;
	height: 44px !important;
	padding: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	/* Hidden until consent exists. This was `display: flex !important`, which
	   overrode the inline style="display:none" in the markup and the JS toggle,
	   so the button was permanently visible — including alongside the banner
	   before any choice had been made. Visibility is class-driven now; the
	   !important stays because the theme's CSS is aggressive. */
	display: none !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	z-index: 99998 !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
	transition: background-color 0.25s, border-color 0.25s, color 0.25s !important;
	box-sizing: border-box !important;
}

.mcc-revisit-btn.is-visible {
	display: flex !important;
}

/* Focus indicator (WCAG 2.4.7).
   Everything else here is !important to survive the theme, so leaving focus to
   the browser default would be the one thing a theme could still suppress.
   :focus-visible so pointer users do not see a ring on click. */
#mcc-banner button:focus-visible,
#mcc-preferences-modal button:focus-visible,
#mcc-preferences-modal input[type="checkbox"]:focus-visible,
.mcc-revisit-btn:focus-visible,
.mcc-iframe-consent-btn:focus-visible {
	outline: 3px solid var(--mcc-primary, #4A2E35) !important;
	outline-offset: 2px !important;
	/* Light halo so the ring stays visible on a dark control too. */
	box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.9) !important;
}

.mcc-revisit-btn:hover {
	background-color: var(--mcc-primary) !important;
	border-color: var(--mcc-primary) !important;
	color: var(--mcc-bg) !important;
}

.mcc-revisit-btn svg {
	width: 20px !important;
	height: 20px !important;
	display: block !important;
	margin: 0 !important;
}

/* --- IFRAME CONSENT PLACEHOLDER --- */
.mcc-iframe-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0ece6;
	border: 1px solid #DCD3C4;
	border-radius: 4px;
	min-height: 200px;
	padding: 20px;
	box-sizing: border-box;
}

.mcc-iframe-notice {
	text-align: center;
	font-size: 14px;
	color: #4A2E35;
	margin: 0;
	line-height: 1.6;
}

.mcc-iframe-consent-btn {
	display: inline-block;
	margin-top: 10px;
	padding: 8px 18px;
	background-color: var(--mcc-primary, #4A2E35);
	color: #ffffff;
	border: none;
	border-radius: 3px;
	font-size: 13px;
	cursor: pointer;
	font-family: inherit;
	transition: opacity 0.2s;
}

.mcc-iframe-consent-btn:hover {
	opacity: 0.85;
}
