/**
 * Footer navigation column, write CTA, contact layout overrides.
 */

/* LiteSpeed bundle hides lists inside .quick-links — our nav must stay visible. */
footer .leocar-footer-nav .leocar-footer-nav__list,
footer .leocar-footer-nav__block .leocar-footer-nav__list {
	display: flex !important;
}

.leocar-footer-nav .leocar-footer-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
	align-items: flex-start;
	line-height: 1.6;
	gap: clamp(0.65rem, 4vw, 1.25rem);
}

.leocar-footer-nav .leocar-footer-nav__list > li {
	box-sizing: border-box;
	flex: 0 0 calc((100% - clamp(0.65rem, 4vw, 1.25rem)) / 2);
	max-width: calc((100% - clamp(0.65rem, 4vw, 1.25rem)) / 2);
	margin: 0;
	padding: 0 0 0.5rem;
	min-width: 0;
}

.leocar-footer-column--menu .leocar-footer-nav__list {
	flex-direction: column;
	flex-wrap: nowrap;
	gap: 0.25rem;
}

.leocar-footer-column--menu .leocar-footer-nav__list > li {
	flex: none;
	max-width: 100%;
	width: 100%;
	padding-bottom: 0.35rem;
}

.leocar-footer-nav .leocar-footer-nav__list a {
	color: rgba(250 250 250 / 0.88);
	text-decoration: none;
	display: inline-block;
}

.leocar-footer-nav .leocar-footer-nav__list a:hover {
	color: #27ac5b;
}

/* Footer social icons — no layout jump on hover */
footer .mm-social ul.flex {
	gap: 0.625rem;
}

footer .mm-social .leocar-footer-social-link,
footer .mm-social a.block.w-9.h-9 {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem !important;
	height: 2.75rem !important;
	min-width: 2.75rem;
	min-height: 2.75rem;
	box-sizing: border-box;
	border: 1px solid transparent;
	transition: border-color 0.15s ease;
}

footer .mm-social .leocar-footer-social-link:hover,
footer .mm-social a.block.w-9.h-9:hover {
	border-color: #fff;
}

footer .mm-social .leocar-footer-social-link img,
footer .mm-social a.block.w-9.h-9 img {
	display: block;
	width: 1.75rem;
	height: 1.75rem;
	margin: 0;
	object-fit: contain;
}

/* “Написати нам” — label above button */
footer .leocar-footer-write {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
}

footer .leocar-footer-write > span {
	display: block;
	width: 100%;
}

/* “Написати” CTA */
.leocar-footer-write-btn {
	display: inline-flex;
	min-height: 44px;
	padding: 0.65rem 1.35rem;
	border-radius: 4px;
	background: #27ac5b;
	color: #0f0f0f;
	font-weight: 700;
	font-size: 0.875rem;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
	letter-spacing: 0;
	transition: background 0.2s ease, color 0.2s ease;
	margin-top: 0.625rem;
}

.leocar-footer-write-btn:hover {
	background: #2fc468;
	color: #0f0f0f;
}

/* Footer credit */
a.leocar-paxfeld {
	text-decoration: none;
}

a.leocar-paxfeld:hover .font-700 {
	color: #27ac5b;
}

/* Contact + address row — separate columns, no overlap */
footer .leocar-footer-columns > .leocar-footer-column {
	min-width: 0;
	box-sizing: border-box;
}

footer .leocar-footer-column > span.uppercase {
	display: block;
}

footer .mm-contact {
	margin: 0;
	padding: 0;
	list-style: none;
}

footer .mm-contact li {
	min-width: 0;
}

footer .mm-contact a {
	min-width: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
	word-break: break-word;
}

footer .leocar-footer-address {
	position: relative;
	z-index: 0;
	max-width: 100%;
	word-break: break-word;
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin-left: 0;
	padding-left: 0 !important;
	text-align: left;
	background: none !important;
}

footer .leocar-footer-address::before {
	content: '';
	flex-shrink: 0;
	width: 11px;
	height: 14px;
	margin-top: 0.2em;
	background: url('../images/theme/svg/pin-green.svg') no-repeat center / contain;
}

footer .leocar-footer-address p {
	margin: 0;
	padding: 0;
	flex: 1;
	min-width: 0;
	text-align: left !important;
}

footer .leocar-footer-address a {
	color: rgba(250 250 250 / 0.88);
	text-decoration: none;
	display: inline;
	text-align: left;
}

footer .leocar-footer-address a:hover {
	color: #27ac5b;
}

