.category-page {
    padding: 20px 0 32px;
}

.category-page .category-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.category-page .category-main {
    min-width: 0;
}

.category-page .download-sidebar {
    position: sticky;
    top: 24px;
}

.category-page .mobile-category-bar {
    display: none;
    margin-bottom: 18px;
}

.category-page .category-tree-item {
    list-style: none;
}

.category-page .category-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-page .category-list.category-level-0 {
    margin-top: 6px;
}

.category-page .category-list.category-level-1,
.category-page .category-list.category-level-2,
.category-page .category-list.category-level-3 {
    margin-top: 6px;
    padding-left: 14px;
}

.category-page .category-tree-item.level-1 > a {
    font-size: 14px;
    padding-left: 18px;
    position: relative;
    color: #6b7280;
}

.category-page .category-tree-item.level-1 > a::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    width: 6px;
    height: 1px;
    background: #cbd5e1;
    transform: translateY(-50%);
}

.category-page .category-tree-item.level-2 > a {
    font-size: 13px;
    padding-left: 24px;
    position: relative;
    color: #6b7280;
}

.category-page .category-tree-item.level-2 > a::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 6px;
    height: 1px;
    background: #cbd5e1;
    transform: translateY(-50%);
}
}

/* TESTI SEO */
.category-page .category-seo-text {
    background: #fff;
    border-radius: 18px;
    padding: 14px 18px;
    line-height: 1.55;
    color: #384859;
}

.category-page .category-seo-text p {
    margin: 0 0 10px;
}

.category-page .category-seo-text p:last-child {
    margin-bottom: 0;
}

/* BANNER */
.category-page .banner-horizontal {
    margin: 0 0 16px;
}

.category-page .banner-placeholder-adsense {
    min-height: 88px;
    border: 2px dashed #ddd;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    background: #fafafa;
    text-align: center;
    padding: 18px;
}

/* TOOLBAR */
.category-page .category-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 10px 0 16px;
}

.category-page .category-toolbar-left,
.category-page .category-toolbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.category-page .category-toolbar-right {
    margin-left: auto;
}

.category-page .category-results-count {
    font-size: 15px;
    font-weight: 700;
    color: #6b7280;
    white-space: nowrap;
}

/* FILTRI INLINE */
.category-page .category-filters {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
}

.category-page .filter-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.category-page .filter-inline label {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    margin: 0;
}

.category-page .filter-select {
    min-width: 110px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background-color: #fff;
    padding: 0 38px 0 14px;
    font-size: 14px;
    color: #384859;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'><path d='M5 7.5L10 12.5L15 7.5' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
}

.category-page .filter-select:focus {
    border-color: #ff3152;
    box-shadow: 0 0 0 3px rgba(255, 49, 82, 0.08);
}

.category-page .filter-select.filter-select-per-page {
    width: 80px;
    min-width: 80px;
    padding-right: 30px;
    padding-left: 13px;
    background-position: right 10px center;
}

/* PAGINAZIONE NELLA TOOLBAR */
.category-page .toolbar-pagination-wrap {
    display: flex;
    align-items: center;
}

.category-page .category-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
}

.category-page .page-number,
.category-page .page-arrow {
    min-width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #384859;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
}

.category-page .page-number:hover,
.category-page .page-arrow:hover {
    border-color: #ff3152;
    color: #ff3152;
    background: #fff1f4;
}

.category-page .page-number.active {
    border-color: #ff3152;
    background: #ff3152;
    color: #fff;
}

.category-page .page-arrow.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.category-page .page-dots {
    color: #9ca3af;
    font-weight: 700;
    padding: 0 2px;
}

/* SWITCH LAYOUT */
.category-page .layout-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-page .layout-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #9ca3af;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-page .layout-btn:hover,
.category-page .layout-btn.active {
    border-color: #ff3152;
    color: #ff3152;
    background: #fff1f4;
}

.category-page .layout-icon {
    display: grid;
    gap: 3px;
}

.category-page .layout-icon span {
    width: 5px;
    height: 5px;
    background: currentColor;
    border-radius: 2px;
    display: block;
}

.category-page .layout-icon-dense {
    grid-template-columns: repeat(3, 1fr);
}

.category-page .layout-icon-medium {
    grid-template-columns: repeat(2, 1fr);
}

.category-page .layout-icon-wide {
    grid-template-columns: repeat(3, 1fr);
}

.category-page .layout-icon-wide span:nth-child(1),
.category-page .layout-icon-wide span:nth-child(2),
.category-page .layout-icon-wide span:nth-child(3) {
    width: 7px;
    height: 7px;
}

/* GRIGLIA */
.category-page .category-grid {
    display: grid;
    gap: 18px;
    margin-bottom: 30px;
    margin-top: 30px;
}

.category-page .category-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.category-page .category-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.category-page .category-grid.cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.category-page .category-card {
    display: block;
    text-decoration: none;
}

.category-page .category-card-thumb {
    position: relative;
    background: #f3f3f3;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1 / 1.28;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-page .category-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-page .category-card:hover .category-card-thumb {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.category-page .empty-category-box {
    background: #fff;
    border-radius: 18px;
    padding: 30px;
    color: #666;
}

/* PAGINAZIONE SOTTO LA GRIGLIA */
.category-page .category-grid-section + .category-pagination {
    margin-top: 12px;
    margin-bottom: 18px;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .category-page .category-grid.cols-5 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .category-page .category-layout {
        grid-template-columns: 210px minmax(0, 1fr);
        gap: 22px;
    }

    .category-page .category-grid.cols-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .category-page .category-grid.cols-5 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .category-page .category-layout {
        grid-template-columns: 1fr;
    }

    .category-page .download-sidebar {
        display: none;
    }

    .category-page .mobile-category-bar {
        display: block;
    }

    .category-page .category-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .category-page .category-toolbar-left,
    .category-page .category-toolbar-right {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .category-page .category-filters {
        flex-wrap: wrap;
    }

    .category-page .category-pagination {
        justify-content: center;
    }

    .category-page .category-grid.cols-3,
    .category-page .category-grid.cols-4,
    .category-page .category-grid.cols-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .category-page {
        padding: 18px 0 28px;
    }

    .category-page .category-seo-text {
        padding: 14px;
        border-radius: 14px;
    }

    .category-page .category-grid.cols-3,
    .category-page .category-grid.cols-4,
    .category-page .category-grid.cols-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .category-page .category-card-thumb {
        border-radius: 14px;
    }

    .category-page .banner-placeholder-adsense {
        min-height: 84px;
        border-radius: 14px;
    }

    .category-page .filter-select {
        min-width: 92px;
        height: 38px;
    }

    .category-page .filter-select.filter-select-per-page {
        width: 76px;
        min-width: 76px;
    }

    .category-page .page-number,
    .category-page .page-arrow,
    .category-page .layout-btn {
        min-width: 38px;
        width: 38px;
        height: 38px;
    }
}

/* Descrizioni: riquadri discreti, separati dalle barre di navigazione. */
.category-page .category-seo-text{border:1px solid #ececec;border-radius:20px;padding:24px 28px;color:#626b78;margin:0 0 28px;line-height:1.75}
.category-page .category-seo-text-bottom{margin:28px 0 0}
.category-page .category-seo-text :is(p,strong,b,h2,h3,li){color:inherit}
@media(max-width:600px){.category-page .category-seo-text{padding:19px 20px;border-radius:18px}}
