:root {
    --primary-color: #4A90E2;
    --accent-color: #FDCB6E;
    --bg-color: #F8F9FA;
    --text-color: #2D3436;
    --card-bg: #FFFFFF;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --light-blue: #E8F4F8;
    --light-green: #E8F5E9;
    --light-yellow: #FFF9E6;
    --light-purple: #F3E5F5;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

header {
    background: linear-gradient(135deg, #4A90E2 0%, #74B9FF 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 15px rgba(74, 144, 226, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

nav {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

nav a:hover {
    opacity: 0.8;
}

/* Выпадающее меню */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.2s;
}

.dropdown-toggle:hover {
    opacity: 0.8;
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-top: 0.25rem;
    padding: 0.5rem 0;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
}

/* Создаем невидимый мост между кнопкой и меню */
.dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.25rem;
    display: none;
}

.dropdown:hover::before {
    display: block;
}

.dropdown-menu a {
    color: var(--text-color);
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    font-size: 1rem;
}

.dropdown-menu a:hover {
    background: var(--bg-color);
    opacity: 1;
}

/* Гамбургер меню */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    border: none;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4A90E2 0%, #74B9FF 100%);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    padding: 1rem 0;
    z-index: 999;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: 1rem 20px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.mobile-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu a:last-child {
    border-bottom: none;
}

.mobile-submenu {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 2rem;
}

.mobile-submenu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
    color: white;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    user-select: none;
}

.mobile-submenu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-submenu-toggle::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.mobile-submenu-toggle.active::after {
    transform: rotate(180deg);
}

.mobile-submenu-content {
    display: none;
}

.mobile-submenu-content.active {
    display: block;
}

main {
    padding: 3rem 0;
    min-height: 80vh;
    overflow-x: hidden;
    overflow-y: visible;
}

@media (max-width: 768px) {
    main {
        padding: 0.75rem 0 2rem 0;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0.5rem 0 1.5rem 0;
    }
}

footer {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

footer h3 {
    font-size: 1.1rem;
}

footer ul {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    footer {
        padding: 1.5rem 0;
        margin-top: 3rem;
    }

    footer h3 {
        font-size: 1rem;
    }

    footer ul {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    footer {
        padding: 1rem 0;
        margin-top: 2rem;
    }

    footer h3 {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }

    footer ul {
        font-size: 0.8rem;
    }

    footer li {
        margin-bottom: 0.4rem !important;
    }
}

.widget-container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    margin-bottom: 3rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    overflow-y: visible;
    overflow: visible !important;
    position: relative;
}

/* Разрешаем выпадающим спискам виджетов выходить за пределы контейнера */
.widget-container > * {
    position: relative;
    z-index: 1;
}

.widget-container iframe,
.widget-container script + * {
    position: relative;
}

/* Исправление проблемы с выпадающими списками в виджетах */
.widget-container [class*="dropdown"],
.widget-container [class*="select"],
.widget-container [class*="autocomplete"] {
    overflow: visible !important;
    z-index: 1000 !important;
}

.widget-container [class*="dropdown"] [class*="menu"],
.widget-container [class*="select"] [class*="menu"],
.widget-container [class*="autocomplete"] [class*="menu"],
.widget-container [class*="dropdown"] [class*="list"],
.widget-container [class*="select"] [class*="list"],
.widget-container [class*="autocomplete"] [class*="list"] {
    position: absolute !important;
    z-index: 1001 !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    overflow-x: visible !important;
}

h1 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

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

@media (max-width: 768px) {
    .route-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    /* Убираем padding-top у main.container на мобильных и планшетах */
    main.container {
        padding-top: 0 !important;
    }
}

@media (max-width: 480px) {
    .route-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.route-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    border: 2px solid #E8F4F8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
}

@media (max-width: 480px) {
    .route-card {
        padding: 15px;
        min-height: 70px;
    }
    
    /* Убираем padding-top у main.container на мобильных */
    main.container {
        padding-top: 0 !important;
    }
}

.route-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(74, 144, 226, 0.15);
    border-color: var(--primary-color);
    background: #F0F8FF;
}

.route-card strong {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #FDCB6E 0%, #F39C12 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(253, 203, 110, 0.3);
}

.btn:hover {
    background: linear-gradient(135deg, #F39C12 0%, #E67E22 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(253, 203, 110, 0.4);
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #E8F4F8;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.breadcrumbs {
    padding: 1rem 0;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--accent-color);
}

.breadcrumbs span {
    margin: 0 8px;
    color: #999;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo:hover {
    opacity: 0.9;
}

footer a:hover {
    color: white !important;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    header {
        padding: 1rem 0;
    }

    .header-content {
        position: relative;
    }

    .menu-toggle {
        display: flex;
    }

    nav {
        display: none;
    }

    .logo {
        font-size: 1.5rem;
    }

    main {
        padding: 2rem 0;
    }

    footer .container > div:first-child {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .widget-container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .search-input {
        padding: 10px 15px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    header {
        padding: 0.8rem 0;
    }

    .logo {
        font-size: 1.3rem;
    }

    .menu-toggle {
        width: 35px;
        height: 35px;
    }

    .menu-toggle span {
        width: 20px;
        height: 2px;
    }

    main {
        padding: 1.5rem 0;
    }

    .widget-container {
        padding: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .route-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .route-card {
        padding: 15px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .search-input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .breadcrumbs {
        font-size: 0.85rem;
        padding: 0.8rem 0;
    }
}

