/* === Documents Section === */
.documents-section {
    background: var(--color-white);
}

.documents-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 48px;
}

.documents-section-title {
    margin: 0 0 48px 0;
    font-family: var(--font-golos-text);
    font-weight: 500;
    font-size: var(--font-size-h2);
    line-height: var(--line-height-tight);
    color: var(--color-dark-gray);
}

.documents-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 48px;
}

/* === Documents Text Content === */
.documents-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* === Documents Certificates (right column) === */
.documents-certificates {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 24px;
}

.documents-cert-thumbs {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 128px;
    width: 100%;
}

.documents-cert-thumb {
    border: 1px solid var(--color-grey-400);
    border-radius: 2px;
    overflow: hidden;
}

.documents-cert-thumb--active {
    border-width: 2px;
    border-color: var(--color-green-main);
}

.documents-cert-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.documents-cert-main {
    flex: 1;
    max-width: 640px;
    border: 1px solid var(--color-grey-400);
    border-radius: 2px;
    padding: 48px;
    cursor: pointer;
}

.documents-cert-main:hover {
    border-color: var(--color-green-main);
}

.documents-cert-main img {
    display: block;
    width: 100%;
    height: auto;
}

/* === Documents Cert Modal === */
.documents-cert-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.documents-cert-modal[hidden] {
    display: none;
}

.documents-cert-modal--open {
    display: flex;
}

.documents-cert-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.documents-cert-modal__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--color-white);
    border-radius: 2px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.documents-cert-modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: var(--color-white);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.documents-cert-modal__close:hover {
    opacity: 0.8;
}

.documents-cert-modal__body {
    padding: 24px;
    overflow: auto;
    max-height: 90vh;
}

.documents-cert-modal__body img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* === Documents Header === */
.documents-header {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.documents-ministry {
    display: flex;
    align-items: center;
    max-width: 489px;
    gap: 24px;
}

.documents-blazon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: block;
}

.documents-ministry-name {
    margin: 0;
    font-family: var(--Font-name-font-text-m-bold, "Golos Text"), var(--font-golos-text);
    font-weight: 700;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-accent-purple);
}

.documents-registry {
    margin: 0;
    font-family: var(--Font-name-font-h3, "Golos Text"), var(--font-golos-text);
    font-weight: 500;
    font-size: var(--font-size-h3);
    line-height: var(--line-height-h3);
    color: var(--color-black);
}

.documents-order {
    margin: 0;
    font-family: var(--font-golos-text);
    font-weight: 400;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-black);
}

/* === Documents Button === */
.documents-button {
    display: inline-flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: transparent;
    border: 1px solid var(--color-grey-400);
    border-radius: 2px;
    text-decoration: none;
    transition: border-color 0.2s ease;
    align-self: flex-start;
}

.documents-button:hover {
    border-color: var(--color-grey-400);
}

.documents-button-label {
    margin: 0;
    font-family: var(--font-golos-text);
    font-weight: 700;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-dark-gray);
}

.useful-links__icon {
    width: var(--spacing-base);
    height: var(--spacing-base);
    color: var(--color-icon-light);
    flex-shrink: 0;
}

/* Поворот стрелки в кнопке документов (вправо-вверх) */
.documents-button .useful-links__icon--arrow {
    transform: rotate(-45deg);
}

/* === Documents Info Title === */
.documents-info-title {
    margin: 0;
    font-family: var(--Font-name-font-h3, "Golos Text"), var(--font-golos-text);
    font-weight: 500;
    font-size: var(--font-size-h3);
    line-height: var(--line-height-h3);
    color: var(--color-black);
}

/* === Documents Info === */
.documents-info-description {
    margin: 0;
    font-family: var(--Font-name-font-text-m, "Golos Text"), var(--font-golos-text);
    font-weight: 400;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-dark-gray);
}

.documents-info-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-grey-250);
    border-radius: 2px;
    overflow: hidden;
}

.documents-info-row {
    display: flex;
    border-top: 1px solid var(--color-grey-250);
}

.documents-info-row:first-child {
    border-top: none;
}

.documents-info-row-label,
.documents-info-row-text {
    margin: 0;
    padding: 16px;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
}

.documents-info-row-label {
    flex: 1 1 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 400;
    color: var(--color-dark-gray);
    border-right: 1px solid var(--color-grey-250);
}

.documents-info-row-text {
    flex: 1 1 0;
    font-family: var(--Font-name-font-text-m, "Golos Text"), var(--font-golos-text);
    font-weight: 400;
    color: var(--color-dark-gray);
}

.documents-info-row-text ul {
    margin: 0 0 var(--gap-base, 16px);
    padding-left: var(--spacing-lg, 24px);
    list-style: disc;
}

.documents-info-row-text ul li {
    margin-bottom: var(--gap-xs, 4px);
}

.documents-info-row-text ul li:last-child {
    margin-bottom: 0;
}


/* === Responsive Design === */
@media (max-width: 1280px) {
    .documents-content {
        flex-direction: column;
    }

    .documents-certificates {
        width: 100%;
    }

    .documents-cert-main {
        max-width: 100%;
    }
}

@media (max-width: 1000px) {
    .documents-container {
        padding: var(--container-padding-md);
    }
}

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

    .documents-section-title {
        margin-bottom: 32px;
    }
    
    .documents-content {
        gap: 32px;
    }

    .documents-certificates {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 16px;
    }

    .documents-cert-main {
        max-width: 100%;
        padding: 24px;
    }

    .documents-cert-thumbs {
        flex-direction: row;
        flex-wrap: nowrap;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 12px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .documents-cert-thumbs::-webkit-scrollbar {
        display: none;
    }

    .documents-cert-thumb {
        flex-shrink: 0;
        width: 80px;
        min-width: 80px;
        cursor: pointer;
        scroll-snap-align: start;
    }

    .documents-cert-thumb img {
        width: 100%;
        height: auto;
    }

    .documents-ministry {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .documents-info-label,
    .documents-info-text {
        max-width: 100%;
    }
}

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

    .documents-section-title {
        margin-bottom: 24px;
    }

    .documents-cert-main {
        padding: 16px;
    }

    .documents-cert-thumb {
        width: 64px;
        min-width: 64px;
    }
}
