:root {
    --all-bg-color: #f3f4f5;
    --bg-hover-color: rgba(153, 153, 153, 0.1);
    --bg-menu-color:  rgba(252, 252, 252, 0.9);
    --blur:blur(10px);
    --accent-dark: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
}

* {
    margin: 0;
    // padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Меню */
#header-menu {
    background-color: #fff;
    //border-bottom: solid 1px rgba(144, 144, 144, 0.25);
    //box-shadow: 0px 0.0375em 0.125em 0px rgba(0, 0, 0, 0.05);
    //color: #484848;
    //cursor: default;
    //font-size: 1.25em;
    // height: 4.5em;
    //left: 0;
    //line-height: 4.4em;
    //position: fixed;
    text-transform: uppercase;
    //top: 0;
    width: 100%;
    z-index: 500;
    //display: none;

}

#header-menu.navi {
    background-color: transparent;
    border: 0;
    box-shadow: none;
    //height: 3.25em;
    line-height: 2.0em;
    position: absolute;
    top: 10px;
}

.menu {
  right: 20px;
  //top: 2em;  
  //z-index: 10;
  //justify-content: end;
  align-items: center;
  //width: 100%;
  //margin-left: auto;
  //margin-right: auto;
  display: flex;
  //position: absolute;
  //top: 10px;
  //font-family: "Host Grotesk", sans-serif;
  font-size: 14px;
}

.navi {
    background-color: transparent;
    border: 0;
    box-shadow: none;
    //height: 3.25em;
    line-height: 3.25em;
    position: absolute;
}

#header-menu.nav h1 {
    color: #ffffff;
    left: 2.5em;
    top: 2em;
}

#header-menu h1 {
    color: #484848;
    font-weight: 400;
    height: inherit;
    left: 1.25em;
    line-height: inherit;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 0;
}

#header-menu.nav h1 a {
    color: #fff;
}

#header-menu.navi nav a {
    color: #747474;
    text-decoration: none;
}

 #header-menu.navi nav a:hover {
     color: #adadad;
    //font-size: 0.98em;
}

#header-menu nav {
    //height: inherit;
    //line-height: inherit;
    position: absolute;
    //right: 1.25em;
    //top: 0;
    //vertical-align: middle;
}

#header-menu nav ul {
    border-radius: 16px;
    // background: #ffffffb5;
    backdrop-filter: var(--blur);
    border: 1px solid #0000001a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 0 10px;
    //list-style: none;
    //margin: 0;
    //padding-left: 0;
}

#header-menu nav ul li {
    // border-radius: 4px;
    display: inline-block;
    margin-left: 1.0em;
    margin-right: 1.0em;
    padding-left: 0;
}


/* Оверлейная панель */
.sidebar {
    position: absolute;
    top: 10px;
    left: 20px;
    width: 360px;
    max-height: calc(100vh - 70px);
    /*background: rgba(255, 255, 255, 0.95);*/
    backdrop-filter: var(--blur);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-340px);
}

