/**
 * From-Country Links Styles
 *
 * @package SiteWidgets
 */

.fc-links {
	display: block;
}

.fc-links-title {
	margin: 0 0 12px;
	color: #121826;
	font-size: 18px;
	font-weight: 850;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.fc-links-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fc-links-list--preview {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.fc-links-item {
	margin: 0;
}

.fc-links-link {
	display: flex;
	align-items: center;
	min-height: 46px;
	padding: 10px 14px;
	border: 1px solid #e7ebf3;
	border-radius: 12px;
	background: #fff;
	color: #121826;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none;
	transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
}

button.fc-links-link {
	width: 100%;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.fc-links-link:hover {
	border-color: #cbd5e1;
	box-shadow: 0 4px 12px rgba(17, 24, 39, 0.05);
	color: #121826;
	text-decoration: none;
}

.fc-links-link:focus-visible,
.fc-links-more:focus-visible,
.fc-links-modal__close:focus-visible,
.fc-links-country-card__select:focus-visible,
.fc-links-city-link:focus-visible {
	outline: 2px solid rgba(17, 24, 39, 0.2);
	outline-offset: 2px;
}

span.fc-links-link.is-current {
	border-color: #111827;
	background: #111827;
	color: #fff;
	cursor: default;
}

.fc-links-actions {
	margin-top: 12px;
}

.fc-links-inline-cities {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #e7ebf3;
}

.fc-links-inline-cities__header {
	margin-bottom: 10px;
}

.fc-links-inline-cities__title {
	margin: 0;
	color: #121826;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.fc-links-inline-cities__description {
	margin: 4px 0 0;
	color: #5b6472;
	font-size: 12px;
	line-height: 1.5;
}

.fc-links-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 14px;
	border: 1px solid #e7ebf3;
	border-radius: 12px;
	background: #fff;
	color: #121826;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.fc-links-more:hover {
	border-color: #cbd5e1;
	box-shadow: 0 4px 12px rgba(17, 24, 39, 0.05);
	background: #f9fafb;
}

.fc-links-modal[hidden] {
	display: none !important;
}

.fc-links-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.fc-links-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.5);
}

.fc-links-modal__dialog {
	position: relative;
	width: min(980px, 100%);
	max-height: min(82vh, 860px);
	overflow: auto;
	border: 1px solid #e7ebf3;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 28px 60px rgba(15, 23, 42, 0.2);
	padding: 18px;
}

.fc-links-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
	padding-bottom: 14px;
	border-bottom: 1px solid #e7ebf3;
}

.fc-links-modal__title {
	margin: 0;
	color: #121826;
	font-size: 20px;
	font-weight: 850;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.fc-links-modal__description {
	margin: 6px 0 0;
	color: #5b6472;
	font-size: 13px;
	line-height: 1.5;
}

.fc-links-modal__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid #e7ebf3;
	border-radius: 12px;
	background: #fff;
	color: #121826;
	font: inherit;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.fc-links-modal__close:hover {
	background: #f9fafb;
}

.fc-links-modal__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
}

.fc-links-country-card {
	padding: 14px;
	border: 1px solid #e7ebf3;
	border-radius: 12px;
	background: #fff;
}

.fc-links-country-card__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid #e7ebf3;
}

.fc-links-country-card__headings {
	min-width: 0;
}

.fc-links-country-card__title {
	color: #121826;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.25;
	text-decoration: none;
}

.fc-links-country-card__title.is-current {
	color: #111827;
}

.fc-links-country-card__actions {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

.fc-links-country-card__select,
.fc-links-country-card__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	padding: 6px 10px;
	border: 1px solid #e7ebf3;
	border-radius: 999px;
	background: #f9fafb;
	color: #121826;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
}

.fc-links-country-card__select:hover {
	border-color: #cbd5e1;
	background: #fff;
	color: #121826;
	text-decoration: none;
}

.fc-links-country-card__badge.is-current {
	border-color: #111827;
	background: #111827;
	color: #fff;
}

.fc-links-city-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.fc-links-city-list--inline {
	gap: 10px;
}

.fc-links-city-list__item {
	margin: 0;
}

.fc-links-city-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 7px 10px;
	border: 1px solid #e7ebf3;
	border-radius: 10px;
	background: #fff;
	color: #121826;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.fc-links-city-link:hover {
	border-color: #cbd5e1;
	background: #f9fafb;
	color: #121826;
	text-decoration: none;
}

.fc-links-city-link.is-current {
	border-color: #111827;
	background: #111827;
	color: #fff;
	cursor: default;
}

.fc-links-city-link.is-disabled {
	color: #94a3b8;
	cursor: default;
}

.fc-links-modal__body {
	min-height: 120px;
}

.fc-links-modal__status {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	padding: 16px;
	border: 1px dashed #dbe3ef;
	border-radius: 10px;
	background: #f8fafc;
	color: #5b6472;
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
}

.fc-links-modal__status.is-error {
	border-style: solid;
	border-color: #f0caca;
	background: #fff7f7;
}

