/* Базовые стили */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    font-weight: 300;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Запрет прокрутки при открытом бургер-меню */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

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

/* Шапка */
.site-header {
    background: #293844;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.site-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    z-index: -1;
}

.header-right-group {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-shrink: 0;
}

.header-contacts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    color: white;
    font-size: 0.9rem;
    margin-right: 15px;
}

.header-hours {
    white-space: nowrap;
    font-weight: 500;
}

.header-email {
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.header-email:hover {
    color: #e67e22;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-phones {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.header-phone {
    color: white;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease;
    font-size: 0.95em;
}

.header-phone:hover {
    color: #e67e22;
}

.logo img {
    height: 90px;
    width: auto;
    transition: all 0.3s;
}

.help-button {
    background: #e67e22;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    margin-left: 0;
    order: 2;
    cursor: pointer;
    border-radius: 25px;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.help-button:hover {
    background: #d35400;
}

main {
    flex: 1 0 auto;
    padding: 20px 0;
}

.main-nav {
    display: flex;
}

.main-nav ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #e67e22;
}

.main-nav li {
    position: relative;
}

.main-nav .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: -20px;
    background: #2c3e50;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.main-nav li:hover .dropdown {
    display: block;
}

.main-nav .dropdown li {
    padding: 0.5rem 1rem;
}

.main-nav .dropdown a {
    color: white !important;
    font-size: 1rem;
    z-index: 1000;
    min-width: auto;
    padding: 0.5rem 1.5rem;
    white-space: nowrap;
}

.main-nav .dropdown a:hover {
    color: #e67e22 !important;
}

/* Бургер меню */
.burger-menu {
    display: none;
}

.burger-checkbox {
    position: absolute;
    visibility: hidden;
}

.burger {
    position: relative;
    z-index: 1;
    cursor: pointer;
    display: block;
    border: none;
    background: transparent;
    width: 30px;
    height: 24px;
}

.burger::before,
.burger::after {
    content: '';
    left: 0;
    position: absolute;
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    transition: all 0.3s ease;
    transform-origin: center;
}

.burger span {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
    transform-origin: center;
    top: 50%;
    transform: translateY(-50%);
}

.burger::before {
    top: 0;
    transform: translateY(0);
}

.burger::after {
    bottom: 0;
    transform: translateY(0);
}

