/* Страницы офисов: /ofisy/ и /ofisy/{офис}/ */

.offices {
	--offices-text: #1b222b;
	--offices-muted: #6b7380;
	--offices-line: rgba(27, 34, 43, 0.08);
	--offices-blue: #3a62d7;
	--offices-orange: #fb671e;
	--offices-radius: 20px;
	--offices-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
	--offices-shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.08);

	color: var(--offices-text);
	padding-bottom: 20px;
}

.offices [hidden] {
	display: none !important;
}

/* Хлебные крошки */
.offices-crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 0;
	margin: 0 0 24px;
	font-size: 14px;
	line-height: 20px;
	color: var(--offices-muted);
}

.offices-crumbs a {
	color: var(--offices-muted);
	text-decoration: none;
	transition: color 0.2s;
}

.offices-crumbs a:hover {
	color: var(--offices-blue);
}

.offices-crumbs a::after {
	content: "/";
	margin: 0 10px;
	color: rgba(107, 115, 128, 0.5);
}

/* Заголовок */
.offices-hero {
	max-width: 860px;
	margin: 0 0 40px;
}

.offices-hero h1 {
	margin: 0 0 16px;
	text-wrap: balance;
}

.offices-hero__lead {
	margin: 0;
	font-size: 20px;
	line-height: 30px;
	color: var(--offices-muted);
	text-wrap: pretty;
}

.offices-hero .office-badge {
	margin-bottom: 16px;
}

/* Поиск */
.offices-search {
	position: relative;
	max-width: 720px;
	margin: 0 0 16px;
}

.offices-search__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.offices-search__icon {
	position: absolute;
	top: 50%;
	left: 24px;
	transform: translateY(-50%);
	color: var(--offices-muted);
	pointer-events: none;
}

.offices .offices-search__input {
	display: block;
	width: 100%;
	height: 64px;
	margin: 0;
	padding: 0 60px 0 62px;
	box-sizing: border-box;
	font-family: inherit;
	font-size: 18px;
	color: var(--offices-text);
	background: #fff;
	border: 1px solid var(--offices-line);
	border-radius: 16px;
	box-shadow: var(--offices-shadow);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.offices-search__input::-webkit-search-cancel-button {
	display: none;
}

.offices-search__input::placeholder {
	color: rgba(27, 34, 43, 0.4);
}

.offices .offices-search__input:focus {
	border-color: var(--offices-blue);
	box-shadow: 0 0 0 4px rgba(58, 98, 215, 0.12), var(--offices-shadow);
}

.offices-search__clear {
	position: absolute;
	top: 50%;
	right: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	transform: translateY(-50%);
	color: var(--offices-muted);
	background: #f1f2f4;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}

.offices-search__clear:hover {
	color: var(--offices-text);
	background: #e6e8eb;
}

.offices-count {
	min-height: 22px;
	margin: 0 0 32px;
	font-size: 15px;
	line-height: 22px;
	color: var(--offices-muted);
}

/* Группа по городу */
.offices-town {
	margin: 0 0 48px;
}

.offices .offices-town__title {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 20px;
	font-size: 28px;
	line-height: 34px;
	font-weight: 800;
}

.offices-town__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 28px;
	padding: 0 10px;
	box-sizing: border-box;
	font-size: 14px;
	font-weight: 500;
	color: var(--offices-blue);
	background: rgba(58, 98, 215, 0.1);
	border-radius: 14px;
}

.offices-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}

/* Карточка офиса */
.office-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 28px;
	color: var(--offices-text);
	text-decoration: none;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.02);
	border-radius: var(--offices-radius);
	box-shadow: var(--offices-shadow);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.office-card:hover,
.office-card:focus-visible {
	color: var(--offices-text);
	transform: translateY(-6px);
	box-shadow: var(--offices-shadow-hover);
}

.office-card:focus-visible {
	outline: 2px solid var(--offices-blue);
	outline-offset: 3px;
}

.office-card__top {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.office-card__top:empty {
	display: none;
}

.office-card__district {
	font-size: 13px;
	line-height: 18px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--offices-blue);
}

.office-card__address {
	font-size: 18px;
	line-height: 25px;
	font-weight: 500;
	text-wrap: pretty;
}

.office-card__meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 15px;
	line-height: 22px;
}

.office-card__row_muted {
	color: var(--offices-muted);
}

.office-card__more {
	margin-top: auto;
	padding-top: 6px;
	font-size: 15px;
	font-weight: 500;
	color: var(--offices-orange);
}

.office-card__more::after {
	content: "→";
	display: inline-block;
	margin-left: 8px;
	transition: transform 0.2s;
}

