.training-certs {
    margin: 60px auto;
    max-width: 1200px;
    padding: 0 20px;
}

.training-certs__header {
    text-align: center;
    margin-bottom: 30px;
}

.training-certs__header h2 {
    font-size: 34px;
    font-weight: 700;
    color: #222;
    margin: 0;
}

.training-certs__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
}

.training-certs__item {
    width: 280px;
}

.training-certs__thumb {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: #fff;
}

.training-certs__thumb:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

/* =========================
   МОДАЛКА СЕРТИФИКАТОВ
   ========================= */

.cert-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 999999;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 40px 24px;
    box-sizing: border-box;
}

.cert-modal.active {
    display: block;
}

.cert-modal__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 0;
}

.cert-modal__stage {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
    padding-bottom: 20px;
    box-sizing: border-box;
}

.cert-modal__image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(1100px, 92vw);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

/* КРЕСТИК */
.cert-modal__close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 3;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: #ffd54f;
    color: #111;
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cert-modal__close:hover {
    background: #ffca28;
}

/* СТРЕЛКИ */
.cert-modal__nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    background: #ffd54f;
    color: #111;
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cert-modal__nav:hover {
    background: #ffca28;
}

.cert-modal__nav--prev {
    left: 16px;
}

.cert-modal__nav--next {
    right: 16px;
}

.cert-modal__nav.hidden {
    display: none;
}

/* НЕ блокируем body, иначе ломается поведение fixed/scroll на некоторых страницах */
body.cert-modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .training-certs__header h2 {
        font-size: 28px;
    }

    .training-certs__item {
        width: min(100%, 320px);
    }

    .cert-modal {
        padding: 64px 10px 24px;
    }

    .cert-modal__stage {
        min-height: calc(100vh - 88px);
        padding-top: 0;
    }

    .cert-modal__image {
        max-width: 94vw;
        border-radius: 10px;
    }

    .cert-modal__close {
        top: 10px;
        right: 10px;
        width: 48px;
        height: 48px;
        font-size: 32px;
    }

    .cert-modal__nav {
        width: 48px;
        height: 48px;
        font-size: 30px;
    }

    .cert-modal__nav--prev {
        left: 8px;
    }

    .cert-modal__nav--next {
        right: 8px;
    }
}