/**
 * Подвал сайта.
 *
 * Логика подвала крупных маркетплейсов, собранная в один слой:
 *   «наверх» → чипы доверия → блок продавцам → карта сайта → правовая строка.
 * Цвета — тёмный фирменный (--ms-accent + #0e2427), поэтому подвал читается
 * как часть сайта, а не как «ещё один блок».
 *
 * Данные — inc/ms-footer.php, разметка — footer.php.
 */

/* Плавный переход по «Наверх» (и по внутренним ссылкам вообще) ---------------- */
html {
	scroll-behavior: smooth;
}

.ms-footer {
	margin-top: 48px;
	color: rgba(255, 255, 255, .78);
	font-size: 14px;
	line-height: 1.55;
	background:
		radial-gradient(900px 240px at 12% -10%, rgba(40, 175, 177, .18), transparent 62%),
		linear-gradient(180deg, #0e2427 0%, #102a2e 58%, #0b1e21 100%);
}

.ms-footer *,
.ms-footer *::before,
.ms-footer *::after {
	box-sizing: border-box;
}

.ms-footer a {
	color: inherit;
}

.ms-footer a:focus-visible,
.ms-footer button:focus-visible {
	outline: 2px solid var(--ms-accent);
	outline-offset: 3px;
	border-radius: 6px;
}

/* «Наверх» — полоса как у Amazon: работает и как кнопка, и как ориентир ------- */
.ms-footer__to-top {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 16px;
	border-bottom: 1px solid rgba(255, 255, 255, .1);
	color: rgba(255, 255, 255, .74);
	font-size: 13.5px;
	letter-spacing: .02em;
	text-decoration: none;
}

.ms-footer__to-top:hover {
	background: rgba(255, 255, 255, .05);
	color: #fff;
}

.ms-footer__to-top-mark {
	display: inline-block;
	transition: transform .18s ease;
}

.ms-footer__to-top:hover .ms-footer__to-top-mark {
	transform: translateY(-2px);
}

.ms-footer__inner {
	padding-bottom: 26px;
}

/* Чипы доверия --------------------------------------------------------------- */
.ms-footer__trust {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
	gap: 12px;
	margin: 26px 0 0;
	padding: 0;
	list-style: none;
}

.ms-footer__trust-item a {
	display: flex;
	align-items: flex-start;
	gap: 13px;
	height: 100%;
	padding: 16px 18px;
	border: 1px solid rgba(255, 255, 255, .1);
	border-radius: 14px;
	background: rgba(255, 255, 255, .045);
	text-decoration: none;
	transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.ms-footer__trust-item a:hover {
	transform: translateY(-2px);
	border-color: rgba(40, 175, 177, .5);
	background: rgba(255, 255, 255, .075);
}

.ms-footer__trust-icon {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 11px;
	background: rgba(40, 175, 177, .16);
	color: #86e2e3;
}

.ms-footer__trust-text strong {
	display: block;
	color: #fff;
	font-family: var(--ms-font-head);
	font-size: 14.5px;
	font-weight: 600;
}

.ms-footer__trust-text em {
	display: block;
	margin-top: 3px;
	color: rgba(255, 255, 255, .7);
	font-size: 13px;
	font-style: normal;
	line-height: 1.45;
}

/* Блок продавцам ------------------------------------------------------------- */
.ms-footer__seller {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 24px;
	align-items: center;
	margin-top: 22px;
	padding: 24px 26px;
	border: 1px solid rgba(40, 175, 177, .34);
	border-radius: 18px;
	background: linear-gradient(135deg, rgba(40, 175, 177, .17), rgba(40, 175, 177, .05));
}

.ms-footer__seller-title {
	margin: 0 0 8px;
	color: #fff;
	font-family: var(--ms-font-head);
	font-size: 21px;
	font-weight: 700;
	line-height: 1.25;
}

.ms-footer__seller-lead {
	margin: 0 0 14px;
	max-width: 76ch;
	color: rgba(255, 255, 255, .8);
}

.ms-footer__seller-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-footer__seller-facts li {
	padding: 5px 12px;
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 999px;
	background: rgba(255, 255, 255, .08);
	color: rgba(255, 255, 255, .88);
	font-size: 12.5px;
}

.ms-footer__seller-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
}

.ms-footer .ms-btn {
	text-decoration: none;
	white-space: nowrap;
}

.ms-footer .ms-btn--primary {
	border-color: var(--ms-accent);
	background: var(--ms-accent);
	color: #08312f;
}

.ms-footer .ms-btn--primary:hover,
.ms-footer .ms-btn--primary:focus {
	background: #35c2c4;
	border-color: #35c2c4;
	color: #06282a;
}

.ms-footer .ms-btn--ghost {
	border-color: rgba(255, 255, 255, .32);
	color: #fff;
}

.ms-footer .ms-btn--ghost:hover,
.ms-footer .ms-btn--ghost:focus {
	border-color: #fff;
	background: rgba(255, 255, 255, .1);
	color: #fff;
}

/* Карта сайта: бренд + три колонки ссылок -------------------------------- */
.ms-footer__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
	gap: 30px;
	margin-top: 26px;
	padding: 32px 0 28px;
	border-top: 1px solid rgba(255, 255, 255, .1);
}

.ms-footer__logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	max-width: 100%;
	color: #fff;
	text-decoration: none;
}