.sidebar-header {
    padding: 10px 15px 10px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    color: #333;
    min-width: 170px;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-content {
    padding: 5px 5px 5px 20px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    scrollbar-gutter: stable; /* Резервирует место под скроллбар */
}

.edit-route-name-icon {
    background: none; 
    border: none; 
    cursor: pointer;
    font-size: 12px;
    // padding: 4px 4px 4px 8px;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
    filter: grayscale(1);
}

.edit-route-name-icon:hover {
    opacity: 1;
}

/* Тип Маршрута */
.route-actions-type {
    display: flex;
    justify-content: center;
    // margin: 30px 0;
}
.route-actions-type .route-type-label {
    // width: 180px;
    transition: all ease 250ms;
}
.route-actions-type .route-type-label input {
    display: none;
}
.route-actions-type .route-type-label .radio-input {
    background: transparent;
    text-align: center;
    padding: 3px;
    //border-radius: 10px;
    cursor: pointer;
    margin: 0 2px;
    position: relative;
    transition: all ease 250ms;
    //border: 4px solid #BFE2FF; 
    display: block;
}
.route-actions-type .route-type-label:hover .radio-input {
    //box-shadow: 0 2px 5px rgba(0,0,0,0.2), 0 6px 12px rgba(0,0,0,0.2);
}
.route-actions-type .route-type-label .radio-input i {
    display: block;
    font-size: 16px;
    color: rgb(67 67 67 / 30%);
    //font-weight: bold;  
}
.route-actions-type .route-type-label .radio-input img {
    width: 70px; 
}
.route-actions-type .route-type-label .radio-input span {
    font-family: Tahoma, sans-serif;
    letter-spacing: 1px;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    display: block;
    margin-top: 16px;
    color: #AAA;
}
.route-actions-type .route-type-label input:checked + .radio-input span {
    color: #444444;
    opacity: 1;
    transition: opacity ease 250ms;
}
.route-actions-type .route-type-label input:checked + .radio-input:after {
 
}
.route-actions-type .route-type-label input:checked + .radio-input {
    //border: 4px solid #337AB7;
    //background: rgba(0, 122, 255, 0.1);
}
.route-actions-type .route-type-label input:checked + .radio-input:after,
.route-actions-type .route-type-label input:checked + .radio-input i {
    //color: #337AB7;
    color: #333;
}
@keyframes animation {
    0% {
        transform: translateY(-50%) scale(0);
    }
    75% {
        transform: translateY(-50%) scale(1.3);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}
@media screen and (max-width: 768px) {
    .route-actions-type {
        display: block;
    }
    .route-actions-type .route-type-label {
        width: 100%;
        margin-bottom: 30px;
    }
}

.route-type-label:hover {
    //background: #e0e0e0;
}

/* Карточка точки */
.point-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: move;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.point-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.point-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.point-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding-right: 30px;
}

.point-number {
    background: #007AFF;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex; 
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 10px;    
}

.point-address {
    font-weight: 500;
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.point-content {
    display: flex;
}

.point-city {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
}

.point-street {
    font-size: 0.95em;
    color: #666;
    margin-top: 2px;
}

.point-place {
    font-size: 0.9em;
    color: #888;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #eee;
}

.point-delete {
    position: absolute;
    top: 3px;
    right: 3px;
    background: none;
    border: none;
    font-size: 1.0rem;
    cursor: pointer;
    color: #999;
    padding: 3px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.point-delete:hover {
    /* background: #ff3b30; */
    color: #ff3b30;
	font-weight: 900;
}

.point-info {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #666;
}

.point-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.point-info-item span:first-child {
    color: #999;
}

.point-name {
    font-weight: 600;
    font-size: 1em;
    color: #333;
    /* flex: 1; */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.point-edit {
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 4px 4px 8px;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
	filter: grayscale(1);
}

.point-edit:hover {
    opacity: 1;
}


/* Итоговая информация */
.summary {
    margin: 10px 20px 10px 20px;
    padding: 15px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(0, 122, 255, 0.2);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item span:first-child {
    color: #666;
}

.summary-item span:last-child {
    font-weight: 600;
    color: #007AFF;
}

/* Кнопка доната */
.donat {

}

.donat-bg {
    position: absolute;
    bottom: 65px;
    right: 115px;
    padding: 10px 20px 20px 20px;
    border-top-left-radius: 10px;
	border-top-right-radius: 10px;
	background: rgb(255 255 255 / 95%);
    color: #333333;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;	
}

.donat-btn {
    position: absolute;
    bottom: 20px;
    right: 1px;
    // padding: 12px 24px;
    // background: rgba(255, 255, 255, 0.95);
    //backdrop-filter: var(--blur);
    //border: 1px solid rgba(255, 59, 48, 0.3);
    //border-radius: 30px;
    //color: #ff3b30;
    //font-weight: 500;
    // cursor: pointer;
    z-index: 1000;
    //box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    //transition: all 0.2s;	
}

/* Кнопка очистки */
.clear-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--blur);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 30px;
    color: #ff3b30;
    font-weight: 500;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.clear-btn:hover {
    background: #ff3b30;
    color: white;
    border-color: #ff3b30;
}

/* Индикатор загрузки */
.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #ccc;
    border-top-color: #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Адаптивность */
@media (max-width: 768px) {
    .sidebar {
        width: 300px;
    }
    
    .sidebar.collapsed {
        transform: translateX(-280px);
    }
}

/* Контекстное меню */
.context-menu {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 220px;
    z-index: 10000;
    display: none;
    backdrop-filter: var(--blur);
    background: var(--bg-menu-color);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    padding: 10px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    font-size: 14px;
    color: #333;
}

.context-menu-item:hover {
    // background: rgba(0, 102, 204, 0.1);
     background: var(--bg-hover-color);
}

.context-menu-item:active {
    background: rgba(0, 102, 204, 0.2);
}

.context-menu-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.context-menu-text {
    flex: 1;
}


/* Контейнер меню */
.route-menu {
    position: relative;
}

/* Кнопка меню маршрутов*/
.route-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 5px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 32px;
    transition: background 0.2s;
}

.route-btn:hover {
    background: rgba(0, 102, 204, 0.1);
}

.route-line {
    width: 100%;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: 0.2s;
}

/* Контекстное меню Маршрутов */
.context-route-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--bg-menu-color);
    backdrop-filter: var(--blur);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 220px;
    z-index: 10000;
    border: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.context-route-menu.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Пункт меню Маршрутов*/
.context-route-menu-item {
    padding: 10px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    font-size: 14px;
    color: #222;
    position: relative;
}

.context-route-menu-item:hover {
    background: var(--bg-hover-color);
}

.context-route-menu-item:active {
    background: rgba(0, 102, 204, 0.2);
}

/* Пункт с подменю */
.has-route-submenu {
    position: relative;
}

.has-route-submenu::after {
    content: "›";
    position: absolute;
    right: 16px;
    font-size: 18px;
    color: #999;
    transition: transform 0.2s;
}

/* Подменю */
.route-submenu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 2px;
    background: rgba(252, 252, 252, 0.9);
    backdrop-filter: var(--blur);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 200px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s;
    z-index: 10001;
}

.has-route-submenu:hover .route-submenu {
    opacity: 1;
    visibility: visible;
}

/* Корректировка для правого края экрана — если не влезает, подменю влево */
@media (max-width: 768px) {
    .has-route-submenu .route-submenu {
        left: auto;
        right: 100%;
        margin-left: 0;
        margin-right: 2px;
    }
}

/* Иконка */
.context-route-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.context-route-text {
    flex: 1;
}

/* End меню Маршрутов*/

/* Темная тема (если будет) */
.dark-theme .context-menu {
    background: rgba(40, 40, 45, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.dark-theme .context-menu-item {
    color: #eee;
}

.dark-theme .context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Cookie баннер */
.cookie-banner {
    position: fixed;
    bottom: 40px;
    left: 50%;
    max-width: 100%;
    transform: translateX(-50%);
    //left: 800px;
    //right: 800px;
    background: rgba(51, 61, 81, 0.85);
    backdrop-filter: var(--blur);
    color: white;
    padding: 12px 20px;
    z-index: 10000;
    text-align: center;
    font-size: 14px;
	border-radius: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.cookie-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-btn {
    // background: #0066CC;
    // color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.cookie-btn:hover {
    color: #515151;
}

/* Иконка cookie (🍪) */
/*.cookie-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('/assets/images/icons/cookie.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 8px;
    vertical-align: middle;
}*/

/* Приветственный попап */
.welcome-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.welcome-content {
    position: relative;
    background: white;
    border-radius: 24px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.welcome-content h2 {
    margin: 0 0 12px 0;
    font-size: 28px;
    color: #333;
}

.welcome-content h3 {
    // margin: 0 0 12px 0;
    font-size: 24px;
    color: #333;
}

.welcome-content p {
    margin: 0 0 24px 0;
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

.welcome-btn {
    // background: #0066CC;
    // color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.welcome-btn:hover {
    color: #515151;
}

/* Иконка приветствия */
.welcome-icon {
    //width: 200px;
    height: 200px;
    margin: 0 auto;
    background-image: url('/assets/images/icons/welcome-icon.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}