.certs-page {
    padding: 60px 0;
}

.certs-page h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    text-align: center;
}

.certs-page > p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 48px;
}

.certs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 100px;
    max-width: 1000px;
    margin: 0 auto;
}

.cert-item {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.cert-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 28, 11, 0.35);
}

.cert-image {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
    background: #f5f5f5;
}

.cert-caption {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e8ede8;
}

.cert-caption h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--primary-green);
}

.cert-caption p {
    font-size: 0.9rem;
    color: #4a6b5c;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    font-size: 45px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    z-index: 2001;
}

.lightbox-close:hover {
    color: var(--accent-yellow);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: white;
    cursor: pointer;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    transition: 0.2s;
    user-select: none;
    z-index: 2001;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 239, 153, 0.3);
    color: var(--accent-yellow);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px;
    width: fit-content;
    margin: 0 auto;
    border-radius: 30px;
}

/* Если элементов нечётное количество — последний по центру */
.certs-grid .cert-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: 50%; /* Занимает половину ширины сетки, как и обычная карточка */
}