.metalwork-product-pdf-grid {
    --metalwork-pdf-ink: #14283a;
    --metalwork-pdf-accent: #d34b32;
    width: 100%;
    color: var(--metalwork-pdf-ink);
    text-align: left;
}

.metalwork-product-pdf-grid__title {
    margin: 0 0 24px;
    color: var(--metalwork-pdf-ink);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
}

.metalwork-product-pdf-grid__items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 200px));
    justify-content: start;
    gap: 16px;
}

.metalwork-product-pdf-grid__card {
    display: flex;
    min-width: 0;
    margin: 0;
    flex-direction: column;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid #dce2e7;
    border-radius: 4px;
    box-shadow: 0 3px 12px rgb(20 40 58 / 7%);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.metalwork-product-pdf-grid__card:hover,
.metalwork-product-pdf-grid__card:focus-visible {
    color: inherit;
    text-decoration: none;
    border-color: var(--metalwork-pdf-accent);
    box-shadow: 0 12px 28px rgb(20 40 58 / 15%);
    transform: translateY(-4px);
}

.metalwork-product-pdf-grid__card:focus-visible {
    outline: 2px solid var(--metalwork-pdf-accent);
    outline-offset: 3px;
}

.metalwork-product-pdf-grid__preview {
    position: relative;
    display: grid;
    min-height: 180px;
    overflow: hidden;
    place-items: center;
    background:
        linear-gradient(135deg, rgb(20 40 58 / 4%) 25%, transparent 25%) 0 0 / 18px 18px,
        #f0f3f5;
}

.metalwork-product-pdf-grid__image {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: contain;
    object-position: top center;
    transition: transform 250ms ease;
}

.metalwork-product-pdf-grid__card:hover .metalwork-product-pdf-grid__image {
    transform: scale(1.025);
}

.metalwork-product-pdf-grid__fallback {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 12px;
    color: #647483;
    font-size: 13px;
}

.metalwork-product-pdf-grid__badge {
    display: grid;
    width: 64px;
    height: 78px;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    place-items: center;
    background: var(--metalwork-pdf-accent);
    box-shadow: 8px 8px 0 rgb(20 40 58 / 12%);
    clip-path: polygon(0 0, 70% 0, 100% 25%, 100% 100%, 0 100%);
}

.metalwork-product-pdf-grid__open {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 8px 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--metalwork-pdf-ink);
    border-radius: 2px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.metalwork-product-pdf-grid__card:hover .metalwork-product-pdf-grid__open,
.metalwork-product-pdf-grid__card:focus-visible .metalwork-product-pdf-grid__open {
    opacity: 1;
    transform: translateY(0);
}

.metalwork-product-pdf-grid__details {
    display: flex;
    min-height: 62px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 10px 12px;
    border-top: 3px solid var(--metalwork-pdf-accent);
}

.metalwork-product-pdf-grid__product {
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
}

.metalwork-product-pdf-grid__filename {
    overflow: hidden;
    color: #71808d;
    font-size: 11px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metalwork-product-pdf-grid__empty {
    margin: 0;
    padding: 18px 20px;
    color: #647483;
    background: #f0f3f5;
    border-left: 3px solid var(--metalwork-pdf-accent);
}

@media (max-width: 767px) {
    .metalwork-product-pdf-grid__items {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 180px));
        gap: 12px;
    }

    .metalwork-product-pdf-grid__preview {
        min-height: 160px;
    }

    .metalwork-product-pdf-grid__image {
        height: 160px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .metalwork-product-pdf-grid__card,
    .metalwork-product-pdf-grid__image,
    .metalwork-product-pdf-grid__open {
        transition: none;
    }
}
