/* ============================================================
   DOX.CSS – Стили для страницы "Сертификаты" (Fix Z-Index & Gold Hover)
   ============================================================ */

.cert-section {
    padding: 20px 0 80px;
}
.cert-section h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--bg-dark);
    letter-spacing: 0.02em;
    margin-bottom: 40px;
    text-align: center;
}
.cert-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.cert-item {
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
    cursor: pointer;
    aspect-ratio: 3/4;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.cert-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
}
.cert-item img {
    width: 100%; height: 100%; object-fit: contain;
    display: block; transition: transform 0.4s, border-color 0.4s ease, box-shadow 0.4s ease;
    border-radius: 8px; background: #fff; padding: 4px;
    border: 2px dashed var(--accent-blue);
}
.cert-item:hover img {
    transform: scale(1.04); border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(220, 179, 107, 0.4);
}
.cert-item::after {
    content: ''; position: absolute; bottom: 12px; left: 12px;
    width: calc(100% - 24px); height: 60%;
    background: linear-gradient(to top, rgba(14, 41, 66, 0.15), transparent);
    border-radius: 0 0 8px 8px; opacity: 0; transition: opacity 0.4s ease;
    pointer-events: none; z-index: 1;
}
.cert-item:hover::after { opacity: 1; }
.cert-item .zoom-overlay {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 50px; height: 50px; background: rgba(255,255,255,0.9);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2; pointer-events: none;
}
.cert-item:hover .zoom-overlay { transform: translate(-50%, -50%) scale(1); }
.cert-item .zoom-overlay svg {
    width: 24px; height: 24px; stroke: var(--bg-dark);
    fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

/* МОДАЛЬНОЕ ОКНО СЕРТИФИКАТОВ (ПОВЕРХ ШАПКИ НА 100%) */
.cert-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(14, 41, 66, 0.92); backdrop-filter: blur(8px);
    z-index: 9999999 !important; /* ВЫШЕ ШАПКИ */
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 20px;
    box-sizing: border-box;
}
.cert-modal.active { opacity: 1; visibility: visible; }
.cert-modal .modal-content {
    position: relative; max-width: 90vw; max-height: 90vh;
    width: auto; height: auto;
    display: flex; align-items: center; justify-content: center;
}
.cert-modal .modal-content img {
    max-width: 80vw; max-height: 85vh; object-fit: contain;
    border-radius: 8px; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.9); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.cert-modal.active .modal-content img { transform: scale(1); }

/* КНОПКИ СТРЕЛОК */
.cert-modal .nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 50px; height: 50px; background: #ffffff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25); cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 10;
    border: none !important; outline: none !important;
}
.cert-modal .nav-btn:hover { 
    transform: translateY(-50%) scale(1.1); 
    background: var(--accent-gold); 
}
.cert-modal .nav-btn.prev { left: 20px; }
.cert-modal .nav-btn.next { right: 20px; }
.cert-modal .nav-btn svg {
    width: 24px; height: 24px; stroke: var(--bg-dark);
    fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

/* КНОПКА ЗАКРЫТЬ С ЗОЛОТЫМ ХОВЕРОМ */
.cert-modal .close-btn {
    position: absolute; top: 25px; right: 30px;
    width: 46px; height: 46px; background: #ffffff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25); cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 10;
    border: none !important; outline: none !important;
}
.cert-modal .close-btn:hover { 
    transform: rotate(90deg) scale(1.1); 
    background: var(--accent-gold); /* ЗОЛОТОЙ ХОВЕР */
}
.cert-modal .close-btn svg {
    width: 22px; height: 22px; stroke: var(--bg-dark);
    fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

@media (max-width: 1024px) { .cert-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
    .cert-grid { grid-template-columns: 1fr; gap: 20px; }
    .cert-item { aspect-ratio: 3/4; }
    .cert-modal .nav-btn { width: 42px; height: 42px; }
    .cert-modal .nav-btn.prev { left: 10px; }
    .cert-modal .nav-btn.next { right: 10px; }
    .cert-modal .close-btn { top: 15px; right: 15px; width: 42px; height: 42px; }
    .cert-modal .modal-content img { max-width: 90vw; max-height: 75vh; }
}
@media (max-width: 480px) { .cert-section h2 { font-size: 28px; } }