/* Enfini PDF Datasheet Overlay Viewer
   Keeps the visitor on the product page instead of opening the PDF in a
   new tab, which was hurting retention. */

.pdf-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: rgba(17, 17, 17, 0.75);
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}

.pdf-viewer-overlay.is-open {
    display: flex;
    opacity: 1;
}

.pdf-viewer-panel {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 85vh;
    max-height: 900px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.25s ease-in-out;
}

.pdf-viewer-overlay.is-open .pdf-viewer-panel {
    transform: translateY(0);
}

.pdf-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 20px;
    background: #4c2683;
    color: #ffffff;
}

.pdf-viewer-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-viewer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pdf-viewer-actions a,
.pdf-viewer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
    line-height: 1;
}

.pdf-viewer-actions a:hover,
.pdf-viewer-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.pdf-viewer-body {
    flex: 1;
    background: #525659;
    position: relative;
}

.pdf-viewer-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.pdf-viewer-fallback {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 30px;
    color: #ffffff;
}

.pdf-viewer-fallback.is-visible {
    display: flex;
}

.pdf-viewer-fallback a {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 30px;
    background: #4c2683;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
}

body.pdf-viewer-lock {
    overflow: hidden;
}

@media (max-width: 575px) {
    .pdf-viewer-overlay {
        padding: 0;
    }

    .pdf-viewer-panel {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}
