/* Map page styles, copied from the Tilda page /map (filters panel, shaft card, plate). */
	:root {
		--header-height: 0px;
	}

	.container>*:not(#map),
	.container #filters *,
	.container #expand-filters {
		box-sizing: border-box;
	}

	.container {
		width: 100%;
		height: calc(100dvh - var(--header-height));
		display: flex;
		flex-direction: column;
		position: relative;
		font-family: 'Golos Text', Arial, sans-serif !important;
		overflow: hidden !important;
		transition: margin-top 0.3s ease;
	}

	#map {
		width: 100%;
		height: 100%;
		flex-grow: 1;
		border: none;
	}

	#filters {
		position: absolute;
		top: 10px;
		left: auto;
		right: 10px;
		background-color: rgba(255, 255, 255, 0.97);
		padding: 20px;
		border-radius: 16px;
		box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
		z-index: 1000;
		width: 340px;
		max-height: calc(100vh - 20px - var(--header-height));
		backdrop-filter: blur(10px);
		border: 1px solid rgba(0, 0, 0, 0.05);
		transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
		display: flex;
		flex-direction: column;
	}

	.filters-content {
		flex: 1;
		overflow-y: auto;
		overflow-x: hidden;
		padding-right: 8px;
		margin-right: -8px;
	}

	.filters-footer {
		margin-top: auto;
		padding-top: 20px;
		background-color: rgba(255, 255, 255, 0.97);
		backdrop-filter: blur(10px);
		position: sticky;
		bottom: 0;
		padding: 20px 0 0 0;
	}

	#filters:hover {
		box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
	}

	.filters-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 20px;
		padding: 2px 0 15px 0;
		border-bottom: 1px solid #eee;
	}

	.filters-buttons {
		display: flex;
		align-items: center;
		gap: 8px;
		flex-direction: row-reverse;
	}

	#filters h3 {
		font-size: 18px;
		font-weight: 600;
		color: #0E2B06;
		display: flex;
		align-items: center;
	}

	#filters h3 i {
		margin-right: 8px;
		color: #FF8562;
	}

	#reset-all-filters {
		background-color: #FFF1ED;
		color: #FF8562;
		border: 1px solid rgba(255, 133, 98, 0.2);
		padding: 6px 10px;
		border-radius: 6px;
		font-size: 12px;
		cursor: pointer;
		display: flex;
		align-items: center;
		transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
		font-weight: 500;
		box-shadow: 0 1px 3px rgba(255, 133, 98, 0.1);
		height: 32px;
	}

	#reset-all-filters:hover {
		background-color: #FFE5DD;
		color: #FF6B40;
		transform: translateY(-1px);
		box-shadow: 0 3px 6px rgba(255, 133, 98, 0.15);
	}

	#reset-all-filters:active {
		background-color: #FFE5DD;
		color: #FF6B40;
		box-shadow: 0 1px 3px rgba(255, 133, 98, 0.1);
	}

	#reset-all-filters i {
		margin-right: 5px;
		font-size: 11px;
		position: relative;
		top: -1px;
	}

	.filter-group {
		margin-bottom: 20px;
		padding-bottom: 15px;
		border-bottom: 1px solid #eee;
	}

	.filter-group:last-child {
		border-bottom: none;
		margin-bottom: 0;
		padding-bottom: 0;
	}

	#filters h4 {
		font-size: 13px;
		font-weight: 600;
		margin: 0 0 12px 0;
		color: #2D2D2D;
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		padding-bottom: 8px;
		border-bottom: 1px solid #f0f0f0;
		position: relative;
		gap: 8px;
	}

	.header-title {
		display: flex;
		align-items: center;
		flex: 1;
		min-width: 0;
		gap: 4px;
	}

	#filters h4 i {
		color: #FF8562;
		font-size: 14px;
		width: 16px;
		text-align: center;
		flex-shrink: 0;
		position: relative;
		top: 1px;
	}

	#filters h4 .koper-icon {
		width: 16px;
		height: 16px;
		flex-shrink: 0;
		background: url('/img/koper.svg') center/contain no-repeat;
		position: relative;
		top: 1px;
	}

	#filters h4 .koper-icon svg {
		width: 100%;
		height: 100%;
		fill: #FF8562;
	}


	.checkbox-container {
		display: flex;
		flex-direction: column;
		gap: 12px;
		margin-top: 12px;
		max-height: 200px;
		overflow-y: auto;
		overflow-x: hidden;
		padding-right: 8px;
		padding-bottom: 5px;
	}

	.checkbox-container::-webkit-scrollbar {
		width: 6px;
	}

	.checkbox-container::-webkit-scrollbar-track {
		background: #f1f1f1;
		border-radius: 3px;
		margin: 10px 0;
	}

	.checkbox-container::-webkit-scrollbar-thumb {
		background: #FFB8A4;
		border-radius: 3px;
	}

	.checkbox-container::-webkit-scrollbar-thumb:hover {
		background: #FF8562;
	}

	.checkbox-item {
		display: flex;
		align-items: center;
		background-color: #F5F5F5;
		border-radius: 8px;
		padding: 10px 12px;
		min-height: 40px;
        height: auto;
		cursor: pointer;
		user-select: none;
		font-size: 13px;
		transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
		border: 1px solid #e9ecef;
		position: relative;
		width: 100%;
		box-sizing: border-box;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.checkbox-item span {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		display: block;
		flex: 1;
		transition: color 0.2s ease;
	}

	.checkbox-item:hover {
		background-color: #EDEDED;
		box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
		border-color: #ddd;
		z-index: 1;
	}


	.checkbox-item input[type="checkbox"] {
		margin-right: 12px;
		width: 18px;
		height: 18px;
		cursor: pointer;
		appearance: none;
		-webkit-appearance: none;
		border: 2px solid #ccc;
		border-radius: 4px;
		background-color: white;
		transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
		position: relative;
		flex-shrink: 0;
	}

	.checkbox-item input[type="checkbox"]:checked {
		background-color: #FF8562;
		border-color: #FF8562;
	}

	.checkbox-item input[type="checkbox"]:checked::after {
		content: '\f00c';
		font-family: 'Font Awesome 5 Free';
		font-weight: 900;
		color: white;
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		font-size: 11px;
		opacity: 1;
		transition: opacity 0.15s ease;
	}

	.checkbox-item input[type="checkbox"]:hover {
		border-color: #FF8562;
		transform: scale(1.05);
	}

	.checkbox-item.active {
		background-color: #FFF1ED;
		border: 1px solid #FF8562;
		color: #FF6B40;
		box-shadow: 0 2px 5px rgba(255, 133, 98, 0.1);
	}

	.checkbox-item.active span {
		color: #FF6B40;
	}

	.filter-count {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		background-color: #FF8562;
		color: white;
		font-size: 11px;
		font-weight: 600;
		border-radius: 12px;
		padding: 2px 8px;
		min-width: 20px;
		height: 20px;
		margin-left: 8px;
		box-shadow: 0 2px 4px rgba(255, 133, 98, 0.2);
		transition: all 0.2s ease;
	}

	.filter-count-empty {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		background-color: #F5F5F5;
		color: #999;
		font-size: 11px;
		font-weight: 500;
		border-radius: 12px;
		padding: 2px 8px;
		min-width: 20px;
		height: 20px;
		margin-left: 8px;
		transition: all 0.2s ease;
	}

	#filters::-webkit-scrollbar {
		width: 6px;
	}

	#filters::-webkit-scrollbar-track {
		background: #f1f1f1;
		border-radius: 3px;
		margin: 10px 0;
	}

	#filters::-webkit-scrollbar-thumb {
		background: #FFB8A4;
		border-radius: 3px;
	}

	#filters::-webkit-scrollbar-thumb:hover {
		background: #FF8562;
	}

	#toggle-filters {
		background-color: #FFF1ED;
		color: #FF8562;
		border: 1px solid rgba(255, 133, 98, 0.2);
		width: 32px;
		height: 32px;
		border-radius: 6px;
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
		transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
		box-shadow: 0 1px 3px rgba(255, 133, 98, 0.1);
	}

	#toggle-filters:hover {
		background-color: #FFE5DD;
		color: #FF6B40;
		transform: translateY(-1px);
		box-shadow: 0 3px 6px rgba(255, 133, 98, 0.15);
	}

	#toggle-filters:active {
		transform: translateY(0);
		box-shadow: 0 1px 3px rgba(255, 133, 98, 0.1);
	}

	#toggle-filters i:before {
		content: "\f00d";
	}

	#toggle-filters i {
		font-size: 12px;
		transition: transform 0.3s ease;
		position: relative;
		top: -1px;
	}

	#toggle-filters.collapsed i {
		transform: none;
	}

	#expand-filters {
		position: absolute;
		top: 10px;
		right: 10px;
		left: auto;
		background-color: #FF8562;
		color: white;
		border: none;
		width: 40px;
		height: 40px;
		border-radius: 8px;
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
		transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
		box-shadow: 0 2px 8px rgba(255, 133, 98, 0.3);
		z-index: 1000;
	}

	#expand-filters:hover {
		background-color: #FF6B40;
		transform: translateY(-1px);
		box-shadow: 0 4px 10px rgba(255, 133, 98, 0.4);
	}

	#expand-filters:active {
		transform: translateY(0);
		box-shadow: 0 2px 8px rgba(255, 133, 98, 0.3);
	}

	#expand-filters i {
		font-size: 16px;
	}

	#filters.collapsed {
		transform: translateX(-110%);
		opacity: 0;
		visibility: hidden;
		transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
	}

	.hidden {
		display: none !important;
	}

	.checkbox-container.scrollable {
		max-height: 200px;
		overflow-y: auto;
		overflow-x: hidden;
		padding-right: 8px;
	}

	.checkbox-container.scrollable .checkbox-item {
		margin-right: 2px;
	}

	.search-box {
		position: relative;
		margin-bottom: 12px;
	}

	.filter-search {
		width: 100%;
		padding: 10px 12px;
		padding-left: 35px;
		border-radius: 8px;
		border: 1px solid #e9ecef;
		font-size: 13px;
		outline: none;
		transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
		background-color: #F5F5F5;
		height: 40px;
	}

	.filter-search:focus {
		border-color: #FF8562;
		box-shadow: 0 0 0 3px rgba(255, 133, 98, 0.15);
		background-color: #fff;
	}

	.search-icon {
		position: absolute;
		left: 12px;
		top: 50%;
		transform: translateY(-50%);
		color: #aaa;
		font-size: 14px;
		pointer-events: none;
		transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
	}

	.filter-search:focus+.search-icon {
		color: #FF8562;
	}

	.no-results {
		text-align: center;
		padding: 15px 10px;
		color: #999;
		font-size: 13px;
		background-color: #F5F5F5;
		border-radius: 8px;
		margin-top: 10px;
	}


	@media (max-width: 768px) {
		#filters {
			position: fixed;
			width: calc(100% - 20px);
			left: 50%;
			top: 50px;
			transform: translateX(-50%);
			max-height: calc(100dvh - 60px); /* верхний 50px + нижний 10px */
		margin-bottom: 10px; /* визуальный отступ */
		padding-bottom: 10px; /* контент не прилипает к низу */
			padding: 20px;
			display: flex;
			flex-direction: column;
		}

		.filters-content {
			flex: 1;
			overflow-y: auto;
			-webkit-overflow-scrolling: touch;
			padding-bottom: 20px;
		}

		.filters-footer {
			padding-top: 15px;
			padding-bottom: calc(env(safe-area-inset-bottom, 0px));
			border-top: 1px solid rgba(0, 0, 0, 0.05);
			margin: 0;
			background-color: rgba(255, 255, 255, 0.97);
			backdrop-filter: blur(10px);
		}

		.apply-filters-button {
			position: relative;
			bottom: auto;
			left: auto;
			transform: none;
			width: 100%;
			margin: 0;
		}

		.apply-filters-button:hover,
		.apply-filters-button:active {
			transform: translateY(-1px);
		}

		#filters.collapsed {
			transform: translateX(-150%);
			opacity: 0;
			visibility: hidden;
		}

		.checkbox-container {
			max-height: 150px;
		}

		.checkbox-container.scrollable {
			max-height: 150px;
		}

		.checkbox-item {
			padding: 8px 10px;
			height: 36px;
			min-height: 36px;
			max-height: 36px;
		}

		#expand-filters {
			position: fixed;
			left: 10px;
			top: 50px;
			transform: none;
			bottom: auto;
			box-shadow: 0 2px 15px rgba(255, 133, 98, 0.4);
			width: 40px;
			height: 40px;
			border-radius: 8px;
		}

		#expand-filters:hover {
			transform: translateY(-1px);
		}

		#expand-filters:active {
			transform: translateY(0);
		}

		#toggle-filters i:before {
			content: "\f00d";
		}

		#reset-all-filters:hover {
			transform: none;
			box-shadow: 0 1px 3px rgba(255, 133, 98, 0.1);
		}

		#reset-all-filters:active {
			transform: none;
			background-color: #FFE5DD;
			color: #FF6B40;
		}
	}