.office-card:hover .office-card__more::after {
	transform: translateX(4px);
}

.office-badge {
	display: inline-block;
	padding: 4px 10px;
	font-size: 12px;
	line-height: 16px;
	font-weight: 500;
	border-radius: 10px;
}

.office-badge_soon {
	color: #c44d0f;
	background: rgba(251, 103, 30, 0.12);
}

/* Пустой результат */
.offices-empty {
	max-width: 520px;
	padding: 48px 0;
	font-size: 17px;
	color: var(--offices-muted);
}

.offices-empty p {
	margin: 0 0 8px;
}

.offices-empty__title {
	font-size: 24px;
	font-weight: 800;
	color: var(--offices-text);
}

.offices-empty a {
	color: var(--offices-blue);
}

/* Страница офиса */
.office-layout {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 24px;
	margin: 0 0 64px;
}

.office-layout_single {
	grid-template-columns: minmax(0, 720px);
}

.office-contacts {
	display: flex;
	flex-direction: column;
	padding: 36px;
	background: #fff;
	border-radius: var(--offices-radius);
	box-shadow: var(--offices-shadow);
}

.office-contacts__list {
	margin: 0 0 32px;
}

.office-contacts__item {
	padding: 18px 0;
	border-bottom: 1px solid var(--offices-line);
}

.office-contacts__item:first-child {
	padding-top: 0;
}

.office-contacts__item:last-child {
	border-bottom: 0;
}

.office-contacts__item dt {
	margin: 0 0 6px;
	font-size: 13px;
	line-height: 18px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--offices-muted);
}

.office-contacts__item dd {
	margin: 0;
	font-size: 17px;
	line-height: 25px;
}

.office-contacts__item a {
	color: var(--offices-blue);
	text-decoration: none;
	word-break: break-word;
}

.office-contacts__item a:hover {
	text-decoration: underline;
}

.office-contacts .office-contacts__phone {
	font-size: 24px;
	line-height: 32px;
	font-weight: 500;
	color: var(--offices-text);
	font-variant-numeric: tabular-nums;
}

.office-contacts__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: auto;
}

.office-btn {
	display: inline-flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	padding: 0 26px;
	box-sizing: border-box;
	font-size: 16px;
	font-weight: 500;
	text-align: center;
	text-decoration: none;
	border-radius: 30px;
	transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.office-btn:active {
	transform: scale(0.98);
}

.office-btn_primary,
.office-btn_primary:hover {
	color: #fff;
	background: linear-gradient(90deg, #ff8c00 0%, #ff5e00 100%);
	box-shadow: 0 8px 20px rgba(255, 94, 0, 0.25);
}

.office-btn_primary:hover {
	box-shadow: 0 12px 26px rgba(255, 94, 0, 0.35);
}

.office-btn_secondary {
	color: var(--offices-blue);
	background: rgba(58, 98, 215, 0.08);
}

.office-btn_secondary:hover {
	color: var(--offices-blue);
	background: rgba(58, 98, 215, 0.14);
}

.office-map {
	min-height: 460px;
	overflow: hidden;
	background: #eceef1;
	border-radius: var(--offices-radius);
	box-shadow: var(--offices-shadow);
}

.office-page__back {
	display: inline-block;
	font-size: 16px;
	font-weight: 500;
	color: var(--offices-blue);
	text-decoration: none;
}

.office-page__back::before {
	content: "←";
	margin-right: 8px;
}

@media (max-width: 1024px) {
	.office-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.office-map {
		min-height: 360px;
	}
}

@media (max-width: 767px) {
	.offices-crumbs {
		margin-bottom: 16px;
	}

	.offices-hero {
		margin-bottom: 28px;
	}

	.offices-hero__lead {
		font-size: 16px;
		line-height: 24px;
	}

	.offices .offices-search__input {
		height: 56px;
		padding-left: 52px;
		font-size: 16px;
	}

	.offices-search__icon {
		left: 18px;
	}

	.offices-count {
		margin-bottom: 20px;
	}

	.offices-town {
		margin-bottom: 36px;
	}

	.offices .offices-town__title {
		font-size: 22px;
		line-height: 28px;
	}

	.offices-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
	}

	.office-card {
		padding: 22px 20px;
	}

	.office-contacts {
		padding: 24px 20px;
	}

	.office-btn {
		flex-basis: 100%;
	}

	.office-map {
		min-height: 300px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.office-card,
	.office-card__more::after,
	.office-btn {
		transition: none;
	}

	.office-card:hover,
	.office-card:focus-visible {
		transform: none;
	}
}
