body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
}

.container.nocategories .categories {
    display: none;
}

.categories {
    margin-bottom: 20px;
}

.category {
    border: 1px solid #cfcfcf;
    background: #fff;
    color: #111;
    border-radius: 6px;
    padding: 9px 12px;
    cursor: pointer;
    font-weight: 700;
}

.category.active,
.category:hover {
    background: #b4152b;
    border-color: #b4152b;
    color: #fff;
}

.product-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    align-items: stretch;
}

.product-group {
    border: 1px solid #d7d7d7;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.product-group-title {
    margin: 0 0 8px;
    text-transform: lowercase;
    font-size: 15px;
    font-weight: 700;
    color: #444;
}

.product-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    flex: 1;
    align-content: start;
}

.product-filter {
    border: 1px solid #d2d2d2;
    border-radius: 8px;
    background: #f8f8f8;
    padding: 6px;
    cursor: pointer;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: visible;
    text-decoration: none;
    color: inherit;
}

.product-filter img {
    width: 100%;
    height: 62px;
    object-fit: contain;
    border-radius: 6px;
}

.product-filter span {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.product-filter.active,
.product-filter:hover {
    border-color: #b4152b;
    background: #fff4f6;
}

.filter-preview-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
    z-index: 1200;
}

.filter-preview-modal.open {
    display: flex;
}

.filter-preview-modal-inner {
    width: min(1180px, calc(100vw - 36px));
    max-height: calc(100vh - 52px);
    overflow: auto;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #d8d8d8;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    padding: 10px;
    position: relative;
}

.filter-preview-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #333;
}

.filter-preview-modal-title {
    display: block;
    margin: 0 28px 10px 2px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.filter-preview-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}

.preview-empty {
    padding: 22px 14px;
    border: 1px dashed #cfcfcf;
    border-radius: 8px;
    background: #fafafa;
    color: #666;
    font-size: 15px;
}

.filter-preview-modal-grid .item {
    border-radius: 6px;
}

.filter-preview-modal-grid .image-container {
    height: 180px;
}

.filter-preview-modal-grid .item-overlay h4 {
    font-size: 15px;
}

.filter-preview-modal-grid .doc-type {
    font-size: 13px;
}

.filter-preview-modal-grid .card-lang-flag {
    width: 18px;
}

.filter-preview-modal-grid .downloads-list a {
    font-size: 14px;
    padding: 6px 8px;
}

.group-type-filters {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 8px;
}

.type-filter {
    flex: 1;
    border: 1px solid #d2d2d2;
    border-radius: 6px;
    background: #fff;
    padding: 7px 10px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: inherit;
}

.type-filter.active,
.type-filter:hover {
    background: #b4152b;
    border-color: #b4152b;
    color: #fff;
}

.type-filter img {
    width: 22px;
    height: 30px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
    background: #f3f3f3;
}

.type-filter span {
    display: block;
    line-height: 1.1;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.item {
    background: #fff;
    border: 1px solid #dfdfdf;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.item-top {
    position: relative;
}

.image-container {
    width: 100%;
    height: 280px;
    background: #ececec url('light-bg-texture.jpg') center center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img {
    height: 100%;
}

.item-overlay {
    position: static;
    padding: 8px 10px 6px;
    background: #fff;
    color: #111;
    border-top: 1px solid #ececec;
}

.doc-type {
    margin: 0;
    font-size: 16px;
    text-align: center;
}

.card-languages {
    margin-top: 6px;
    display: flex;
    gap: 4px;
    justify-content: center;
}

.card-lang-flag {
    width: 22px;
    height: auto;
}

.page-count {
    margin: 5px 0 0;
    text-align: right;
    color: #f0f0f0;
    font-style: italic;
    font-size: 13px;
}

.downloads-list {
    border-top: 1px solid #e8e8e8;
}

.downloads-list a {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #111;
    padding: 7px 10px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 17px;
}

.downloads-list a:last-child {
    border-bottom: none;
}

.downloads-list a:hover {
    background: #f8f8f8;
}

.download-lang-flag {
    width: 15px;
    height: auto;
    flex: 0 0 auto;
}

.download-size {
    color: #666;
    font-style: italic;
}

.downloadpdf {
    display: none;
}

.static-sections {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.static-section {
    display: none;
    scroll-margin-top: 14px;
}

.static-section:target {
    display: block;
}

.static-section-title {
    margin: 0 0 8px;
    font-size: 20px;
    color: #222;
}

@media (max-width: 760px) {
    body {
        padding: 12px;
    }

    .product-groups {
        grid-template-columns: 1fr;
    }

    .gallery {
        grid-template-columns: 1fr;
    }

    .filter-preview-modal-inner {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }
}