@media (min-width: 769px) and (max-width: 1024px) {
	#expand-filters {
		top: 50px; /* чтобы не перекрывал меню */
		right: 10px;
		left: auto;
	}

	#filters {
		top: 50px; /* такой же отступ */
		right: 10px;
		left: auto;
		max-width: 400px; /* можно ограничить ширину, чтобы не съедало экран */
		max-height: calc(100dvh - 60px); /* верхний 50px + нижний 10px */
		margin-bottom: 10px; /* визуальный отступ */
		padding-bottom: 10px; /* контент не прилипает к низу */
	}
}




	@media (max-width: 480px) {
		#filters {
			height: calc(100dvh - 20px);
			padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
			padding-left: 15px;
			padding-right: 15px;
		}

		.filter-group {
			margin-bottom: 15px;
			padding-bottom: 10px;
		}

		#filters h3 {
			font-size: 16px;
		}

		#filters h4 {
			font-size: 13px;
		}
	}

	body.mobile-view #expand-filters {
		position: absolute;
	}

	body.mobile-view #filters.collapsed+#expand-filters {
		display: flex !important;
	}

	.apply-filters-button {
		background-color: #FFF1ED;
		color: #FF8562;
		border: 1px solid rgba(255, 133, 98, 0.2);
		padding: 6px 10px;
		border-radius: 6px;
		font-size: 14px;
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
		font-weight: 500;
		box-shadow: 0 1px 3px rgba(255, 133, 98, 0.1);
		width: 100%;
		height: 40px;
	}

	.apply-filters-button:hover {
		background-color: #FFE5DD;
		color: #FF6B40;
		transform: translateY(-1px);
		box-shadow: 0 3px 6px rgba(255, 133, 98, 0.15);
	}

	.apply-filters-button:active {
		background-color: #FFE5DD;
		color: #FF6B40;
		transform: translateY(0);
		box-shadow: 0 1px 3px rgba(255, 133, 98, 0.1);
	}

	.apply-filters-button i {
		font-size: 12px;
		position: relative;
		top: 1px;
	}

	.tooltip {
		position: fixed;
		background-color: rgba(0, 0, 0, 0.8);
		color: white;
		padding: 8px 12px;
		border-radius: 6px;
		font-size: 13px;
		font-family: 'Golos Text', Arial, sans-serif !important;
		z-index: 1001;
		pointer-events: none;
		opacity: 0;
		transition: opacity 0.2s ease;
		max-width: 200px;
		text-align: center;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	}

	.tooltip.show {
		opacity: 1;
	}

	#license-filters {
		padding-right: 0;
	}
    .trunks,
    .sumdeep {
        font-family: 'Golos Text', Arial, sans-serif !important;
        font-size: 12px !important;
    }