/*
 * Логотип тот же, что в шапке (чёрный знак с бирюзовым акцентом), но на тёмном
 * подвале чёрные части не читаются. Инверсия превращает чёрное в белое,
 * а поворот тона на 180° возвращает бирюзу прежней — вместо тёмно-бирюзовой
 * она становится светло-бирюзовой, как акцент подвала.
 */
.ms-footer__logo img {
	display: block;
	width: auto;
	height: 30px;
	max-width: 100%;
	max-height: 30px;
	object-fit: contain;
	filter: invert(1) hue-rotate(180deg);
	transition: opacity .16s ease;
}

.ms-footer__logo:hover img,
.ms-footer__logo:focus-visible img {
	opacity: .86;
}

.ms-footer__logo-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: var(--ms-accent);
	color: var(--ms-accent-ink);
	font-weight: 700;
}

.ms-footer__logo-text {
	font-family: var(--ms-font-head);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -.01em;
}

.ms-footer__about {
	margin: 14px 0 16px;
	max-width: 42ch;
	color: rgba(255, 255, 255, .72);
	font-size: 13.5px;
}

.ms-footer__contacts {
	display: grid;
	gap: 6px;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	font-size: 13.5px;
	color: rgba(255, 255, 255, .72);
}

.ms-footer__contacts a {
	color: rgba(255, 255, 255, .88);
	text-decoration: none;
}

.ms-footer__contacts a:hover { color: #fff; }

.ms-footer__title {
	margin: 0 0 12px;
	color: rgba(255, 255, 255, .62);
	font-family: var(--ms-font-head);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.ms-footer__toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	text-align: left;
	cursor: default;
}

.ms-footer__toggle-mark {
	display: none;
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	margin-left: auto;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform .18s ease;
}

.ms-footer__list {
	display: grid;
	gap: 9px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 13.5px;
}

.ms-footer__list a {
	color: rgba(255, 255, 255, .76);
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 3px;
	transition: color .15s ease, text-decoration-color .15s ease;
}

.ms-footer__list a:hover {
	color: #fff;
	text-decoration-color: rgba(40, 175, 177, .9);
}


/* Правовая строка ------------------------------------------------------------ */
.ms-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 24px;
	padding: 20px 0 24px;
	border-top: 1px solid rgba(255, 255, 255, .1);
}

.ms-footer__bottom-text {
	display: grid;
	gap: 4px;
}

.ms-footer__copyright {
	margin: 0;
	color: rgba(255, 255, 255, .74);
	font-size: 13px;
}

.ms-footer__legal {
	margin: 0;
	max-width: 92ch;
	color: rgba(255, 255, 255, .55);
	font-size: 12.5px;
}

.ms-footer__legal-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	font-size: 13px;
}

.ms-footer__legal-links a {
	color: rgba(255, 255, 255, .74);
	text-decoration: none;
}

.ms-footer__legal-links a:hover { color: #fff; }

.ms-footer__deal {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 7px;
	margin: 0;
	padding: 5px 14px;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 999px;
	color: rgba(255, 255, 255, .86);
	font-size: 12.5px;
}

.ms-footer__deal-icon {
	display: inline-flex;
	flex: 0 0 auto;
	color: rgba(255, 255, 255, .62);
}

.ms-footer__dev {
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 255, 255, .4);
	transition: border-color .18s ease, color .18s ease;
}

.ms-footer__dev:hover {
	border-bottom-color: #fff;
	color: #fff;
}

.ms-footer__dev:focus-visible {
	outline: 2px solid rgba(255, 255, 255, .7);
	outline-offset: 3px;
	border-radius: 3px;
}

/* Планшеты ------------------------------------------------------------------- */
@media (max-width: 1199px) {
	.ms-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 26px;
	}

	.ms-footer__col--brand {
		grid-column: 1 / -1;
	}

	.ms-footer__seller {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}
}

/* Телефоны: колонки превращаются в аккордеон --------------------------------- */
@media (max-width: 767px) {
	.ms-footer {
		margin-top: 32px;
	}

	.ms-footer__trust {
		margin-top: 20px;
	}

	.ms-footer__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
		margin-top: 20px;
		padding: 8px 0 14px;
	}

	.ms-footer__col {
		padding: 14px 0;
	}

	.ms-footer__col + .ms-footer__col {
		border-top: 1px solid rgba(255, 255, 255, .08);
	}

	.ms-footer__col--brand {
		padding-bottom: 20px;
		border-bottom: 1px solid rgba(255, 255, 255, .08);
	}

	.ms-footer__logo img {
		height: 28px;
		max-height: 28px;
	}

	.ms-footer__toggle {
		cursor: pointer;
		padding: 4px 0;
		font-size: 13px;
	}

	.ms-footer__toggle-mark {
		display: block;
	}

	.ms-footer__col.is-open .ms-footer__toggle-mark {
		transform: rotate(225deg);
	}

	/* Свёрнутые колонки — только когда JS работает: без него ссылки видны все. */
	.ms-js .ms-footer__list {
		display: none;
	}

	.ms-js .ms-footer__col.is-open .ms-footer__list {
		display: grid;
		margin-top: 12px;
	}

	.ms-footer__title {
		margin-bottom: 0;
	}

	.ms-footer__col.is-open .ms-footer__title {
		margin-bottom: 0;
	}

	.ms-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
}

/* Уважение к «меньше движения» и печать ------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.ms-footer *,
	.ms-footer *::before,
	.ms-footer *::after {
		transition: none !important;
	}

	.ms-footer__trust-item a:hover {
		transform: none;
	}
}

@media print {
	.ms-footer {
		display: none !important;
	}
}