footer .leo-social {
	gap: clamp(0.75rem, 4vw, 1.5rem);
	align-items: flex-start;
}

/* Fallback when column classes not yet in cached HTML */
@media (min-width: 1024px) {
	footer .flex.flex-wrap.1024\:mt-8.1024\:flex-nowrap:has(.mm-contact):not(.leocar-footer-columns) {
		display: grid;
		grid-template-columns: minmax(180px, 260px) minmax(180px, 280px);
		column-gap: clamp(40px, 5vw, 96px);
		align-items: start;
		width: 100%;
	}

	footer .flex.flex-wrap.1024\:mt-8.1024\:flex-nowrap:has(.mm-contact):not(.leocar-footer-columns) > .w-full {
		width: auto !important;
		max-width: none;
		flex: none !important;
		min-width: 0;
		margin-top: 0 !important;
	}
}

@media (max-width: 1023px) {
	footer .leocar-footer-contact--desktop {
		display: none !important;
	}

	/* Mobile/tablet: Follow Us full width, then Contact Us | Message Us in one row */
	footer .leo-social {
		display: flex !important;
		flex-wrap: wrap !important;
		align-items: flex-start;
		column-gap: clamp(0.75rem, 4vw, 1.5rem);
		row-gap: 1.5rem;
	}

	footer .leo-social > .w-1\/2:first-child {
		flex: 0 0 100%;
		max-width: 100%;
		width: 100% !important;
		margin-top: 0 !important;
	}

	footer .leocar-footer-contact--mobile {
		flex: 0 0 calc(50% - clamp(0.375rem, 2vw, 0.75rem));
		max-width: calc(50% - clamp(0.375rem, 2vw, 0.75rem));
		margin-top: 0 !important;
		min-width: 0;
		box-sizing: border-box;
	}

	footer .leo-social > .leocar-footer-write {
		flex: 0 0 calc(50% - clamp(0.375rem, 2vw, 0.75rem));
		max-width: calc(50% - clamp(0.375rem, 2vw, 0.75rem));
		margin-top: 0 !important;
		min-width: 0;
		box-sizing: border-box;
	}

	footer .leocar-footer-columns {
		display: flex;
		flex-wrap: wrap;
		width: 100%;
	}

	footer .leocar-footer-columns > .leocar-footer-column--address,
	footer :has(> .leocar-footer-columns) > .leocar-footer-nav {
		flex: 0 0 100%;
		max-width: 100%;
	}

	footer .flex.flex-wrap.1024\:mt-8.1024\:flex-nowrap > .w-full.mt-9,
	footer .flex.flex-wrap.1024\:flex-nowrap > .w-full.mt-6 {
		margin-top: 1.5rem;
	}
}

@media (min-width: 1024px) {
	footer .leocar-footer-contact--mobile {
		display: none !important;
	}

	.leocar-footer-nav .leocar-footer-nav__list > li {
		padding-bottom: 0.65rem;
	}

	/* Desktop: Social (+ write) | Menu | Контакти | Адреса */
	footer :has(> .leocar-footer-columns) {
		display: grid !important;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		column-gap: clamp(1.5rem, 3vw, 3.5rem);
		align-items: start;
		width: 100%;
		flex-wrap: nowrap !important;
	}

	footer :has(> .leocar-footer-columns) > .leo-social,
	footer :has(> .leocar-footer-columns) > .leocar-footer-nav,
	footer :has(> .leocar-footer-columns) > .leocar-footer-columns {
		margin-top: 0 !important;
		max-width: none;
		min-width: 0;
	}

	footer :has(> .leocar-footer-columns) > .leo-social {
		grid-column: 1;
		width: 100% !important;
		max-width: none;
		flex: none !important;
		display: flex !important;
		flex-direction: column;
		flex-wrap: nowrap !important;
		align-items: flex-start;
	}

	footer :has(> .leocar-footer-columns) > .leocar-footer-nav {
		grid-column: 2;
		width: 100% !important;
		max-width: none;
		flex: none !important;
	}

	footer :has(> .leocar-footer-columns) > .leo-social > .w-1\/2,
	footer :has(> .leocar-footer-columns) > .leo-social > .leocar-footer-write {
		width: 100% !important;
		max-width: none;
		flex: none !important;
		margin-top: 0 !important;
	}

	footer :has(> .leocar-footer-columns) > .leo-social > .leocar-footer-write {
		margin-top: 1.25rem !important;
	}

	footer :has(> .leocar-footer-columns) > .leocar-footer-columns {
		display: grid !important;
		grid-column: 3 / -1;
		grid-template-columns: subgrid;
		width: 100% !important;
		flex: none !important;
		flex-wrap: nowrap !important;
	}

	footer :has(> .leocar-footer-columns) > .leocar-footer-columns > .leocar-footer-column {
		width: 100% !important;
		max-width: none;
		flex: none !important;
		margin-top: 0 !important;
		min-width: 0;
	}

	footer :has(> .leocar-footer-columns) > .leocar-footer-columns > .leocar-footer-column--contact {
		grid-column: 1;
	}

	footer :has(> .leocar-footer-columns) > .leocar-footer-columns > .leocar-footer-column--address {
		grid-column: 2;
	}

	footer .leocar-footer-address {
		max-width: 100%;
	}

	footer .payment-svg {
		margin-left: 0 !important;
	}
}