.burger-checkbox:checked + .burger::before {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.burger-checkbox:checked + .burger::after {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

.burger-checkbox:checked + .burger span {
    opacity: 0;
}

.burger-checkbox:checked ~ .mobile-menu {
    top: 100%; 
    position: absolute;
    width: 100%;
    left: 0;
}

.burger:hover::before,
.burger:hover::after {
    background: #e67e22;
}

.burger:hover span {
    background: #e67e22 !important;
}


/* Основной контент */
.table {
    width: 100%;
    border: none;
    margin-bottom: 20px;
    border-collapse: separate;
}

.table thead th {
    font-weight: bold;
    text-align: left;
    border: none;
    padding: 10px 15px;
    background: #EDEDED;
    font-size: 14px;
    border-top: 1px solid #ddd;
}

.table tr th:first-child, .table tr td:first-child {
    border-left: 1px solid #ddd;
}

.table tr th:last-child, .table tr td:last-child {
    border-right: 1px solid #ddd;
}

.table thead tr th:first-child {
    border-radius: 20px 0 0 0;
}

.table thead tr th:last-child {
    border-radius: 0 20px 0 0;
}

.table tbody td {
    text-align: left;
    border: none;
    padding: 10px 15px;
    font-size: 14px;
    vertical-align: top;
}

.table tbody tr:nth-child(even) {
    background: #F8F8F8;
}

.table tbody tr:last-child td {
    border-bottom: 1px solid #ddd;
}

.table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 20px;
}

.table tbody tr:last-child td:last-child {
    border-radius: 0 0 20px 0;
}

/* Стили для внутренних заголовков */
.header_table2 {
    text-align: center !important;
}

.table thead tr th:first-child,
.table thead tr th:last-child {
    border-radius: 0; /* Сбрасываем закругление для других элементов */
}

.table tbody th {
    background: #EDEDED;
    font-weight: bold;
    padding: 10px 15px;
    border-top: 1px solid #ddd;
    text-align: left;
}

/* Выравнивание ширины столбцов */
.table td, .table th {
    width: 33.33%;
}

/* Отступы для таблиц */
.hero .container {
    padding-top: 2rem; /* Отступ от шапки до первой таблицы */
    padding-bottom: 2rem; /* Отступ от второй таблицы до подвала */
}

.sponsors-text {
    margin: 2rem 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.sponsors-text h2 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #EDEDED;
    padding-bottom: 10px;
}

.sponsors-text ol {
    list-style-type: none;
    counter-reset: sponsor-counter;
    padding-left: 25px;
}

.sponsors-text ol li {
    counter-increment: sponsor-counter;
    margin-bottom: 1rem;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
    padding-left: 35px;
}

.sponsors-text ol li::before {
    content: counter(sponsor-counter) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    color: #3498db;
    font-size: 16px;
}

.sponsors-text p {
    font-size: 15px;
    line-height: 1.7;
    margin-top: 1.5rem;
    color: #34495e;
    text-align: justify;
}

/* Подвал */
.site-footer {
    background: #293844;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer {
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-left {
    text-align: left;
}

.footer-right {
    text-align: right;
}

.work-time {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.work-time span {
    font-size: 0.9em;
    color: #666;
}

.footer-copyright {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.footer-email {
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.footer-email:hover {
    color: #e67e22;
}

.footer-phone {
    color: white;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease;
    font-size: 0.95em;
}

.footer-phone:hover {
    color: #e67e22;
}

@media screen and (orientation: landscape) and (max-width: 1024px) {
    .header-contacts {
        display: none;
    }

    .main-nav a {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    .main-nav ul {
        gap: 10px;
    }

    .header-row {
        gap: 10px;
    }
}

@media (min-width: 769px) {
    .main-nav {
        display: flex !important;
    }
}

@media (max-width: 768px) {

    .site-header {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .header-row {
        padding: 15px 0;
    }

    .header-right-group {
        order: 2;
    }
    
    .header-contacts {
        margin-right: 0.5rem;
    }

    .header-contacts,
    .header-phone {
        display: none;
    }

    .logo img {
        height: 70px;
    }

    .help-button {
        order: 1;
        margin-left: auto;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #293844;
        padding: 20px;
    }

    .main-nav li {
        padding: 0.5rem 0;
    }

    .main-nav.active {
        display: block;
        border-top-color: #405365;
    }
    
    .main-nav .dropdown {
        position: static;
        display: none;
        background: transparent;
        box-shadow: none;
        padding: 0 0 0 20px;
    }
    
    .main-nav .dropdown li {
        padding: 0;
    }

    .main-nav li:hover .dropdown {
        display: block;
    }

    .main-nav .dropdown a {
        padding: 12px 0;
        font-size: 1rem;
        color: #e67e22;
    }

    .main-nav > ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav > ul > li {
        width: 100%;
        border-bottom: 1px solid #405365;
    }
    
    .main-nav > ul > li > a {
        display: block;
        padding: 15px 0;
        font-size: 1.2rem;
    }

    .burger-menu {
        display: block;
        margin-left: 15px;
        order: 3;
    }

    /* Адаптация таблиц */
    .table {
        display: block;
        width: 100%;
        overflow-x: visible;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin: 1rem 0;
    }

    .table thead {
        display: none;
    }

    .table tbody {
        display: block;
        width: 100%;
    }

    .table tbody tr {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid #ddd;
        background: #fff;
    }

    .table tbody tr:last-child {
        border-bottom: none;
    }

    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.8rem 0;
        font-size: 15px;
        border: none !important;
        width: 100% !important;
    }

    .table td[data-label="Организация"] {
        font-weight: 500;
        color: #4c77ee;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: #2c3e50;
        margin-right: 1rem;
        flex: 0 0 45%;
        font-size: 14px;
    }

    .table tbody tr:nth-child(even) {
        background: #f8f8f8;
    }
    
    .table td:not(:last-child) {
        border-bottom: 1px solid #eee;
    }

    /* Специфические стили для объединенных ячеек */
    .table tbody th[colspan] {
        display: block;
        width: 100%;
        text-align: center;
        padding: 1rem;
        background: #EDEDED;
        font-size: 16px;
        margin: 1rem 0;
    }

    /* Адаптация заголовочных строк */
    .table tbody tr:has(th) {
        background: #EDEDED;
        border-radius: 8px;
        margin: 1rem 0;
    }

    /* Текстовая секция */
    .sponsors-text {
        padding: 15px;
        margin: 20px 0;
    }

    .sponsors-text h2 {
        font-size: 20px;
    }

    .sponsors-text ol li {
        font-size: 14px;
        padding-left: 25px;
    }

    .sponsors-text p {
        font-size: 14px;
    }

    .footer-row {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-left,
    .footer-right {
        text-align: center;
        width: 100%;
    }
    
    .work-time {
        align-items: center;
    }

    .burger-checkbox:checked ~ .main-nav {
        display: block;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .table td {
        font-size: 13px;
        padding: 6px 10px;
    }

    .table td::before {
        flex: 0 0 100px;
    }

    .header-row {
        padding: 10px 0;
    }

    .logo img {
        height: 60px;
    }

    .help-button {
        padding: 8px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .table td {
        font-size: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .table td::before {
        margin-bottom: 5px;
        flex: 0 0 100%;
    }

    .sponsors-text ol li {
        padding-left: 20px;
    }

    .sponsors-text ol li::before {
        font-size: 14px;
    }
}