/*
 * Cookie consent banner + privacy preferences dialog. Figma NdcwLxoPTX756JayKGOtUO, page
 * "08 עוגיות / הסכמה והעדפות": banner 154:77 (360), 154:193 (390), 154:309 (768), 154:429 (1440),
 * 154:549 (1920); dialog 154:265 (390), 154:385 (768), 154:505 (1440); switches 154:76; save error
 * 154:713; saved toast 156:504. Breakpoints follow the site: mobile <= 767, desktop >= 768.
 */

.ta-consent {
	--ta-consent-ink: #292566;
	--ta-consent-text: #53516c;
	--ta-consent-accent: #0062fe;
	--ta-consent-accent-hover: #0054d9;
	--ta-consent-border: #dedfe6;
	--ta-consent-surface: #ffffff;
	--ta-consent-soft: #fafafc;
	--ta-consent-card: #f3f6ff;
	--ta-consent-backdrop: rgba(23, 20, 48, 0.46);
	--ta-consent-shadow: 0 16px 24px rgba(13, 10, 41, 0.18);
	--ta-consent-font-head: Alef, sans-serif;
	--ta-consent-font-body: Heebo, sans-serif;
	--ta-consent-gutter: 16px;
	--ta-consent-z: 99975;

	font-family: var(--ta-consent-font-body);
	color: var(--ta-consent-text);
	direction: rtl;
	text-align: right;
}

.ta-consent *,
.ta-consent *::before,
.ta-consent *::after {
	box-sizing: border-box;
}

.ta-consent [hidden] {
	display: none !important;
}

/* ------------------------------------------------------------------ */
/* Shared pieces: pill buttons, text links, switches                    */
/* ------------------------------------------------------------------ */

.ta-consent .ta-consent__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 0 12px;
	margin: 0;
	border-radius: 25px;
	border: 1px solid transparent;
	font-family: var(--ta-consent-font-head);
	font-weight: 700;
	font-size: 16px;
	line-height: 20px;
	text-align: center;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ta-consent .ta-consent__btn--primary {
	background: var(--ta-consent-accent);
	border-color: var(--ta-consent-accent);
	color: #fff;
}

.ta-consent .ta-consent__btn--primary:hover,
.ta-consent .ta-consent__btn--primary:focus {
	background-color: var(--ta-consent-accent-hover);
	border-color: var(--ta-consent-accent-hover);
	color: #fff;
}

.ta-consent .ta-consent__btn--secondary {
	background: var(--ta-consent-surface);
	border-color: var(--ta-consent-ink);
	color: var(--ta-consent-ink);
}

.ta-consent .ta-consent__btn--secondary:hover,
.ta-consent .ta-consent__btn--secondary:focus {
	background-color: var(--ta-consent-card);
	color: var(--ta-consent-ink);
}

.ta-consent .ta-consent__btn--block {
	width: 100%;
}

.ta-consent .ta-consent__btn:focus-visible,
.ta-consent .ta-consent__link:focus-visible,
.ta-consent .ta-consent__close:focus-visible {
	outline: 2px solid var(--ta-consent-ink);
	outline-offset: 3px;
}

.ta-consent .ta-consent__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font-family: var(--ta-consent-font-body);
	font-weight: 400;
	font-size: 13px;
	line-height: 20px;
	color: var(--ta-consent-ink);
	text-decoration: underline;
	text-underline-position: from-font;
	text-align: center;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ta-consent .ta-consent__link:hover,
.ta-consent .ta-consent__link:focus {
	background: none;
	color: var(--ta-consent-accent);
}

.ta-consent .ta-consent__switch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 52px;
	width: 52px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ta-consent .ta-consent__switch:hover,
.ta-consent .ta-consent__switch:focus {
	background: none;
}

.ta-consent__switch-track {
	position: relative;
	display: block;
	width: 48px;
	height: 28px;
	border-radius: 14px;
	background: var(--ta-consent-border);
	transition: background-color 0.15s ease;
}

.ta-consent__switch-thumb {
	position: absolute;
	top: 4px;
	left: 4px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.15s ease;
}

.ta-consent .ta-consent__switch[aria-checked="true"] .ta-consent__switch-track {
	background: var(--ta-consent-accent);
}

.ta-consent .ta-consent__switch[aria-checked="true"] .ta-consent__switch-thumb {
	transform: translateX(20px);
}