/* Farpost-like simplification */
.fc-links-link,
.fc-links-more {
	min-height: 42px;
	padding: 9px 12px;
	border-radius: 10px;
	box-shadow: none;
	font-size: 13px;
	font-weight: 700;
}

.fc-links-inline-cities {
	margin-top: 12px;
	padding-top: 12px;
}

.fc-links-modal__dialog {
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
	padding: 16px;
}

.fc-links-modal__header {
	margin-bottom: 14px;
	padding-bottom: 12px;
}

.fc-links-modal__title {
	font-size: 18px;
	font-weight: 800;
}

.fc-links-modal__description,
.fc-links-inline-cities__description {
	font-size: 12px;
	line-height: 1.5;
}

.fc-links-country-card {
	padding: 12px;
	border-radius: 10px;
	background: #fafbfd;
}

.fc-links-country-card__header {
	margin-bottom: 10px;
	padding-bottom: 8px;
}

.fc-links-country-card__title {
	font-size: 14px;
	font-weight: 800;
}

.fc-links-country-card__select,
.fc-links-country-card__badge,
.fc-links-city-link {
	border-radius: 10px;
	font-size: 12px;
}

.fc-links-city-list__empty {
	color: #5b6472;
	font-size: 13px;
	line-height: 1.5;
}

body.sw-modal-open {
	overflow: hidden;
}

@media (max-width: 767.98px) {
	.fc-links-list--preview {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.fc-links-modal {
		padding: 14px;
	}

	.fc-links-inline-cities {
		margin-top: 12px;
		padding-top: 12px;
	}

	.fc-links-modal__dialog {
		padding: 14px;
		max-height: min(88vh, 860px);
	}

	.fc-links-modal__header {
		gap: 12px;
		margin-bottom: 14px;
	}

	.fc-links-modal__title {
		font-size: 18px;
	}

	.fc-links-modal__grid {
		grid-template-columns: 1fr;
	}

	.fc-links-country-card__header {
		flex-direction: column;
		align-items: stretch;
	}

	.fc-links-country-card__actions {
		justify-content: flex-start;
	}
}

/* Flat modal and skeletons */
.fc-links-modal__dialog {
	width: min(940px, 100%);
	padding: 16px 18px;
	border-radius: 10px;
}

.fc-links-modal__header {
	margin-bottom: 12px;
	padding-bottom: 10px;
}

.fc-links-modal__description {
	font-size: 12px;
}

.fc-links-modal__grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px 24px;
}

.fc-links-country-card {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}

.fc-links-country-card__header {
	display: block;
	margin-bottom: 6px;
	padding: 0;
	border: 0;
}

.fc-links-country-card__actions {
	margin-top: 4px;
}

.fc-links-country-card__select,
.fc-links-country-card__badge {
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #6b7280;
	font-size: 12px;
	font-weight: 600;
}

.fc-links-country-card__select:hover {
	background: transparent;
	color: #121826;
	text-decoration: underline;
}

.fc-links-country-card__badge.is-current {
	background: transparent;
	color: #111827;
}

.fc-links-city-list {
	display: grid;
	gap: 4px;
}

.fc-links-city-link {
	justify-content: flex-start;
	min-height: 0;
	padding: 4px 6px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	color: #1d4fbd;
	font-size: 13px;
	font-weight: 600;
}

.fc-links-city-link:hover {
	border-color: #e3e9f2;
	background: #f7f9fc;
	color: #163f99;
}

.fc-links-city-link.is-current {
	border-color: #111827;
	background: #111827;
	color: #fff;
}

.fc-links-city-link.is-disabled {
	border-style: dashed;
	background: #fafbfd;
}

.fc-links-modal__status.is-loading {
	display: block;
	min-height: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

.fc-links-skeleton__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px 24px;
}

.fc-links-skeleton__card,
.fc-links-skeleton__title,
.fc-links-skeleton__line {
	position: relative;
	overflow: hidden;
	background: #edf2f7;
}

.fc-links-skeleton__card {
	padding: 0;
	background: transparent;
}

.fc-links-skeleton__title,
.fc-links-skeleton__line {
	display: block;
	border-radius: 999px;
}

.fc-links-skeleton__title::after,
.fc-links-skeleton__line::after {
	content: "";
	position: absolute;
	inset: 0;
	transform: translateX(-100%);
	background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.72) 50%, transparent 100%);
	animation: fc-links-skeleton 1.2s ease-in-out infinite;
}

.fc-links-skeleton__title {
	width: 48%;
	height: 12px;
	margin-bottom: 12px;
}

.fc-links-skeleton__line {
	width: 82%;
	height: 28px;
	margin-bottom: 6px;
	border-radius: 8px;
}

.fc-links-skeleton__line.is-short {
	width: 58%;
}

@keyframes fc-links-skeleton {
	100% {
		transform: translateX(100%);
	}
}

@media (max-width: 767.98px) {
	.fc-links-modal__grid,
	.fc-links-skeleton__grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}
}
