/* DOMATORIA - karty techniczne PDF na stronie produktu (skrypt: js/dm-pdf.js).
   - kafelek z okladka przyklejony do prawej krawedzi ekranu
   - przegladarka PDF na pelnym ekranie (otwierana animacja z kafelka)
   - karty plikow w miejscu dawnej listy "Pliki do pobrania" */

/* ---------- dawna lista plikow (zastepowana przez skrypt) ---------- */
.productfiles.dm-pdf-replaced > h5,
.productfiles.dm-pdf-replaced > ul.productfiles {
    display: none;
}

/* ---------- karty plikow w opisie ---------- */
.dm-files {
    margin: 32px 0 8px;
    padding-top: 24px;
    border-top: 1px solid #e8e8e8;
}

.dm-files__title {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #777;
}

.dm-files__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dm-file {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid #e3e3e3;
    background: #fff;
    transition: border-color .2s ease;
}

.dm-file:hover {
    border-color: #111;
}

.dm-file__cover {
    position: relative;
    flex: 0 0 64px;
    width: 64px;
    aspect-ratio: 210 / 297;
    overflow: hidden;
    border: 0;
    padding: 0;
    background: #f2f2f2;
    cursor: zoom-in;
}

.dm-file__cover canvas,
.dm-pdf-tab__cover canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.dm-file__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.dm-file__name {
    overflow: hidden;
    color: #111;
    font-size: 14px;
    line-height: 1.35;
    text-overflow: ellipsis;
}

.dm-file__meta {
    color: #999;
    font-size: 12px;
}

.dm-file__actions {
    display: flex;
    gap: 16px;
}

.dm-file__actions a,
.dm-file__actions button {
    padding: 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: none;
    color: #111;
    font: inherit;
    font-size: 13px;
    text-decoration: none !important;
    cursor: pointer;
}

.dm-file__actions a:hover,
.dm-file__actions button:hover {
    color: #777;
}

/* ---------- kafelek przy prawej krawedzi ---------- */
.dm-pdf-tab {
    position: fixed;
    top: 50%;
    right: 0;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 112px;
    padding: 8px 8px 10px;
    border: 0;
    border-radius: 6px 0 0 6px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .14), 0 1px 3px rgba(0, 0, 0, .08);
    color: #111;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transform: translate(110%, -50%);
    transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .25s ease;
}

.dm-pdf-tab.is-ready {
    transform: translate(0, -50%);
}

.dm-pdf-tab.is-ready:hover {
    transform: translate(-6px, -50%);
    box-shadow: 0 10px 32px rgba(0, 0, 0, .2), 0 1px 3px rgba(0, 0, 0, .08);
}

.dm-pdf-tab.is-hidden {
    visibility: hidden;
}

.dm-pdf-tab__cover {
    position: relative;
    width: 100%;
    aspect-ratio: 210 / 297;
    overflow: hidden;
    background: #f2f2f2;
}

/* delikatny "plik" - druga kartka pod okladka */
.dm-pdf-tab__cover::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
    pointer-events: none;
}

.dm-pdf-tab__label {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.25;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.dm-pdf-tab__count {
    display: block;
    margin-top: 2px;
    color: #999;
    font-size: 11px;
}

.dm-pdf-tab:focus-visible,
.dm-pdf-viewer button:focus-visible,
.dm-pdf-viewer a:focus-visible,
.dm-file button:focus-visible,
.dm-file a:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .dm-pdf-tab {
        top: auto;
        bottom: 96px;
        width: 72px;
        padding: 5px 5px 6px;
        transform: translateX(110%);
    }

    .dm-pdf-tab.is-ready,
    .dm-pdf-tab.is-ready:hover {
        transform: none;
    }

    .dm-pdf-tab__label {
        margin-top: 5px;
        font-size: 9px;
        letter-spacing: .04em;
    }

    .dm-pdf-tab__count {
        display: none;
    }
}

/* ---------- przegladarka na pelnym ekranie ---------- */
html.dm-pdf-open,
html.dm-pdf-open body {
    overflow: hidden;
}

.dm-pdf-viewer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    background: #1b1b1d;
    color: #fff;
    transform-origin: 0 0;
    will-change: transform, opacity;
}

.dm-pdf-viewer[hidden] {
    display: none;
}

.dm-pdf-viewer.is-animating {
    transition: transform .55s cubic-bezier(.2, .75, .15, 1), border-radius .55s ease, opacity .3s ease;
}

.dm-pdf-viewer.is-animating .dm-pdf-viewer__bar,
.dm-pdf-viewer.is-animating .dm-pdf-viewer__pages {
    transition: opacity .3s ease .2s;
}

.dm-pdf-viewer.is-collapsed .dm-pdf-viewer__bar,
.dm-pdf-viewer.is-collapsed .dm-pdf-viewer__pages {
    opacity: 0;
    transition-delay: 0s;
}

.dm-pdf-viewer__bar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 12px 8px 20px;
    background: #111;
}

.dm-pdf-viewer__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    letter-spacing: .02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-pdf-viewer__files {
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.dm-pdf-viewer__files button {
    padding: 6px 10px;
    border: 1px solid #444;
    background: none;
    color: #bbb;
    font: inherit;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
}

.dm-pdf-viewer__files button[aria-pressed="true"] {
    border-color: #fff;
    color: #fff;
}

.dm-pdf-viewer__page {
    color: #bbb;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dm-pdf-viewer__tools {
    display: flex;
    align-items: center;
    gap: 2px;
}

.dm-pdf-viewer__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: #fff;
    cursor: pointer;
    text-decoration: none !important;
}

.dm-pdf-viewer__btn:hover {
    background: #2a2a2d;
}

.dm-pdf-viewer__btn svg {
    width: 22px;
    height: 22px;
}

.dm-pdf-viewer__pages {
    flex: 1 1 auto;
    overflow: auto;
    padding: 24px 16px 48px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.dm-pdf-viewer__sheet {
    position: relative;
    margin: 0 auto 16px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .45);
}

.dm-pdf-viewer__sheet canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.dm-pdf-viewer__loading {
    margin: 20vh auto 0;
    color: #999;
    font-size: 14px;
    text-align: center;
}

@media (max-width: 767px) {
    .dm-pdf-viewer__bar {
        flex-wrap: wrap;
        gap: 4px 8px;
        padding: 6px 6px 6px 14px;
    }

    .dm-pdf-viewer__title {
        flex-basis: calc(100% - 100px);
        font-size: 13px;
    }

    .dm-pdf-viewer__files {
        order: 3;
        flex-basis: 100%;
    }

    .dm-pdf-viewer__pages {
        padding: 12px 8px 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dm-pdf-tab,
    .dm-pdf-viewer.is-animating,
    .dm-pdf-viewer.is-animating .dm-pdf-viewer__bar,
    .dm-pdf-viewer.is-animating .dm-pdf-viewer__pages {
        transition: none;
    }
}
