.category-page {
    padding: 3rem 0;
}

* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    position: sticky;
    top: 100px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.sidebar h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

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

.category-list li {
    margin: 0;
}

.category-list a {
    display: block;
    padding: 0.875rem 1.5rem;
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    line-height: 1.4;
}

.category-list a:hover {
    background: var(--bg-light);
    color: var(--main-color);
    border-left-color: var(--accent-color);
    padding-left: 1.75rem;
}

.category-list a.active,
.category-list li.current-cat > a,
.category-list li.current-cat-parent > a {
    background: #fff;
    color: var(--main-color);
    border-left-color: var(--main-color);
    font-weight: 600;
}

.category-list a.active:hover,
.category-list li.current-cat > a:hover,
.category-list li.current-cat-parent > a:hover {
    padding-left: 1.75rem;
    background: var(--bg-light);
}

/* ============================================
   PRODUCT GRID
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.product-card {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.product-card-description {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.product-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.product-card-excerpt {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    transition: all 0.3s ease;
}

.product-card-excerpt.expanded {
    display: block;
    -webkit-line-clamp: unset;
}

.product-card-excerpt {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    transition: all 0.3s ease;
}

.product-card-excerpt.expanded {
    display: block;
    -webkit-line-clamp: unset;
}

.product-card-toggle {
    background: none;
    border: none;
    color: var(--main-color);
    font-size: 0.85rem;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    cursor: pointer;
    text-align: left;
    font-weight: 500;
    transition: color 0.3s;
    align-self: flex-start;
}

.product-card-toggle:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.product-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary-sm {
    background: var(--main-color);
    border: 1px solid var(--main-color);
    color: #fff;
}

.btn-primary-sm:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-secondary-sm {
    background: transparent;
    border: 1px solid var(--main-color);
    color: var(--main-color);
}

.btn-secondary-sm:hover {
    background: var(--main-color);
    color: #fff;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-wrapper {
    margin-top: 4rem;
    padding: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
}

.pagination li {
    display: inline-block;
}

/* Styl dla wszystkich przycisków paginacji (numery, prev, next) w stylu btn-primary-sm (mniejsze) */
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    text-decoration: none;
    background: var(--main-color);
    border-color: var(--main-color);
    color: #fff;
    min-width: auto;
    height: auto;
    box-shadow: none;
}

.pagination a:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

/* Aktywna strona - ciemniejszy odcień */
.pagination .current,
.pagination .active,
.pagination span.current,
.pagination span.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    cursor: default;
}

/* Disabled (prev/next gdy nie ma więcej stron) */
.pagination .disabled a,
.pagination .disabled span,
.pagination a.disabled,
.pagination span.disabled {
    background: var(--bg-light);
    border-color: var(--border-light);
    color: #cbd5e0;
    pointer-events: none;
    opacity: 0.6;
}

/* Kropki - ukryj lub zrób bardziej subtelne */
.pagination .dots,
.pagination span.dots {
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: default;
    padding: 0.45rem 0.3rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .category-page {
        padding: 2rem 0;
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-card-actions {
        flex-direction: column;
    }
    
    .btn-sm {
        width: 100%;
    }
    
    .pagination-wrapper {
        margin-top: 3rem;
        padding: 1.5rem 0;
    }
    
    .pagination {
        gap: 0.5rem;
    }
    
    .pagination {
        gap: 0.4rem;
    }
    
    .pagination a,
    .pagination span {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
}