.ta-consent .ta-consent__switch:focus-visible {
	outline: none;
}

.ta-consent .ta-consent__switch:focus-visible .ta-consent__switch-track {
	box-shadow: 0 0 0 2px var(--ta-consent-ink);
}

/* ------------------------------------------------------------------ */
/* Banner (non-modal, bottom of the viewport)                           */
/* ------------------------------------------------------------------ */

.ta-consent__banner {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: var(--ta-consent-z);
	display: flex;
	justify-content: center;
	padding: 0 var(--ta-consent-gutter) calc(var(--ta-consent-gutter) + env(safe-area-inset-bottom, 0px));
	pointer-events: none;
}

.ta-consent__card {
	pointer-events: auto;
	width: 100%;
	max-width: 1140px;
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 20px;
	border: 1px solid var(--ta-consent-border);
	border-radius: 24px;
	background: var(--ta-consent-surface);
	box-shadow: var(--ta-consent-shadow);
}

.ta-consent__content {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

.ta-consent__title {
	margin: 0;
	font-family: var(--ta-consent-font-head);
	font-weight: 700;
	font-size: 26px;
	line-height: 33px;
	color: var(--ta-consent-ink);
}

.ta-consent__text {
	margin: 0;
	font-size: 14px;
	line-height: 22px;
	color: var(--ta-consent-text);
}

.ta-consent__helper {
	margin: 0;
	font-size: 12px;
	line-height: 19px;
	color: var(--ta-consent-text);
}

.ta-consent__actions {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ta-consent__choices {
	display: flex;
	gap: 8px;
}

.ta-consent__choices .ta-consent__btn {
	flex: 1 1 0;
	min-width: 0;
}

.ta-consent .ta-consent__text-desktop,
.ta-consent .ta-consent__link--desktop {
	display: none;
}

@media (min-width: 768px) {
	.ta-consent {
		--ta-consent-gutter: 24px;
	}

	.ta-consent__card {
		flex-direction: row;
		align-items: center;
		gap: 28px;
		padding: 28px;
	}

	.ta-consent__content {
		flex: 1 1 auto;
		gap: 6px;
	}

	.ta-consent__title {
		font-size: 30px;
		line-height: 38px;
	}

	.ta-consent__actions {
		flex: 0 0 360px;
		width: 360px;
		gap: 4px;
	}

	.ta-consent__choices {
		gap: 12px;
	}

	.ta-consent .ta-consent__text-desktop {
		display: inline;
	}

	.ta-consent .ta-consent__link--desktop {
		display: flex;
	}

	.ta-consent .ta-consent__text-mobile,
	.ta-consent .ta-consent__link--mobile {
		display: none;
	}
}

/* ------------------------------------------------------------------ */
/* Preferences dialog (modal)                                           */
/* ------------------------------------------------------------------ */

.ta-consent__backdrop {
	position: fixed;
	inset: 0;
	z-index: calc(var(--ta-consent-z) + 5);
	background: var(--ta-consent-backdrop);
}

.ta-consent__dialog {
	position: fixed;
	inset: 0;
	z-index: calc(var(--ta-consent-z) + 10);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	outline: none;
}

.ta-consent__dialog-card {
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: calc(100vw - 32px);
	max-width: 640px;
	max-height: calc(100dvh - 32px - env(safe-area-inset-bottom, 0px));
	padding: 20px;
	border: 1px solid var(--ta-consent-border);
	border-radius: 24px;
	background: var(--ta-consent-surface);
	box-shadow: var(--ta-consent-shadow);
	overflow: hidden;
}

.ta-consent__dialog-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex: 0 0 auto;
}

.ta-consent__dialog-title {
	flex: 1 1 auto;
	margin: 0;
	font-family: var(--ta-consent-font-head);
	font-weight: 700;
	font-size: 26px;
	line-height: 33px;
	color: var(--ta-consent-ink);
}

.ta-consent .ta-consent__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 22px;
	background: var(--ta-consent-soft);
	color: var(--ta-consent-ink);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ta-consent .ta-consent__close:hover,
.ta-consent .ta-consent__close:focus {
	background-color: var(--ta-consent-card);
	color: var(--ta-consent-ink);
}

.ta-consent .ta-consent__close svg {
	width: 20px;
	height: 20px;
	display: block;
}

.ta-consent__dialog > .ta-consent__dialog-card > .ta-consent__text {
	flex: 0 0 auto;
}

.ta-consent__categories {
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.ta-consent__cat {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px;
	border: 1px solid var(--ta-consent-border);
	border-radius: 16px;
	background: var(--ta-consent-surface);
}

.ta-consent__cat--essential {
	border-color: var(--ta-consent-card);
	background: var(--ta-consent-card);
}

.ta-consent__cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 44px;
}

.ta-consent__cat--essential .ta-consent__cat-head {
	min-height: 23px;
}

.ta-consent__cat-title {
	flex: 1 1 auto;
	margin: 0;
	font-family: var(--ta-consent-font-head);
	font-weight: 700;
	font-size: 18px;
	line-height: 23px;
	color: var(--ta-consent-ink);
}

.ta-consent__always {
	flex: 0 0 auto;
	font-size: 12px;
	line-height: 19px;
	color: var(--ta-consent-ink);
}

.ta-consent__cat-desc {
	margin: 0;
	font-size: 13px;
	line-height: 20px;
	color: var(--ta-consent-text);
}

.ta-consent__dialog-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 0 0 auto;
}

