/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Georgian', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Header и Navigation */
header {
    display: none;
}

@media (max-width: 768px) {
    header {
        display: block;
        background-color: transparent;
        color: #fff;
        padding: 0;
        box-shadow: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        height: 50px;
    }
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Гамбургер-меню для мобильных */
.menu-toggle {
    display: none;
}

.menu-toggle-label {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.75rem;
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1001;
    background-color: #2c3e50;
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.menu-toggle-label span {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
    display: block;
}

/* Боковая панель с меню */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background-color: #2c3e50;
    color: #fff;
    padding: 1rem 0;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    z-index: 99;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}


/* Навигационное меню */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
    margin: 0;
    flex: 1;
}

.nav-menu li {
    margin: 0;
    width: 100%;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 1rem;
    display: block;
    transition: background-color 0.3s;
    border-radius: 4px;
    width: 100%;
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-menu a.active {
    background-color: #3498db;
    font-weight: bold;
}

/* Дочерние пункты меню (подразделы) */
.nav-menu-children {
    list-style: none;
    padding: 0.25rem 0 0 1rem;
    margin: 0.25rem 0 0 0;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.nav-menu-children li {
    margin: 0;
}

.nav-menu-children a {
    padding: 0.5rem 0.75rem;
    font-size: 0.95em;
}

/* Переключатель языков */
.nav-menu > li.language-switcher {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    flex-wrap: nowrap;
    width: 100%;
}

.language-switcher .lang-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    width: auto;
    flex-shrink: 0;
}

.lang-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.lang-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.flag-icon {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Копирайт в боковой панели */
.sidebar-copyright {
    padding: 1rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-copyright p {
    margin: 0;
    padding: 0;
}

/* Main контент */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    display: flex;
    flex: 1;
    margin-top: 0;
}

main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 2rem 2.5rem;
    margin-left: 250px;
    min-height: calc(100vh - 60px);
}

main h1, main h2, main h3, main h4, main h5, main h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

main p {
    margin-bottom: 1rem;
}

main a {
    color: #3498db;
    text-decoration: none;
}

main a:hover {
    text-decoration: underline;
}

main ul, main ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

main code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

main pre {
    background-color: #f4f4f4;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

main pre code {
    background-color: transparent;
    padding: 0;
}

main blockquote {
    border-left: 4px solid #3498db;
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 1rem;
    color: #666;
    font-style: italic;
}

/* Описание страницы */
.page-description {
    text-align: center;
    margin-bottom: 0;
    padding: 0;
}

/* Стили для сообщений об ошибках */
.error-message {
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
    color: #c33;
}

.error-message p {
    margin: 0;
}

/* Стили для изображения 404 */
main img[alt*="404"] {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Стили для доступных языков на странице 404 */
.available-languages {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.available-languages h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.available-languages ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.available-languages li {
    margin: 0.5rem 0;
}

.available-languages a {
    color: #3498db;
    text-decoration: none;
    padding: 0.5rem;
    display: inline-block;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.available-languages a:hover {
    background-color: #e8f4f8;
    text-decoration: underline;
}

/* Overlay для мобильных устройств */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s;
}

body.menu-open .menu-overlay {
    display: block;
    opacity: 1;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .menu-toggle-label {
        display: flex !important;
        left: 0.5rem !important;
        right: auto;
        top: 0.5rem !important;
        background-color: #2c3e50;
        padding: 0.75rem;
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        align-items: center;
    }
    
    .menu-toggle-label span {
        width: 25px;
        height: 3px;
        background-color: #fff;
        margin: 3px 0;
        transition: 0.3s;
        border-radius: 2px;
        display: block;
    }

    .sidebar {
        left: -100% !important;
        transform: translateX(0);
        transition: left 0.3s ease-in-out, transform 0.3s ease-in-out;
        width: 80%;
        max-width: 300px;
        z-index: 99;
    }

    /* Показываем меню при активации чекбокса */
    body.menu-open .sidebar {
        left: 0 !important;
        transform: translateX(0);
    }
    
    /* Убираем отступ у main на мобильных */
    main {
        margin-left: 0 !important;
        padding: 1rem 1.25rem 2rem;
        width: 100%;
    }
    
    main .page-description {
        padding: 1rem;
    }

    .nav-menu {
        padding: 4rem 1rem 1rem;
        gap: 0;
    }

    .nav-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu a {
        padding: 1rem;
    }

    .language-switcher {
        margin-bottom: 1rem;
        width: 100%;
        justify-content: flex-start;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Анимация гамбургер-кнопки */
    .menu-toggle:checked + .menu-toggle-label span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle:checked + .menu-toggle-label span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle:checked + .menu-toggle-label span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .content-wrapper {
        flex-direction: column;
    }
}

/* Дополнительные стили для улучшения читаемости */
@media (min-width: 769px) {
    .nav-menu {
        justify-content: flex-start;
    }
}

/* Калькулятор лицензий 1С */
.license-calculator {
    margin-top: 1.5rem;
}

.license-calculator__vat {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1rem;
}

.license-calculator__vat--small {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.license-calculator__loading {
    padding: 1.5rem;
    background: #f4f6f8;
    border-radius: 6px;
    color: #2c3e50;
}

.license-calculator__layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 900px) {
    .license-calculator__layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .license-calculator__columns {
        flex: 1;
        min-width: 0;
    }

    .license-calculator__totals {
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 1rem;
    }
}

.license-calculator__section {
    margin-bottom: 1.75rem;
    padding: 1rem 1.25rem;
    background: #fafbfc;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
}

.license-calculator__section-title {
    margin-top: 0 !important;
    font-size: 1.15rem;
    color: #2c3e50;
}

.license-calculator__list {
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}

.license-calculator__list--its .license-calculator__row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
}

.license-calculator__row {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 6px;
}

.license-calculator__row:last-child {
    margin-bottom: 0;
}

.license-calculator__row--inactive {
    opacity: 0.65;
    background: #f5f5f5;
}

.license-calculator__row-main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem 0.75rem;
}

.license-calculator__check,
.license-calculator__radio {
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.license-calculator__label {
    flex: 1;
    min-width: 140px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.license-calculator__row--inactive .license-calculator__label {
    cursor: not-allowed;
}

.license-calculator__name {
    font-weight: 600;
    color: #2c3e50;
}

.license-calculator__meta {
    font-size: 0.85rem;
    color: #666;
}

.license-calculator__price {
    font-weight: 600;
    color: #1a6b3c;
    white-space: nowrap;
    margin-left: auto;
}

.license-calculator__badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #95a5a6;
    color: #fff;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    align-self: flex-start;
}

.license-calculator__row-qty {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e1e4e8;
}

.license-calculator__qty-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #444;
}

.license-calculator__qty {
    width: 5rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.license-calculator__qty:disabled {
    background: #eee;
    cursor: not-allowed;
}

.license-calculator__totals {
    padding: 1.25rem;
    background: #2c3e50;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.license-calculator__totals-title {
    margin: 0 0 0.5rem 0 !important;
    font-size: 1.1rem;
    color: #fff !important;
}

.license-calculator__totals .license-calculator__vat {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1rem;
}

.license-calculator__subtotals {
    margin: 0 0 1rem 0;
}

.license-calculator__subrow {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.95rem;
}

.license-calculator__subrow:last-child {
    border-bottom: none;
}

.license-calculator__subrow dt {
    margin: 0;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.9);
}

.license-calculator__subrow dd {
    margin: 0;
    font-weight: 600;
}

.license-calculator__counts-heading {
    margin: 1rem 0 0.5rem 0 !important;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
}

.license-calculator__counts {
    margin: 0 0 0.5rem 0;
}

.license-calculator__subrow--count {
    font-size: 0.9rem;
}

.license-calculator__subrow--count dd {
    font-variant-numeric: tabular-nums;
}

.license-calculator__grand {
    margin: 0 !important;
    padding-top: 0.75rem;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1.15rem;
}

.license-calculator__grand strong {
    font-size: 1.35rem;
}

.license-calculator__print-wrap {
    margin: 1rem 0 0 0 !important;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.license-calculator__print {
    width: 100%;
    padding: 0.55rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
    background: #ecf0f1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.license-calculator__print:hover {
    background: #fff;
}

.license-calculator__print:focus {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

.license-calculator__print-status {
    margin: 0.5rem 0 0 0 !important;
    font-size: 0.85rem;
    color: #f8c291;
    min-height: 1.2em;
}

.license-calculator__error {
    margin-top: 1rem;
}