.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.custom-popup {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    font-family: 'Golos Text', Arial, sans-serif;
    font-size: 14px;
    max-width: 640px;
    width: 90%;
    z-index: 9999;
    position: relative;
    padding: 20px;
    overflow-x: auto; /* если таблица шире – скроллим внутри окна */
}

.custom-popup .close-btn {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 18px;
    cursor: pointer;
    color: #666;
}

.custom-popup table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed; /* фиксированная сетка */
    font-size: 14px;
}

.custom-popup td {
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word; /* перенос длинных слов */
}

.custom-popup td:first-child { 
    width: 55%; 
    color: #444; 
}
.custom-popup td:last-child { 
    width: 45%; 
}


/* чтобы переносы строк (\n) работали в ячейках справа */
.custom-popup td:last-child {
  white-space: pre-line;
}


.custom-popup tr:first-child td {
    font-weight: 600;
    font-size: 16px;
    background-color: #f8f3e8;
    color: #b5882f;
}

.custom-popup tr:nth-child(odd):not(:first-child) {
    background-color: #f8f3e8;
}

/* Мобильная версия */
@media (max-width: 600px) {
  .custom-popup {
    padding: 12px;
  }
  .custom-popup table {
    font-size: 12px;
  }
  .custom-popup td {
    padding: 6px 8px;
  }
}

/* The shaft's link in the card */
.custom-popup .card-link { color: #b5882f; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.custom-popup .card-link:hover { color: #8f6403; }