.ta-consent__error {
	margin: 0;
	font-family: var(--ta-consent-font-head);
	font-weight: 700;
	font-size: 14px;
	line-height: 18px;
	color: var(--ta-consent-ink);
}

@media (min-width: 768px) {
	.ta-consent__dialog-card {
		padding: 32px;
	}

	.ta-consent__dialog-title {
		font-size: 30px;
		line-height: 38px;
	}
}

/* Short viewports (landscape phones): tighter rhythm, the intro becomes screen-reader-only and the
   policy link row is dropped (it is also in the banner and the footer), so the category list keeps
   a usable height and the actions stay reachable. */
@media (max-height: 560px) {
	.ta-consent__dialog-card {
		gap: 10px;
		padding: 16px;
	}

	.ta-consent__dialog-title {
		font-size: 22px;
		line-height: 28px;
	}

	.ta-consent__dialog > .ta-consent__dialog-card > .ta-consent__text {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	.ta-consent__dialog-actions {
		gap: 6px;
	}

	.ta-consent .ta-consent__dialog-actions .ta-consent__btn {
		min-height: 44px;
	}

	.ta-consent .ta-consent__dialog-actions .ta-consent__link--policy {
		display: none;
	}
}

/* ------------------------------------------------------------------ */
/* Saved toast                                                          */
/* ------------------------------------------------------------------ */

.ta-consent__toast {
	position: fixed;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	left: 50%;
	z-index: calc(var(--ta-consent-z) + 11);
	width: calc(100vw - 32px);
	max-width: 358px;
	padding: 16px 20px;
	border-radius: 16px;
	background: var(--ta-consent-ink);
	color: #fff;
	font-size: 14px;
	line-height: 1.3;
	text-align: center;
	opacity: 0;
	transform: translate(-50%, 8px);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.ta-consent__toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ------------------------------------------------------------------ */
/* Page-level hooks                                                     */
/* ------------------------------------------------------------------ */

/* Scroll lock while the dialog is open (same approach as the consultation popup). */
body.ta-consent-lock {
	position: fixed;
	inset-inline: 0;
	width: 100%;
	overflow: hidden;
}

/* While the banner is visible, the footer template's floating phone/WhatsApp icons move up by the
   banner's height (set by consent.js) so the two never overlap, and the accessibility tab moves to
   the middle of the space that is left above the banner. */
html.ta-consent-banner-open .elementor-location-footer .elementor-widget-icon.elementor-fixed {
	transform: translateY(calc(-1 * var(--ta-consent-banner-h, 0px)));
	transition: transform 0.2s ease;
}

html.ta-consent-banner-open .ta-a11y__trigger {
	top: max(96px, calc((100vh - var(--ta-consent-banner-h, 0px)) / 2));
	transition: top 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
	.ta-consent__btn,
	.ta-consent__switch-track,
	.ta-consent__switch-thumb,
	.ta-consent__toast,
	html.ta-consent-banner-open .elementor-location-footer .elementor-widget-icon.elementor-fixed,
	html.ta-consent-banner-open .ta-a11y__trigger {
		transition: none;
	}
}