@media (min-width: 1100px) {
	footer :has(> .leocar-footer-columns) {
		column-gap: clamp(2.5rem, 5vw, 5.5rem);
	}
}

/* Footer legal bar — full viewport width (break out of centered .container) */
footer .leocar-footer-legal-bar {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	box-sizing: border-box;
}

footer .leocar-footer-legal-bar > .container {
	max-width: none;
	width: 100%;
	padding-left: clamp(1rem, 3vw, 2.5rem);
	padding-right: clamp(1rem, 3vw, 2.5rem);
	box-sizing: border-box;
}

@media (max-width: 1023px) {
	footer {
		border-top-left-radius: 1.25rem;
		border-top-right-radius: 1.25rem;
		overflow: hidden;
	}

	footer .leocar-footer-legal-bar,
	footer .container > .bg-black.mt-9 {
		border-top-left-radius: 1.25rem;
		border-top-right-radius: 1.25rem;
		overflow: hidden;
	}
}

/* -------------------------------------------------------------------------
 * Mobile burger menu — panel UX (subtitles, chevrons, CTA)
 * ------------------------------------------------------------------------- */
@media (max-width: 1099px) {
	header .leocar-mobile-menu {
		z-index: 100;
		display: flex;
		flex-direction: column;
		min-height: 0;
		max-height: 100svh;
		max-height: 100dvh;
		overflow: hidden;
	}

	body.menu-open header .leocar-mobile-menu {
		visibility: visible;
		opacity: 1;
		overflow: hidden !important;
	}

	header .leocar-mobile-menu > .relative {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		min-height: 0;
		max-height: 100%;
		height: 0;
		overflow: hidden;
		position: relative;
		padding-top: 0 !important;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		border: none;
		border-radius: 6px;
		background: rgb(39 172 91);
		color: #fafafa;
		cursor: pointer;
		flex-shrink: 0;
		box-shadow: 0 2px 10px rgb(0 0 0 / 0.28);
		transition:
			background-color 0.18s ease,
			transform 0.12s ease;
		-webkit-appearance: none;
		appearance: none;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__close:hover,
	header .leocar-mobile-menu .leocar-mobile-menu__close:focus-visible {
		background: rgb(48 188 102);
	}

	header .leocar-mobile-menu .leocar-mobile-menu__close:active {
		transform: scale(0.96);
	}

	header .leocar-mobile-menu .leocar-mobile-menu__close:focus-visible {
		outline: 2px solid rgb(250 250 250 / 0.75);
		outline-offset: 2px;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__close-icon {
		display: flex;
		align-items: center;
		justify-content: center;
		line-height: 0;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__close-icon svg {
		display: block;
	}

	header .leocar-mobile-menu .container.pt-\[0px\] {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		min-height: 0;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
		padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
	}

	header .leocar-mobile-menu .leocar-mobile-menu__top-wrap {
		flex-shrink: 0;
		padding: 0 1.5rem;
		background-color: rgb(15 15 15);
	}

	header .leocar-mobile-menu .leocar-mobile-menu__top-bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
		padding: 0.75rem 0 1rem;
		border-bottom: 1px solid rgb(250 250 250 / 0.12);
	}

	header .leocar-mobile-menu .leocar-mobile-menu__logo-link {
		display: block;
		flex: 1 1 auto;
		min-width: 0;
		height: 55px;
		max-width: 207px;
		line-height: 0;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__logo {
		display: block;
		height: 100%;
		width: auto;
		max-width: 100%;
		object-fit: contain;
		object-position: left center;
	}

	.leocar-mobile-menu__header {
		margin-bottom: 1.25rem;
		padding-top: 1rem;
		padding-bottom: 1rem;
		border-bottom: 1px solid rgb(250 250 250 / 0.12);
	}

	.leocar-mobile-menu__title {
		margin: 0;
		font-size: 1.5rem;
		font-weight: 700;
		line-height: 1.2;
		color: #fafafa;
	}

	.leocar-mobile-menu__list {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	/* LiteSpeed bundle sets `.mobile-main .menu-item a { display: block }` — override for row layout. */
	header .leocar-mobile-menu .mobile-main.leocar-mobile-menu__list > .leocar-mobile-menu__item {
		margin: 0;
	}

	header .leocar-mobile-menu .mobile-main.leocar-mobile-menu__list > .leocar-mobile-menu__item:nth-child(odd) .leocar-mobile-menu__link {
		background-color: transparent;
	}

	header .leocar-mobile-menu .mobile-main.leocar-mobile-menu__list > .leocar-mobile-menu__item:nth-child(even) .leocar-mobile-menu__link {
		background-color: rgb(255 255 255 / 0.035);
	}

	header .leocar-mobile-menu .mobile-main .menu-item .leocar-mobile-menu__link,
	header .leocar-mobile-menu .leocar-mobile-menu__item > .leocar-mobile-menu__link {
		display: flex !important;
		flex-direction: row !important;
		align-items: center !important;
		justify-content: space-between !important;
		gap: 16px !important;
		width: 100% !important;
		box-sizing: border-box;
		padding: 1rem 0.75rem;
		min-height: 3.5rem;
		color: #fafafa;
		text-decoration: none;
		transition:
			color 0.15s ease,
			background-color 0.15s ease;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__link:hover,
	header .leocar-mobile-menu .leocar-mobile-menu__link:focus-visible {
		color: #27ac5b;
		background-color: rgb(39 172 91 / 0.08) !important;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__link:focus-visible {
		outline: 2px solid #27ac5b;
		outline-offset: -2px;
		border-radius: 4px;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__text {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		justify-content: center;
		gap: 0.2rem;
		min-width: 0;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__label {
		display: block;
		font-size: 1.0625rem;
		font-weight: 600;
		line-height: 1.3;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__subtitle {
		display: block;
		font-size: 0.8125rem;
		font-weight: 400;
		line-height: 1.35;
		color: rgb(250 250 250 / 0.55);
		overflow: hidden;
		text-overflow: ellipsis;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__link:hover .leocar-mobile-menu__subtitle,
	header .leocar-mobile-menu .leocar-mobile-menu__link:focus-visible .leocar-mobile-menu__subtitle {
		color: rgb(39 172 91 / 0.85);
	}

	header .leocar-mobile-menu .leocar-mobile-menu__chevron {
		display: flex !important;
		flex-shrink: 0;
		align-items: center;
		align-self: center;
		justify-content: center;
		margin-left: auto;
		width: 1.5rem;
		height: 1.5rem;
		color: #27ac5b;
		opacity: 0.9;
		transition: transform 0.15s ease, opacity 0.15s ease;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__chevron svg {
		display: block;
		width: 8px;
		height: 14px;
	}

	header .leocar-mobile-menu .leocar-mobile-menu__link:hover .leocar-mobile-menu__chevron,
	header .leocar-mobile-menu .leocar-mobile-menu__link:focus-visible .leocar-mobile-menu__chevron {
		opacity: 1;
		transform: translateX(3px);
	}

	.leocar-mobile-menu__footer {
		margin-top: auto;
		padding-top: 1.25rem;
		border-top: 1px solid rgb(250 250 250 / 0.12);
	}

	.leocar-mobile-menu__cta-call {
		display: flex;
		flex-direction: column;
		gap: 0.15rem;
		padding: 0.875rem 1rem;
		border-radius: 10px;
		background: rgb(39 172 91 / 0.15);
		border: 1px solid rgb(39 172 91 / 0.45);
		color: #fafafa;
		text-decoration: none;
		transition: background-color 0.15s ease, border-color 0.15s ease;
	}

	.leocar-mobile-menu__cta-call:hover,
	.leocar-mobile-menu__cta-call:focus-visible {
		background: rgb(39 172 91 / 0.28);
		border-color: #27ac5b;
	}

	.leocar-mobile-menu__cta-label {
		font-size: 0.75rem;
		font-weight: 600;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: #27ac5b;
	}

	.leocar-mobile-menu__cta-value {
		font-size: 1.125rem;
		font-weight: 700;
		line-height: 1.2;
	}

	.leocar-mobile-menu__address {
		margin: 0.75rem 0 0;
		font-size: 0.8125rem;
		line-height: 1.45;
		color: rgb(250 250 250 / 0.55);
	}
}
